From: "Jingoo Han" <jingoohan1@gmail.com>
To: "'Bjorn Helgaas'" <helgaas@kernel.org>,
"'Joao Pinto'" <Joao.Pinto@synopsys.com>,
"'Ley Foon Tan'" <lftan@altera.com>,
"'Shawn Lin'" <shawn.lin@rock-chips.com>,
"'Michal Simek'" <michal.simek@xilinx.com>
Cc: "'Jim Quinlan'" <jim2101024@gmail.com>,
"'Lorenzo Pieralisi'" <lorenzo.pieralisi@arm.com>,
<linux-pci@vger.kernel.org>, <rfi@lists.rocketboards.org>,
<linux-rockchip@lists.infradead.org>
Subject: Re: Why do we check for "link-up" in *_pcie_valid_device()?
Date: Fri, 15 Dec 2017 13:39:50 -0500 [thread overview]
Message-ID: <000f01d375d4$17e9c830$47bd5890$@gmail.com> (raw)
In-Reply-To: <20171214225821.GN30595@bhelgaas-glaptop.roam.corp.google.com>
On Thursday, December 14, 2017 5:58 PM, Bjorn Helgaas wrote:
>
> Hi all,
>
> In the PCI config access path, the *_pcie_valid_device() functions in
> the dwc, altera, rockchip, and xilinx drivers all check whether the
> link is up.
>
> I think this is racy because the link may go down after we check but
> before we perform the config access.
>
> What would blow up if we removed the *_pcie_link_up() checks?
The original intention is to avoid config access before link up.
Also, I did not find any racy condition as you mentioned.
However, if you think that we need to prevent the racy condition,
someone can send a patch or add comments.
Best regards,
Jingoo Han
>
> I'd like to either remove the checks or add comments about why the
> race is acceptable. If we've covered this before, I apologize.
> Adding a comment will keep me from pestering you about this again in
> the future.
>
> Bjorn
next prev parent reply other threads:[~2017-12-15 18:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-14 22:58 Why do we check for "link-up" in *_pcie_valid_device()? Bjorn Helgaas
2017-12-15 18:39 ` Jingoo Han [this message]
2017-12-15 19:04 ` Bjorn Helgaas
2017-12-15 20:11 ` Bjorn Helgaas
2017-12-22 13:02 ` Bharat Kumar Gogada
2017-12-22 17:28 ` Bjorn Helgaas
2018-01-02 11:37 ` Lorenzo Pieralisi
2018-01-05 14:26 ` Bharat Kumar Gogada
2018-01-05 15:43 ` Lorenzo Pieralisi
2018-01-08 11:03 ` Lucas Stach
2018-01-08 11:24 ` Lorenzo Pieralisi
2018-01-02 12:24 ` Shawn Lin
2018-01-02 12:28 ` Shawn Lin
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='000f01d375d4$17e9c830$47bd5890$@gmail.com' \
--to=jingoohan1@gmail.com \
--cc=Joao.Pinto@synopsys.com \
--cc=helgaas@kernel.org \
--cc=jim2101024@gmail.com \
--cc=lftan@altera.com \
--cc=linux-pci@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=michal.simek@xilinx.com \
--cc=rfi@lists.rocketboards.org \
--cc=shawn.lin@rock-chips.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox