Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Matías Martínez" <hello@matias.me>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH v6] HID: ayaneo: Add AYANEO 3 detachable controller driver
Date: Fri, 13 Nov 2026 23:36:08 +0000	[thread overview]
Message-ID: <sashiko-outbox-213870@kernel.org> (raw)
In-Reply-To: <20261113232228.17553-1-hello@matias.me>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] HID: ayaneo: spurious -ENODEV errors and traffic on LED
  unregister
--

commit 503e8577930caa05e37b8ae2f759096d42ca369b
Author: Matías Martínez <hello@matias.me>

HID: ayaneo: Add AYANEO 3 detachable controller driver

This commit adds a HID driver for the AYANEO 3 detachable controller,
supporting module identification, software eject, rumble intensity,
configuration reset, and multicolor LED control on its vendor interface.

> diff --git a/drivers/hid/hid-ayaneo.c b/drivers/hid/hid-ayaneo.c
> new file mode 100644
> index 0000000000000..abb754a2a0534
> --- /dev/null
> +++ b/drivers/hid/hid-ayaneo.c

[ ... ]

> +static int ayaneo_led_set(struct led_classdev *cdev, enum led_brightness value)
> +{
> +	struct led_classdev_mc *mc = lcdev_to_mccdev(cdev);
> +	struct ayaneo *aya = container_of(mc, struct ayaneo, mcled);
> +	int ret, i;
> +
> +	ACQUIRE(mutex_intr, lock)(&aya->lock);
> +	ret = ACQUIRE_ERR(mutex_intr, &lock);
> +	if (ret)
> +		return ret;
> +
> +	led_mc_calc_color_components(mc, value);
> +	aya->brightness = min(value, U8_MAX);
> +	for (i = 0; i < ARRAY_SIZE(aya->subleds); i++)
> +		aya->rgb[i] = min(aya->subleds[i].brightness, U8_MAX);
> +
> +	ret = ayaneo_send_config(aya, 0);
> +	if (ret)
> +		hid_err(aya->hdev, "failed to update RGB config: %d\n", ret);
> +	return ret;
> +}

[ ... ]

> +static int ayaneo_register_led(struct ayaneo *aya)
> +{
> +	struct led_classdev *cdev = &aya->mcled.led_cdev;
> +	int ret, i;

[ ... ]

> +	cdev->color = LED_COLOR_ID_RGB;
> +	cdev->brightness = 0;
> +	cdev->max_brightness = U8_MAX;
> +	cdev->brightness_set_blocking = ayaneo_led_set;

[Severity: Low]
Does unregistering the LED on controller power-off or unbind log spurious
-ENODEV errors and send unwanted config traffic?

When the controller is powered off (including after an eject handshake) or
disconnected, usb_disconnect() marks the device detached before
ayaneo_remove() runs.  led_classdev_multicolor_unregister() then issues an
LED_OFF write via set_brightness_work, which fails with -ENODEV in
ayaneo_send().  Because cdev->flags does not set LED_HW_PLUGGABLE and
ayaneo_led_set() logs all errors unconditionally, both ayaneo_led_set() and
the LED core log -ENODEV errors on every disconnect.

In addition, when the driver is unbound while aya->configured is false, that
same LED_OFF write during unregister still sends a 65-byte config report to
the device, even though the driver otherwise avoids sending traffic unless
userspace has configured it.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261113232228.17553-1-hello@matias.me?part=1

      reply	other threads:[~2026-11-13 23:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 23:22 [PATCH v6] HID: ayaneo: Add AYANEO 3 detachable controller driver Matías Martínez
2026-11-13 23:36 ` 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-213870@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hello@matias.me \
    --cc=linux-input@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