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 v3] HID: santroller: add driver for Santroller controllers
Date: Sun, 08 Nov 2026 00:06:11 +0000 [thread overview]
Message-ID: <sashiko-outbox-203404@kernel.org> (raw)
In-Reply-To: <20261107234444.960207-2-sanjay.govind9@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] HID: santroller: stale brightness read in
santroller_player_led_set()
- [Low] HID: santroller: USB profile naming compiled out when USB_HID=m
and HID_SANTROLLER=y
--
commit 28369893e9b4de37e159a34ce2a7a1ca4302cd7d
Author: Sanjay Govind <sanjay.govind9@gmail.com>
HID: santroller: add driver for Santroller controllers
This commit adds a HID driver for Santroller USB and Bluetooth game
controllers and instruments, supporting profile naming, rumble, player
LEDs, RGB indicator LEDs, and turntable euphoria LEDs.
> diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> index 2481bc01c435b..2fab7003ce18f 100644
> --- a/drivers/hid/Kconfig
> +++ b/drivers/hid/Kconfig
> @@ -1138,6 +1138,18 @@ config HID_SAMSUNG
> help
> Support for Samsung InfraRed remote control or keyboards.
>
> +config HID_SANTROLLER
> + tristate "Santroller game controller support"
> + depends on LEDS_CLASS_MULTICOLOR
> + select INPUT_FF_MEMLESS
[Severity: Low]
Should this also depend on USB_HID || !USB_HID? When CONFIG_HID_SANTROLLER=y
and CONFIG_USB_HID=m, IS_REACHABLE(CONFIG_USB_HID) in
santroller_profile_name() evaluates to false and silently compiles out USB
profile naming even though USB HID support is enabled.
> diff --git a/drivers/hid/hid-santroller.c b/drivers/hid/hid-santroller.c
> new file mode 100644
> index 0000000000000..7dcc5d7eae604
> --- /dev/null
> +++ b/drivers/hid/hid-santroller.c
[ ... ]
> +static void santroller_player_led_set(struct led_classdev *led,
> + enum led_brightness value)
> +{
> + struct hid_device *hdev = to_hid_device(led->dev->parent);
> + struct santroller *sc = hid_get_drvdata(hdev);
> + int i;
> +
> + guard(spinlock_irqsave)(&sc->lock);
> +
> + sc->player = SANTROLLER_PLAYER_LED_OFF;
> + for (i = 0; i < SANTROLLER_NUM_PLAYER_LEDS; i++) {
> + if (sc->player_leds[i].brightness) {
> + sc->player = i;
> + break;
> + }
> + }
> + sc->player_dirty = true;
> + santroller_schedule_output(sc);
> +}
[Severity: Medium]
Can santroller_player_led_set() send a stale player LED state by ignoring
value and reading sc->player_leds[i].brightness?
When software blinking (such as the timer trigger) is stopped while the LED
is in its ON phase, led_set_brightness(led_cdev, LED_OFF) defers the update
to set_brightness_delayed() without clearing led_cdev->brightness:
drivers/leds/led-core.c:set_brightness_delayed() {
...
if (test_and_clear_bit(LED_SET_BRIGHTNESS_OFF, &led_cdev->work_flags)) {
set_brightness_delayed_set_brightness(led_cdev, LED_OFF);
...
}
set_brightness_delayed_set_brightness() calls __led_set_brightness(led_cdev,
LED_OFF) -> santroller_player_led_set(led_cdev, LED_OFF) while
led->brightness is still 1, leaving the hardware player LED lit. Using
value for the entry matching led (or updating led->brightness = value under
sc->lock before the loop) would keep the state in sync.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261107234444.960207-2-sanjay.govind9@gmail.com?part=1
prev parent reply other threads:[~2026-11-08 0:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-07 23:44 [PATCH v3] HID: santroller: add driver for Santroller controllers Sanjay Govind
2026-11-08 0:06 ` 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-203404@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