From: sashiko-bot@kernel.org
To: "Sanjay Govind" <sanjay.govind9@gmail.com>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH v13] Input: xpad - overhaul device data for wireless devices
Date: Sun, 15 Nov 2026 02:04:53 +0000 [thread overview]
Message-ID: <sashiko-outbox-215182@kernel.org> (raw)
In-Reply-To: <20261115015219.476559-3-sanjay.govind9@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] Input: xpad: suppressed error in xpad_inquiry_pad_capabilities()
--
commit 5282eadaef0f6daaa8a82974e8e887e15c4815b3
Author: Sanjay Govind <sanjay.govind9@gmail.com>
Input: xpad - overhaul device data for wireless devices
This commit updates Xbox 360 wireless controller discovery to populate
input device names and IDs from link and capabilities reports, deferring
registration until capabilities arrive or a 500ms timeout expires.
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index d2eb48d98fead..46290197dbd1a 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
[ ... ]
> @@ -1488,6 +1688,31 @@ static int xpad_inquiry_pad_presence(struct usb_xpad *xpad)
> return xpad_try_sending_next_out_packet(xpad);
> }
>
> +static int xpad_inquiry_pad_capabilities(struct usb_xpad *xpad)
> +{
> + struct xpad_output_packet *packet =
> + &xpad->out_packets[XPAD_OUT_CAPS_IDX];
> + static const u8 caps_inquiry[] = {
> + 0x00, 0x00, 0x02, 0x80, 0x00, 0x00,
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
> + };
> + int error;
> +
> + guard(spinlock_irqsave)(&xpad->odata_lock);
> +
> + packet->len = sizeof(caps_inquiry);
> + memcpy(packet->data, caps_inquiry, packet->len);
> + packet->pending = true;
> +
> + error = xpad_try_sending_next_out_packet(xpad);
> +
> + /*
> + * The failed submission may have been for another pending packet.
> + * Only report an error if the capabilities request was dropped.
> + */
> + return packet->pending ? 0 : error;
> +}
[Severity: Low]
Does returning 0 when packet->pending is true mask a failed submission in
xpad_try_sending_next_out_packet()?
xpad_try_sending_next_out_packet() only calls usb_submit_urb() when
xpad->irq_out_active is false, so a non-zero error means no output URB is
in flight to drain the ring. If an earlier slot in xpad->out_packets was
prepared first and its usb_submit_urb() failed, packet->pending remains
true here, causing xpad360w_process_packet() to wait for the 500ms
discovery timeout instead of finishing immediately, and leaving a stale
capabilities request pending in out_packets[XPAD_OUT_CAPS_IDX].
If error is non-zero, should packet->pending be cleared and error returned
unconditionally?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261115015219.476559-3-sanjay.govind9@gmail.com?part=1
prev parent reply other threads:[~2026-11-15 2:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-15 1:52 [PATCH v13] Input: xpad - overhaul device data for wireless devices Sanjay Govind
2026-11-15 2:04 ` 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-215182@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=sanjay.govind9@gmail.com \
--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