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 Sat, Jul 28, 2018 at 05:26:57PM -0700, Sinan Kaya wrote:
> On 7/28/2018 11:31 AM, Lukas Wunner wrote:
> >The knowledge whether a surprise removal or a safe removal is at hand
> >does exist further up in the call stack:  A surprise removal is
> >initiated by pciehp_handle_presence_or_link_change(), a safe removal by
> >pciehp_handle_disable_request().
> 
> Can you also check if platform supports surprise link down error
> reporting (Link Capabilities Register) and reports a surprise link
> down event in AER Uncorrectable Error Status Register for the
> hotplug code to make it more reliable?

We read the Link Capabilities register in pcie_init() to determine if
Data Link Layer Link Active Reporting is supported.  (That's a feature
added in the PCIe r1.1 Base Spec.  Old devices that strictly adhere to
PCIe r1.0 don't support it.)

We could likewise cache the Surprise Down Error Reporting Capable bit
in struct controller.  But I don't quite understand yet how and when
you want it to be used by pciehp?  If the link goes down, pciehp doesn't
care whether that's caused by a fatal error or removal by the user.
It seems correct to me to also remove devices on a fatal error, after all
they're no longer accessible until the error is cleared (IIUC).
Do you agree or disagree?

Thanks,

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