LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ata: ata_piix: Fix a possible data race in piix_pci_device_resume
Date: Tue, 8 May 2018 07:20:23 -0700 [thread overview]
Message-ID: <20180508142023.GJ2368884@devbig577.frc2.facebook.com> (raw)
In-Reply-To: <20180508034613.12969-1-baijiaju1990@gmail.com>
Hello,
On Tue, May 08, 2018 at 11:46:13AM +0800, Jia-Ju Bai wrote:
> The write operation to "host->flags" is protected by
> the lock on line 1048, but the read operation to
> this data on line 1046 is not protected by the lock.
> Thus, there may exist a data race for "host->flags".
>
> To fix this data race, the read operation to "host->flags"
> should be also protected by the lock.
This isn't necessarily wrong. It isn't different from atomic bitops -
the modifications are synchronized but what the reads get is
determined by memory ordering or other synchronization. Here, the
whole suspend / resume paths are always synchronized and the spinlocks
are there just in case there are other writers to the field.
Thanks.
--
tejun
prev parent reply other threads:[~2018-05-08 14:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-08 3:46 Jia-Ju Bai
2018-05-08 14:20 ` Tejun Heo [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=20180508142023.GJ2368884@devbig577.frc2.facebook.com \
--to=tj@kernel.org \
--cc=baijiaju1990@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--subject='Re: [PATCH] ata: ata_piix: Fix a possible data race in piix_pci_device_resume' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).