All of lore.kernel.org
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Rosen Penev <rosenp@gmail.com>
Cc: linux-ide@vger.kernel.org, Damien Le Moal <dlemoal@kernel.org>,
	Tejun Heo <tj@kernel.org>, Mans Rullgard <mans@mansr.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCHv2] ata: sata_dwc_460ex: fix data race on hsdev->sactive_issued in interrupt handler
Date: Wed, 9 Sep 2026 12:26:52 +0200	[thread overview]
Message-ID: <aqE0bJHPwF9Rer_E@ryzen> (raw)
In-Reply-To: <20260908214212.597139-1-rosenp@gmail.com>

On Tue, Sep 08, 2026 at 02:42:12PM -0700, Rosen Penev wrote:
> hsdev->sactive_issued is written locklessly in sata_dwc_isr() before
> acquiring host->lock, while sata_dwc_qc_complete() performs a
> read-modify-write on the same field under the lock.  This creates a
> data race that can corrupt NCQ tag tracking state.
> 
> Move the zero assignment inside the critical section so all accesses
> to sactive_issued are serialized by host->lock.
> 
> Fixes: 2d20da00c324b ("ata: sata_dwc_460ex: get rid of global data")

Fixes tag seems wrong.

Commit in fixes did:

-       host_pvt.sata_dwc_sactive_issued = 0;
+       hsdev->sactive_issued = 0;

        spin_lock_irqsave(&host->lock, flags);

ie. it simply did a rename, so sactive_issued was assigned to zero before
taking the lock, both before and after the commit in Fixes:.


Kind regards,
Niklas

      reply	other threads:[~2026-09-09 10:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 21:42 [PATCHv2] ata: sata_dwc_460ex: fix data race on hsdev->sactive_issued in interrupt handler Rosen Penev
2026-09-09 10:26 ` Niklas Cassel [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=aqE0bJHPwF9Rer_E@ryzen \
    --to=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mans@mansr.com \
    --cc=rosenp@gmail.com \
    --cc=tj@kernel.org \
    /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.