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 07/26/2018 06:01 PM, Rajat Jain wrote:
> On Thu, Jul 26, 2018 at 3:38 PM Alex G. <mr.nuke.me@xxxxxxxxx> wrote:
>>
>> Hi,
>>
>> I was under the impression that a DLLSC or PDSC would trigger the
>> PCI_DEV_DISCONNECTED bit to be set, blocking any further config access.
> 
> This sounds like an good idea to me. Caveat below.


>>
>> Although I'm not seeing that happen after a  "Slot(xxx): Link Down"
>> event.
> 
> It should eventually happen when the pciehp takes a note and finally
> processes the event in pciehp_unconfigure_device(). I suspect that the
> reason this was put towards the end of the event processing was to be
> absolutely be sure that the device removal won't be cancelled (Since
> the bit is not being cleared anywhere, if somehow the device removal
> is not processed, it may result in ghost devices that are permanently
> "unreadable").

I think that's something that could be fixed by clearing the 
DISCONNECTED bit on a link up.
What I'm confused about here is, I've put a dump_stack() in 
pci_dev_set_disconnected(), and I'm not hitting it. I see the "Link 
Down" message, from which I would expect the subordinate to get 
disconnected eventually. I would expect this to get hit when removing a 
device:

[ 1256.290283] pciehp 0000:b0:05.0:pcie204: Slot(179): Link Down
[ 1256.300043] pciehp 0000:b0:05.0:pcie204: Slot(179): Card not present
[no other messages related to b0:05.0 or its children]


Alex

> Thanks,
> 
> Rajat
> 
>> I suspect my understanding is then wrong. Or maybe
>> PCI_DEV_DISCONNECTED means something else.
>>
>> In the latter case, does it not make sense to have a separate bit to say
>> "Don't touch this device"?
>>
>> Alex
> 





[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