Linux Input/HID development
 help / color / mirror / Atom feed
From: "Matías Martínez" <hello@matias.me>
To: linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <bentiss@kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Antheas Kapenekakis <lkml@antheas.dev>,
	Denis Benato <denis.benato@linux.dev>
Subject: Re: [PATCH] HID: ayaneo: Add AYANEO 3 detachable controller driver
Date: Mon, 24 Aug 2026 18:47:47 -0400	[thread overview]
Message-ID: <20260824224747.97198-1-hello@matias.me> (raw)
In-Reply-To: <20260824220125.297EE1F000E9@smtp.kernel.org>

Addressing the four findings for the humans on the thread — the bot
went two for four:

- The devres ordering issue is real, and understated: any brightness
  write racing a driver unbind could queue LED work that runs after
  hid_hw_stop() and after devres frees the driver data. I reproduced
  memory corruption by unbinding under a brightness-write loop, and
  the window is reachable in normal use (the controller power-cycles
  on resume and on module eject while userspace may be writing the
  LED). v2 registers the LED without devm, unregisters it first in
  remove, and flushes set_brightness_work again once the sysfs node
  is provably gone — a store can requeue it between the flush inside
  led_classdev_unregister() and the device_unregister() that follows.

- The eject-loop stall on unplug is real too. v2 aborts on fatal
  transport errors and only keeps polling on timeouts.

- The maxcollection finding is not a crash: hid_open_report()
  zero-allocates the collection array, so a descriptor with no
  collections reads usage 0 and probe returns -ENODEV. v2 adds an
  explicit maxcollection check anyway, as it states the intent
  better.

- The stale-reply race cannot cross commands: replies are matched on
  the echoed subcommand byte, so a late reply can only complete a
  retry of the same command, and those are interchangeable snapshots
  milliseconds apart. v2 documents this in aya3_raw_event().

All of the above is in v2, along with Antheas's review items.

Matías

  reply	other threads:[~2026-08-24 22:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 21:50 [PATCH] HID: ayaneo: Add AYANEO 3 detachable controller driver Matías Martínez
2026-08-24 22:00 ` Antheas Kapenekakis
2026-08-24 22:25   ` Antheas Kapenekakis
2026-08-24 22:47     ` Matías Martínez
2026-08-24 23:23       ` Antheas Kapenekakis
2026-08-25 17:21         ` Matías Martínez
2026-08-24 22:01 ` sashiko-bot
2026-08-24 22:47   ` Matías Martínez [this message]
2026-08-24 22:31 ` [PATCH v2] " Matías Martínez
2026-08-24 22:41   ` 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=20260824224747.97198-1-hello@matias.me \
    --to=hello@matias.me \
    --cc=bentiss@kernel.org \
    --cc=denis.benato@linux.dev \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@antheas.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