[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAo+4rXcHCyuJJxJSWyw9tj_psCXi0BO1Wn462tdnDK9X3kvng@mail.gmail.com>
Date: Fri, 16 Jan 2026 01:57:18 +0800
From: Chengfeng Ye <dg573847474@...il.com>
To: Bart Van Assche <bvanassche@....org>
Cc: "James E . J . Bottomley" <James.Bottomley@...senpartnership.com>,
"Martin K . Petersen" <martin.petersen@...cle.com>, Jack Wang <jinpu.wang@...ud.ionos.com>,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: pm8001: Fix data race in sysfs SAS address read
Hi Bart,
Thanks for looking into this.
> Why isn't READ_ONCE() sufficient?
READ_ONCE() does not suffice because the write path still uses
memcpy(), which is not atomic.
So it is possible that when READ_ONCE() executes and reads all the 8
bytes at once, the SAS
address is still partially updated by the ISR.
> And why explicit spin_lock_irqsave()
> and spin_unlock_irqrestore() calls instead of using scoped_guard()?
Thanks for the notice. I just sent a v2 patch to address it.
Best,
Chengfeng
Powered by blists - more mailing lists