On Mon, 2018-08-20 at 18:13 -0400, Sinan Kaya wrote: > > I proposed this as one of the possible solutions but presence detect is > optional Is it optional on hotplug capable bridges ? I thought it wasn't ... > and also presence detect interrupt can be delivered after We don't care about the interrupt, we just need to look at the value of the change latch. > link layer interrupt as well. No guarantees with respect to the order of > link layer interrupt and presence detect interrupts delivery. > > I instead look at fatal error pending bit in device status register to > decide if the link down was initiated due to a pending fatal error or > somebody actually removed the card. > > If fatal error is pending, wait until it is cleared. If link is healthy, > return gracefully. > > Otherwise, proceed with the hotplug removal. That could work too but it would be safer to also use the change in presence detect if available. Cheers, Ben.