From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
To: Florian Fuchs <fuchsfl@gmail.com>,
linux-sh@vger.kernel.org, Rich Felker <dalias@libc.org>,
Artur Rojek <contact@artur-rojek.eu>
Cc: linux-kernel@vger.kernel.org,
Adrian McMenamin <adrianmcmenamin@gmail.com>
Subject: Re: [PATCH v3] sh: maple: fix empty port handling
Date: Tue, 06 Oct 2026 10:52:45 +0200 [thread overview]
Message-ID: <44df76d122650e6a95d1fd2e95bc6c66d4001d4b.camel@physik.fu-berlin.de> (raw)
In-Reply-To: <20260515181115.3244161-1-fuchsfl@gmail.com>
Hi Florian,
On Fri, 2026-05-15 at 20:11 +0200, Florian Fuchs wrote:
> Fix empty Maple port handling so the bus works with fewer than four
> populated ports and devices can be hot-plugged at runtime.
The description doesn't really add much information to what the title
says. It would be more helpful if the description briefly described
the actual bug and how it was fixed.
Adrian
> Cast the response code to s8 so 0xff is handled as MAPLE_RESPONSE_NONE,
> continue scanning after empty ports, and process devinfo replies for
> empty unit-0 ports.
>
> Tested-by: Artur Rojek <contact@artur-rojek.eu>
> Acked-by: Artur Rojek <contact@artur-rojek.eu>
> Signed-off-by: Florian Fuchs <fuchsfl@gmail.com>
> ---
> v2->v3: No functional change. Condense commit message and add Tested-by,
> Acked-by tags.
> v1->v2: Don't break hot-plugging of new devices to empty ports.
> Explicitly cast the response code to s8 to use the existing
> logic, that relies on signed chars. In the case of 0xff (all 1s,
> DCs TIMEOUT response) that was interpreted as 255 unknown response
> code, which blocked the maple bus, as busy was never reset. Add
> condition to maple_response_devinfo() to process the devinfo
> for currently empty ports.
>
> v2: https://lore.kernel.org/all/20260426212714.2286437-1-fuchsfl@gmail.com/
> v1: https://lore.kernel.org/all/20251112190444.3631533-1-fuchsfl@gmail.com/
>
> drivers/sh/maple/maple.c | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/sh/maple/maple.c b/drivers/sh/maple/maple.c
> index 5585f220e495..8e7bb42aef07 100644
> --- a/drivers/sh/maple/maple.c
> +++ b/drivers/sh/maple/maple.c
> @@ -445,7 +445,7 @@ static int setup_maple_commands(struct device *device, void *ignored)
> /* VBLANK bottom half - implemented via workqueue */
> static void maple_vblank_handler(struct work_struct *work)
> {
> - int x, locking;
> + int x;
> struct maple_device *mdev;
>
> if (!maple_dma_done())
> @@ -474,13 +474,10 @@ static void maple_vblank_handler(struct work_struct *work)
> if (!mdev)
> break;
> atomic_set(&mdev->busy, 1);
> - locking = maple_add_packet(mdev, 0,
> + maple_add_packet(mdev, 0,
> MAPLE_COMMAND_DEVINFO, 0, NULL);
> - if (!locking)
> - break;
> - }
> }
> -
> + }
> maple_pnp_time = jiffies + MAPLE_PNP_INTERVAL;
> }
>
> @@ -578,7 +575,8 @@ static void maple_response_devinfo(struct maple_device *mdev,
> char *recvbuf)
> {
> char submask;
> - if (!started || (scanning == 2) || !fullscan) {
> + if (!started || (scanning == 2) || !fullscan ||
> + ((mdev->unit == 0) && empty[mdev->port])) {
> if ((mdev->unit == 0) && (checked[mdev->port] == false)) {
> checked[mdev->port] = true;
> maple_attach_driver(mdev);
> @@ -644,7 +642,7 @@ static void maple_dma_handler(struct work_struct *work)
> recvbuf = mq->recvbuf->buf;
> __flush_invalidate_region(sh_cacheop_vaddr(recvbuf),
> 0x400);
> - code = recvbuf[0];
> + code = (s8)recvbuf[0];
> kfree(mq->sendbuf);
> list_del_init(&mq->list);
> switch (code) {
>
> base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
prev parent reply other threads:[~2026-10-06 8:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 18:11 Florian Fuchs
2026-10-06 8:52 ` John Paul Adrian Glaubitz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44df76d122650e6a95d1fd2e95bc6c66d4001d4b.camel@physik.fu-berlin.de \
--to=glaubitz@physik.fu-berlin.de \
--cc=adrianmcmenamin@gmail.com \
--cc=contact@artur-rojek.eu \
--cc=dalias@libc.org \
--cc=fuchsfl@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®