From: sashiko-bot@kernel.org
To: "Lee Yongjun" <jun85566@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH v2] usb-storage: option_ms: bound probe-time bulk transfers
Date: Wed, 21 Oct 2026 08:22:26 +0000 [thread overview]
Message-ID: <sashiko-outbox-179958@kernel.org> (raw)
In-Reply-To: <20261021081616.89976-1-jun85566@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] usb-storage: option_ms: undeclared helper usb_stor_bulk_transfer_buf_timeout()
--
commit 67810d8c99cea0179f022bfe478460be6b644ac8
Author: Lee Yongjun <jun85566@gmail.com>
usb-storage: option_ms: bound probe-time bulk transfers
This commit replaces the bulk transfer calls in option_rezero() and
option_inquiry() with usb_stor_bulk_transfer_buf_timeout() to bound probe-time
transfers to 5 seconds. As noted in the patch commentary, this change depends
on an unmerged series from Hongyu Xie that introduces the timeout helper.
> diff --git a/drivers/usb/storage/option_ms.c b/drivers/usb/storage/option_ms.c
> index 7c0b05a365543..d844fcaaf3fc6 100644
> --- a/drivers/usb/storage/option_ms.c
> +++ b/drivers/usb/storage/option_ms.c
[ ... ]
> @@ -44,9 +46,9 @@ static int option_rezero(struct us_data *us)
> return USB_STOR_TRANSPORT_ERROR;
>
> memcpy(buffer, rezero_msg, sizeof(rezero_msg));
> - result = usb_stor_bulk_transfer_buf(us,
> - us->send_bulk_pipe,
> - buffer, sizeof(rezero_msg), NULL);
> + result = usb_stor_bulk_transfer_buf_timeout(us, us->send_bulk_pipe,
> + buffer, sizeof(rezero_msg), NULL,
> + OPTION_MS_PROBE_TIMEOUT);
> if (result != USB_STOR_XFER_GOOD) {
> result = USB_STOR_XFER_ERROR;
> goto out;
> @@ -56,14 +58,14 @@ static int option_rezero(struct us_data *us)
> * Some of the devices need to be asked for a response, but we don't
> * care what that response is.
> */
> - usb_stor_bulk_transfer_buf(us,
> - us->recv_bulk_pipe,
> - buffer, RESPONSE_LEN, NULL);
> + usb_stor_bulk_transfer_buf_timeout(us, us->recv_bulk_pipe,
> + buffer, RESPONSE_LEN, NULL,
> + OPTION_MS_PROBE_TIMEOUT);
>
> /* Read the CSW */
> - usb_stor_bulk_transfer_buf(us,
> - us->recv_bulk_pipe,
> - buffer, 13, NULL);
> + usb_stor_bulk_transfer_buf_timeout(us, us->recv_bulk_pipe,
> + buffer, 13, NULL,
> + OPTION_MS_PROBE_TIMEOUT);
>
> result = USB_STOR_XFER_GOOD;
>
> @@ -90,17 +92,17 @@ static int option_inquiry(struct us_data *us)
> return USB_STOR_TRANSPORT_ERROR;
>
> memcpy(buffer, inquiry_msg, sizeof(inquiry_msg));
> - result = usb_stor_bulk_transfer_buf(us,
> - us->send_bulk_pipe,
> - buffer, sizeof(inquiry_msg), NULL);
> + result = usb_stor_bulk_transfer_buf_timeout(us, us->send_bulk_pipe,
> + buffer, sizeof(inquiry_msg), NULL,
> + OPTION_MS_PROBE_TIMEOUT);
> if (result != USB_STOR_XFER_GOOD) {
> result = USB_STOR_XFER_ERROR;
> goto out;
> }
>
> - result = usb_stor_bulk_transfer_buf(us,
> - us->recv_bulk_pipe,
> - buffer, 0x24, NULL);
> + result = usb_stor_bulk_transfer_buf_timeout(us, us->recv_bulk_pipe,
> + buffer, 0x24, NULL,
> + OPTION_MS_PROBE_TIMEOUT);
> if (result != USB_STOR_XFER_GOOD) {
> result = USB_STOR_XFER_ERROR;
> goto out;
> @@ -112,9 +114,9 @@ static int option_inquiry(struct us_data *us)
> result = memcmp(buffer+8, "ZCOPTION", 8);
>
> /* Read the CSW */
> - usb_stor_bulk_transfer_buf(us,
> - us->recv_bulk_pipe,
> - buffer, 13, NULL);
> + usb_stor_bulk_transfer_buf_timeout(us, us->recv_bulk_pipe,
> + buffer, 13, NULL,
> + OPTION_MS_PROBE_TIMEOUT);
>
> out:
> kfree(buffer);
[Severity: Low]
Does building drivers/usb/storage/option_ms.c with CONFIG_USB_STORAGE enabled
fail here with an implicit function declaration error?
In drivers/usb/storage/option_ms.c, option_rezero() and option_inquiry() call
usb_stor_bulk_transfer_buf_timeout(), but drivers/usb/storage/transport.h only
declares usb_stor_bulk_transfer_buf():
extern int usb_stor_bulk_transfer_buf(struct us_data *us, unsigned int pipe,
void *buf, unsigned int length, unsigned int *act_len);
and usb_stor_bulk_transfer_buf_timeout() is not yet defined in
drivers/usb/storage/transport.c because the prerequisite patch series is not
present in the tree.
([1] https://lore.kernel.org/r/20261001123135.38831-1-xy521521@gmail.com/)
([1] Note: this patch mentions a dependency below "---" on Hongyu Xie's
pending series, which may explain why usb_stor_bulk_transfer_buf_timeout()
is missing in this tree.)
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261021081616.89976-1-jun85566@gmail.com?part=1
next prev parent reply other threads:[~2026-10-21 8:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 8:16 [PATCH v2] usb-storage: option_ms: bound probe-time bulk transfers Lee Yongjun
2026-10-21 8:22 ` sashiko-bot [this message]
2026-10-21 9:48 ` Oliver Neukum
2026-10-21 22:22 ` kernel test robot
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-179958@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=jun85566@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