Linux wireless drivers development
 help / color / mirror / Atom feed
From: "Rosen Penev" <rosenp@gmail.com>
To: "Toke Høiland-Jørgensen" <toke@toke.dk>,
	"Rosen Penev" <rosenp@gmail.com>,
	linux-wireless@vger.kernel.org
Cc: "open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH ath-next] wifi: ath9k: drop static from local pdadc and vpdTable arrays
Date: Thu, 18 Jun 2026 12:18:27 -0700	[thread overview]
Message-ID: <DJCF1EZ3FVPH.2HTGKC5T5ZCYW@gmail.com> (raw)
In-Reply-To: <87se6kfa9b.fsf@toke.dk>

On Thu Jun 18, 2026 at 2:50 AM PDT, Toke Høiland-Jørgensen wrote:
> Rosen Penev <rosenp@gmail.com> writes:
>
>> Remove the static qualifier from mutable local arrays in three EEPROM
>> power-calibration functions.  These arrays are written to during normal
>> operation, so static storage is both unnecessary and misleading: it
>> implies sharing across calls when no such sharing is intended, and it
>> makes the code subtly non-reentrant.  The sibling function in
>> eeprom_9287.c already uses an automatic (stack-local) pdadcValues,
>> confirming this is the correct pattern.
>>
>> This keeps ~1 KB of data off the static data section at the cost of
>> stack usage, consistent with the rest of the driver's coding style.
>
> As pointed out by the test robot, putting this much data on the stack is
> a bad idea. Pretty sure it's static for exactly this reason in the first
> place.
Sashiko points out the opposite:

This is a pre-existing issue, but by declaring vpdTableL and vpdTableR as
static local variables, doesn't this create thread-unsafe global state?
If a system contains multiple ath9k wireless adapters, or if operations
like background scans trigger ath9k_hw_reset() concurrently, threads could
race to read and write these shared arrays. Could this potentially corrupt
the EEPROM calibration data and PDADC hardware configurations across devices?
>
> -Toke


      reply	other threads:[~2026-06-18 19:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-16  3:08 [PATCH ath-next] wifi: ath9k: drop static from local pdadc and vpdTable arrays Rosen Penev
2026-06-17  6:00 ` kernel test robot
2026-06-18  9:50 ` Toke Høiland-Jørgensen
2026-06-18 19:18   ` Rosen Penev [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=DJCF1EZ3FVPH.2HTGKC5T5ZCYW@gmail.com \
    --to=rosenp@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=toke@toke.dk \
    /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