From: Stanislaw Gruszka <stf_xl@wp.pl>
To: Runyu Xiao <runyu.xiao@seu.edu.cn>
Cc: "David S . Miller" <davem@davemloft.net>,
"John W . Linville" <linville@tuxdriver.com>,
Zhu Yi <yi.zhu@intel.com>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Jianhao Xu <jianhao.xu@seu.edu.cn>
Subject: Re: [PATCH] wifi: iwlegacy: 3945: protect sysfs TX power update with mutex
Date: Tue, 29 Sep 2026 20:14:58 +0200 [thread overview]
Message-ID: <20260929181458.GA17064@wp.pl> (raw)
In-Reply-To: <20260929123329.2135878-1-runyu.xiao@seu.edu.cn>
On Tue, Sep 29, 2026 at 08:33:29PM +0800, Runyu Xiao wrote:
> The sysfs tx_power store handler calls il3945_hw_reg_set_txpower(), whose
> command path requires il->mutex to be held. The callback bypasses the mutex
> used by the other 3945 control paths, triggering the lockdep assertion and
> allowing concurrent TX power updates to race with other command or state
> transitions. Serialize the update with the same mutex.
>
> Fixes: b481de9ca074 ("[IWLWIFI]: add iwlwifi wireless drivers")
> Cc: stable@vger.kernel.org
> Assisted-by: LLM
> Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
> ---
> drivers/net/wireless/intel/iwlegacy/3945-mac.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
> index cbaf25062..e8cbc2993 100644
> --- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c
> +++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
> @@ -3083,10 +3083,13 @@ il3945_store_tx_power(struct device *d, struct device_attribute *attr,
> u32 val;
>
> val = simple_strtoul(p, &p, 10);
> - if (p == buf)
> + if (p == buf) {
> IL_INFO(": %s is not in decimal form.\n", buf);
> - else
> + } else {
> + mutex_lock(&il->mutex);
> il3945_hw_reg_set_txpower(il, val);
> + mutex_unlock(&il->mutex);
> + }
>
> return count;
> }
> --
> 2.34.1
next prev parent reply other threads:[~2026-09-29 18:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 12:33 [PATCH] wifi: iwlegacy: 3945: protect sysfs TX power update with mutex Runyu Xiao
2026-09-29 18:14 ` Stanislaw Gruszka [this message]
2026-10-05 13:14 ` Johannes Berg
2026-10-05 15:37 ` Stanislaw Gruszka
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=20260929181458.GA17064@wp.pl \
--to=stf_xl@wp.pl \
--cc=davem@davemloft.net \
--cc=jianhao.xu@seu.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=runyu.xiao@seu.edu.cn \
--cc=stable@vger.kernel.org \
--cc=yi.zhu@intel.com \
/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.