From: sashiko-bot@kernel.org
To: "Dmitry Dagunts" <ddagunts@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: musb: host: don't add the sg offset twice in PIO TX
Date: Wed, 25 Nov 2026 16:55:07 +0000 [thread overview]
Message-ID: <sashiko-outbox-233785@kernel.org> (raw)
In-Reply-To: <20261125164942.1310501-1-ddagunts@gmail.com>
> A PIO OUT URB without a transfer_buffer gets its first packet through a
> sg_mapping_iter. sg_miter.addr already includes the offset of the sg
> entry, but musb_ep_program() adds urb->sg->offset again. With a nonzero
> offset the first packet is read from the wrong address: wrong data is
> sent, or the read faults if that address is past the mapped page. The
> packets that follow are loaded by musb_host_tx(), which uses
> sg_miter.addr as it is.
>
> With usb-storage this needs CONFIG_HIGHMEM, because usb_sg_init() leaves
> transfer_buffer NULL only for highmem pages, and a sub-page write. The
> highmem check in usb-storage does not catch it, as musb sets HCD_DMA even
> if it is built PIO only.
>
> Drop urb->actual_length too: for bulk and interrupt URBs it is always 0
> if buf is NULL.
> [ ... ]
> run the test, and to write this fix and changelog.
>
> Fixes: 8e8a55165469 ("usb: musb: host: Handle highmem in PIO mode")
> Cc: stable@vger.kernel.org
> Signed-off-by: Dmitry Dagunts <ddagunts@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261125164942.1310501-1-ddagunts@gmail.com?part=1
prev parent reply other threads:[~2026-11-25 16:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 16:49 [PATCH] usb: musb: host: don't add the sg offset twice in PIO TX Dmitry Dagunts
2026-11-25 16:55 ` sashiko-bot [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=sashiko-outbox-233785@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=ddagunts@gmail.com \
--cc=linux-usb@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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