From: sashiko-bot@kernel.org
To: "Vernon Di Carlo" <vernondicarlo@gmail.com>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org
Subject: Re: [PATCH v2] Input: xpad - fix button mapping on Razer Atrox Xbox One
Date: Fri, 07 Aug 2026 14:58:56 +0000 [thread overview]
Message-ID: <20260807145856.CF6C91F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260807144153.8430-1-vernondicarlo@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Handling GIP_CMD_ANNOUNCE in the URB completion handler calls xpad_start_input(), which sleeps and double-submits the URB.
--
--- Patch [1]: [PATCH v2] Input: xpad - fix button mapping on Razer Atrox Xbox One ---
commit f5450a413687f18b1cfa1f3ba3fe1938a5e5c72f
Author: Vernon Di Carlo <vernondicarlo@gmail.com>
Input: xpad - fix button mapping on Razer Atrox Xbox One
This patch adds an Atrox-specific mapping quirk to swap LB/RB and report
LT/RT from their actual locations for the Razer Atrox Arcade Stick for Xbox
One. It also rejects short Atrox input packets.
> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
> index feb8f368f834e..00de9145e0916 100644
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
[ ... ]
> @@ -1079,6 +1081,9 @@ static void xpadone_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char
> error);
> }
[Severity: High]
This is a pre-existing issue, but while looking at this context, I noticed
that handling GIP_CMD_ANNOUNCE here calls xpad_start_input(), which appears
to sleep in atomic context and double-submit the URB.
Since xpadone_process_packet() is called from the URB completion handler
xpad_irq_in() (atomic context), does calling xpad_start_input() trigger a
sleeping in atomic context bug?
Looking at xpad_start_input(), it makes a GFP_KERNEL allocation and submits
the URB:
if (usb_submit_urb(xpad->irq_in, GFP_KERNEL))
return -EIO;
Then when it returns, xpad_irq_in() subsequently attempts to submit the same
URB a second time:
retval = usb_submit_urb(urb, GFP_ATOMIC);
Could this lead to deadlocks or panics, and potentially corrupt the USB
core state due to the double submission?
> } else if (data[0] == GIP_CMD_INPUT) { /* The main valid packet type for inputs */
> + if ((xpad->mapping & MAP_ATROX) && len <= 22)
> + return;
> +
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260807144153.8430-1-vernondicarlo@gmail.com?part=1
prev parent reply other threads:[~2026-08-07 14:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 14:14 [PATCH] Input: xpad - fix button mapping on Razer Atrox Xbox One Vernon Di Carlo
2026-08-07 14:22 ` sashiko-bot
2026-08-07 14:41 ` [PATCH v2] " Vernon Di Carlo
2026-08-07 14:58 ` 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=20260807145856.CF6C91F00A3D@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vernondicarlo@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.