From: sashiko-bot@kernel.org
To: VegetablCat <vegetablecat@foxmail.com>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org
Subject: Re: [PATCH] Input: xpad - add support for Beitong KP series controllers
Date: Sun, 26 Jul 2026 08:26:48 +0000 [thread overview]
Message-ID: <20260726082648.A1D551F000E9@smtp.kernel.org> (raw)
In-Reply-To: <tencent_3FA5706BA66E2CCCFA362E90F805A8FF370A@qq.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Aggressive 25ms timeout for USB control message can cause device initialization failures.
- [Low] Build Error / Linker Failure when CONFIG_JOYSTICK_XPAD=y and CONFIG_HID=m.
--
--- Patch [1]: [PATCH] Input: xpad - add support for Beitong KP series controllers ---
commit abec748a4c53845b79c26002cb6f3fc8b88c0708
Author: vegetablecat <vegetablecat@foxmail.com>
Input: xpad - add support for Beitong KP series controllers
This patch adds support for Beitong KP series controllers by reading the
XUSB10 descriptor to lock them into XInput mode. It also includes an optional
HID receiver driver for the KP40D dongle to prevent hid-generic interference.
> --- a/drivers/input/joystick/xpad.c
> +++ b/drivers/input/joystick/xpad.c
[ ... ]
> @@ -2148,6 +2180,19 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
> xpad->irq_in->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
>
> usb_set_intfdata(intf, xpad);
> + if (xpad->read_xusb10) {
> + error = usb_control_msg_recv(udev, 0, 0xee,
> + USB_TYPE_VENDOR | USB_DIR_IN |
> + USB_RECIP_DEVICE,
> + 0x0000, 0x0004,
> + ms_feature_descriptor,
> + sizeof(ms_feature_descriptor), 25,
[Severity: Medium]
Is this 25ms timeout for usb_control_msg_recv() too aggressive?
Standard USB timeouts (e.g., USB_CTRL_GET_TIMEOUT) are typically 5000ms. A
25ms timeout risks transient probe failures on busy systems or slower USB
hubs, which could cause the device to fail to stay in XInput mode.
> + GFP_KERNEL);
> + if (error)
> + dev_warn(&intf->dev,
> + "unable to read Microsoft feature descriptor: %d\n",
> + error);
> + }
[ ... ]
> +static int __init xpad_init(void)
> +{
> + int error;
> +
> +#if IS_ENABLED(CONFIG_HID)
> + error = hid_register_driver(&xpad_receiver_driver);
[Severity: Low]
Will this cause a build error when CONFIG_JOYSTICK_XPAD=y and CONFIG_HID=m?
IS_ENABLED(CONFIG_HID) evaluates to true even when HID is built as a loadable
module. Since xpad is built into the main kernel image in this configuration,
it cannot link against module symbols, leading to a vmlinux link error.
Should this be #if IS_REACHABLE(CONFIG_HID) or managed via a Kconfig
dependency instead?
> + if (error)
> + return error;
> +#endif
> +
> + error = usb_register(&xpad_driver);
--
Sashiko AI review · https://sashiko.dev/#/patchset/tencent_3FA5706BA66E2CCCFA362E90F805A8FF370A@qq.com?part=1
next prev parent reply other threads:[~2026-07-26 8:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-26 8:18 [PATCH] Input: xpad - add support for Beitong KP series controllers VegetablCat
2026-07-26 8:26 ` sashiko-bot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-07-26 17:39 VegetablCat
2026-07-26 17:50 ` sashiko-bot
2026-07-26 8:01 VegetablCat
2026-07-26 8:10 ` sashiko-bot
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=20260726082648.A1D551F000E9@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=vegetablecat@foxmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox