Re: Should a PCIe Link Down event set the PCI_DEV_DISCONNECTED bit?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 30, 2018 at 09:38:04PM +0000, Alex_Gagniuc@xxxxxxxxxxxx wrote:
> On 07/28/2018 01:31 PM, Lukas Wunner wrote:
> > On Fri, Jul 27, 2018 at 05:51:04PM +0000, Alex_Gagniuc@xxxxxxxxxxxx wrote:
> > > I think PCI_DEV_DISCONNECTED is a documentation issue above all else.
> > > The history I was given is that drivers would take a very long time to
> > > tear down a device. Config space IO to an nonexistent device took a long
> > > while to time out. Performance was one motivation -- and was not
> > > documented.
> > 
> > Often it is possible for the driver to detect surprise removal by
> > checking if mmio reads return "all ones".  But in some cases that's
> > a valid value to read from mmio and then this approach won't work.
> > Also, checking every mmio read may negatively impact performance.
> 
> A colleague and me beat that dead horse to the afterdeath. Consensus was 
> that the return value is less reliable than a coin toss (of a two-heads 
> coin).

Can you elaborate why?  Because the "official" stance is that checking
every read where "all ones" is an invalid value is the proper way to
detect unplugged devices.  (Official as in, voiced by Greg KH and Bjorn.)
In that sense, PCI_DEV_DISCONNECTED is sort of an unloved child.

See this thread:
https://www.spinics.net/lists/linux-acpi/msg81445.html


> > FWIW, the below is what I had in mind (on top of Bjorn's pci/hotplug
> > branch).  Does this work for you?
> 
> This, and another patch (you have been CC'd) solve my problem of 
> crashing during surprise removal. Thanks!

Ok thanks, I submitted the patch this morning with your Tested-by.
Unfortunately I forgot to cc all your Dell colleagues, sorry.

Lukas



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux