linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why do we check for "link-up" in *_pcie_valid_device()?
@ 2017-12-14 22:58 Bjorn Helgaas
  2017-12-15 18:39 ` Jingoo Han
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Bjorn Helgaas @ 2017-12-14 22:58 UTC (permalink / raw)
  To: Jingoo Han, Joao Pinto, Ley Foon Tan, Shawn Lin, Michal Simek
  Cc: Jim Quinlan, Lorenzo Pieralisi, linux-pci, rfi, linux-rockchip

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?

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-01-08 11:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).