Re: PCI: hotplug: Erroneous removal of hotplug PCI devices

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

 



On Wed, Jan 23, 2019 at 11:50:30PM +0000, Alex_Gagniuc@xxxxxxxxxxxx wrote:
> nvme issue aside, the device is removed. Then, a few seconds later, we 
> see Link Up and Card Present events, but no pciehp_isr() invocation. I 
> think it all happens in one pciehp_handle_presence_or_link_change(), so 
> pciehp_ist() is held up for a few seconds -- but that's a matter for a 
> different thread.

Yes, that's normal and expected.  The rationale is that we only know that
link or presence has changed.  It could even have changed multiple times.
Even if the link is now back up, we don't know if it's still the same card.
So the slot is brought down and if it's currently occupied or the link is
up, the slot is brought up again.

It would of course be possible to come up with more complicated schemes to
try to handle odd behavior such as a belated presence change after a link
change, but then it also becomes more complicated to reason about the
scheme's correctness and ensure that other types of odd behavior (such as
presence hardwired to zero) are still handled correctly.

Thanks,

Lukas

> [  785.007640] nvme 0000:b1:00.0: enabling device (0000 -> 0002)
> [  785.099567] pcieport 0000:b0:04.0: ZOPA: Status(0x00000040): 
> presence-detected
> [  785.099574] pcieport 0000:b0:04.0: ZOPA: Events(0x00000008): 
> presence-detect-changed
> [  785.099580] pcieport 0000:b0:04.0: ZOPA: Queued up(0x00000008): 
> presence-detect-changed
> [  785.099582] pcieport 0000:b0:04.0: ZOPA: pciehp_isr: exiting
> [  785.099611] pcieport 0000:b0:04.0: ZOPA: pciehp_ist: Entered with 
> events(0x00000008): presence-detect-changed
> [  785.099615] pciehp 0000:b0:04.0:pcie204: ZOPA: 
> pciehp_handle_presence_or_link_change: locked &ctrl->state_lock
> [  785.099618] pciehp 0000:b0:04.0:pcie204: ZOPA: 
> pciehp_handle_presence_or_link_change unlocked (POWEROFF)
> [  785.099621] pciehp 0000:b0:04.0:pcie204: Slot(178): Card not present
> [  788.756953] nvme nvme4: failed to mark controller CONNECTING
> [  788.756958] nvme nvme4: Removing after probe failure status: 0
> [  788.763317] pciehp 0000:b0:04.0:pcie204: ZOPA: 
> pciehp_handle_presence_or_link_change unlocked (POWERON)
> [  788.763322] pciehp 0000:b0:04.0:pcie204: Slot(178): Card present
> [  788.763349] pciehp 0000:b0:04.0:pcie204: Slot(178): Link Up
> [  788.892432] pci 0000:b1:00.0: [8086:0a55] type 00 class 0x010802
> [  788.892474] pci 0000:b1:00.0: reg 0x10: [mem 0xe1500000-0xe1503fff 64bit]
> 



[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