From: sashiko-bot@kernel.org
To: "Denis Benato" <denis.benato@linux.dev>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org
Subject: Re: [PATCH v3 04/12] HID: asus: add vibration strength configuration
Date: Sun, 23 Aug 2026 19:17:58 +0000 [thread overview]
Message-ID: <20260823191759.249C21F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260823185849.2478673-5-denis.benato@linux.dev>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Missing hardware state restoration for vibration intensity on device resume.
- [Medium] Partial failure of the sysfs initialization loop leaves dangling sysfs groups and leaks devres actions.
--
--- Patch [4]: [PATCH v3 04/12] HID: asus: add vibration strength configuration ---
commit bae59c4354c6c0f337acefd797d650cf39840ae7
Author: Denis Benato <denis.benato@linux.dev>
HID: asus: add vibration strength configuration
ASUS ROG Ally handhelds support the vibration strength to be configured:
add sysfs attributes to allow userspace configure motors vibration
intensity.
> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> index 04f41294edf67..dc1a4fb6c9e9e 100644
> --- a/drivers/hid/hid-asus.c
> +++ b/drivers/hid/hid-asus.c
> @@ -206,6 +206,10 @@ struct ally_config {
> u8 left_trigger_max;
> u8 right_trigger_min;
> u8 right_trigger_max;
> +
> + /* Vibration settings */
> + u8 vibration_intensity_left;
> + u8 vibration_intensity_right;
> };
>
[Severity: Medium]
Will this newly added state be lost after a system suspend/resume cycle?
Looking at hid_asus_ally_init(), it restores the gamepad mode and Xbox
controller state after an MCU reset, but doesn't seem to restore these
vibration intensity values:
drivers/hid/hid-asus.c:hid_asus_ally_init() {
...
if (cfg->xbox_controller_enabled) {
ret = ally_set_xbox_controller(hdev, ally, cfg, true);
...
}
Could this lead to a state desynchronization? After resume, the controller
hardware resets its vibration intensity to the default 100%, but the sysfs
files might still report the user's previously set custom value until manually
overwritten.
[ ... ]
> @@ -811,15 +815,193 @@ static ssize_t xbox_controller_store(struct device *dev,
[ ... ]
> static const struct attribute_group ally_attr_groups[] = {
> {
> .attrs = ally_config_attrs,
> },
> + {
> + .name = "left_vibration",
> + .attrs = ally_left_vibration_attrs,
> + },
> + {
> + .name = "right_vibration",
> + .attrs = ally_right_vibration_attrs,
> + },
> };
[Severity: Medium]
Does adding new groups here expose a partial failure cleanup issue during
initialization?
If devm_device_add_group() fails for the second or third element in
ally_attr_groups, ally_config_create() returns an error without rolling
back the successfully added groups:
drivers/hid/hid-asus.c:ally_config_create() {
...
for (sysfs_i = 0; sysfs_i < ARRAY_SIZE(ally_attr_groups); sysfs_i++) {
ret = devm_device_add_group(&hdev->dev, &ally_attr_groups[sysfs_i]);
if (ret < 0) {
hid_err(hdev, "Failed to create sysfs group '%s': %d\n",
ally_attr_groups[sysfs_i].name ?: "", ret);
goto ally_config_create_sysfs_err;
}
...
}
This error propagates up to asus_probe(), which explicitly ignores the
failure and returns 0. Since the overall device probe succeeds, the devres
rollback that would normally remove the successfully added groups is bypassed.
Could this leave dangling sysfs files registered on the device while the
cfg structure is freed via devm_kfree(), since the sysfs actions are never
cleaned up?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260823185849.2478673-1-denis.benato@linux.dev?part=4
next prev parent reply other threads:[~2026-08-23 19:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-23 18:58 [PATCH v3 00/12] HID: asus: add support for ROG Ally handhelds Denis Benato
2026-08-23 18:58 ` [PATCH v3 01/12] HID: asus: reinitialize the device after exiting a sleep state Denis Benato
2026-08-23 18:58 ` [PATCH v3 02/12] HID: asus: add support for ROG Ally handhelds Denis Benato
2026-08-23 19:10 ` sashiko-bot
2026-08-23 18:58 ` [PATCH v3 03/12] HID: asus: add gamepad configuration Denis Benato
2026-08-23 19:15 ` sashiko-bot
2026-08-23 18:58 ` [PATCH v3 04/12] HID: asus: add vibration strength configuration Denis Benato
2026-08-23 19:17 ` sashiko-bot [this message]
2026-08-23 18:58 ` [PATCH v3 05/12] HID: asus: add joysticks inner and outer range configuration Denis Benato
2026-08-23 18:58 ` [PATCH v3 06/12] HID: asus: add triggers " Denis Benato
2026-08-23 18:58 ` [PATCH v3 07/12] HID: asus: add joysticks anti-deadzone configuration Denis Benato
2026-08-23 18:58 ` [PATCH v3 08/12] HID: asus: add support for response curve Denis Benato
2026-08-23 18:58 ` [PATCH v3 09/12] HID: asus: add support to force feedback Denis Benato
2026-08-23 19:14 ` sashiko-bot
2026-08-23 18:58 ` [PATCH v3 10/12] HID: asus: add support for gamepad mode Denis Benato
2026-08-23 18:58 ` [PATCH v3 11/12] HID: asus: add support for turbo buttons Denis Benato
2026-08-23 18:58 ` [PATCH v3 12/12] HID: asus: add support for btn remapping Denis Benato
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=20260823191759.249C21F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=denis.benato@linux.dev \
--cc=dmitry.torokhov@gmail.com \
--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