Re: [Patch v2 1/1] PCI: pciehp: Add support for handling MRL events

From: Lukas Wunner
Date: Thu Dec 10 2020 - 15:59:00 EST


On Thu, Dec 03, 2020 at 02:51:24PM -0800, Raj, Ashok wrote:
> - Press ATTN,
> - Slot is empty
> - After 5 seconds synthetic PDC arrives.
> but since no presence and no link active, we leave slot in
> BLINKINGON_STATE, and led keeps blinking
>
> if someone were to add a card after the 5 seconds, no hot-add is processed
> since we don't get notifications for PDC events when ATTN exists.
>
> Can we automatically cancel the blinking and return slot back to OFF_STATE?

Yes.


> If the operation initiated by the attention button fails for any reason, it
> is recommended that system software present an error message explaining
> failure via a software user interface, or add the error message to system
> log.

Ah so we're supposed to log a message if the slot is empty.
That needs to be added then to the code snippet I sent you
yesterday in response to your off-list e-mail.


> Alternately we can also choose to subscribe to PDC, but ignore if slot is
> in OFF_STATE. So we let ATTN drive the add. But if PDC happens and we are
> in BLINKINGON_STATE, then we can process the hot-add? Spec says a software
> recommendation, but i think the cancel after 5 seconds seems better?

That approach seems more complicated. It's better to stop blinking
and return to OFF_STATE if after the 5 second interval the slot is
found to be empty.

Thanks,

Lukas