From: sashiko-bot@kernel.org
To: "A. Sverdlin" <alexander.sverdlin@siemens.com>
Cc: linux-leds@vger.kernel.org, lee@kernel.org
Subject: Re: [PATCH v2 4/4] leds: trigger: netdev: Serialize mode/interval stores with trigger lock
Date: Mon, 21 Sep 2026 10:13:17 +0000 [thread overview]
Message-ID: <20260921101317.9E4F61F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260921093249.3481413-5-alexander.sverdlin@siemens.com>
> From: Alexander Sverdlin <alexander.sverdlin@siemens.com>
>
> netdev_led_attr_store() and interval_store() update ->mode and run
> set_baseline_state() without trigger_data->lock. kernfs only serializes
> writes to the same file, so two attribute writes race on the non-atomic
> read-modify-write of ->mode:
>
> CPU0 (echo 1 > link_10) CPU1 (echo 1 > link_100)
> ----------------------- ------------------------
> mode = trigger_data->mode;
> mode = trigger_data->mode;
> set_bit(LINK_10, &mode);
> set_bit(LINK_100, &mode);
> trigger_data->mode = mode;
> trigger_data->mode = mode; // LINK_10 lost
>
> They also race the notifier's link-state and ->hw_control updates.
>
> Take trigger_data->lock in both stores. netdev_trig_work() also holds it,
> so use the async cancel_delayed_work() (a sync cancel would deadlock).
>
> Cc: stable@vger.kernel.org
> Fixes: d5e01266e7f5 ("leds: trigger: netdev: add additional specific link speed mode")
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260921093249.3481413-1-alexander.sverdlin@siemens.com?part=4
prev parent reply other threads:[~2026-09-21 10:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 9:32 [PATCH v2 0/4] leds: trigger: netdev: fix sysfs_update_group() races A. Sverdlin
2026-09-21 9:32 ` [PATCH v2 1/4] leds: trigger: netdev: Put netdev on activate error path A. Sverdlin
2026-09-21 9:52 ` sashiko-bot
2026-09-27 15:02 ` Andrew Lunn
2026-09-28 8:27 ` Sverdlin, Alexander
2026-09-21 9:32 ` [PATCH v2 2/4] leds: trigger: netdev: Access net_dev under trigger_data->lock in the worker A. Sverdlin
2026-09-21 9:59 ` sashiko-bot
2026-09-27 15:05 ` Andrew Lunn
2026-09-28 8:27 ` Sverdlin, Alexander
2026-09-21 9:32 ` [PATCH v2 3/4] leds: trigger: netdev: Fix sysfs_update_group() races A. Sverdlin
2026-09-21 10:08 ` sashiko-bot
2026-09-28 9:10 ` Sverdlin, Alexander
2026-09-21 9:32 ` [PATCH v2 4/4] leds: trigger: netdev: Serialize mode/interval stores with trigger lock A. Sverdlin
2026-09-21 10:13 ` 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=20260921101317.9E4F61F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=alexander.sverdlin@siemens.com \
--cc=lee@kernel.org \
--cc=linux-leds@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.