Hi On 5/18/23 7:09 PM, Bjorn Helgaas wrote: > On Thu, May 18, 2023 at 08:25:57AM +0200, Lukas Wunner wrote: >> On Wed, May 17, 2023 at 04:02:01PM -0500, Bjorn Helgaas wrote: >>> I'm curious why we want the 5 seconds of blinking power indicator at >>> all. We can't really do anything in response to an Attention Button >>> on an empty slot, so could we just ignore it completely in >>> pciehp_handle_button_press()? >> >> That wouldn't cover the case where the slot is occupied when the >> button is pressed, but the card is yanked out during the 5 second >> blinking interval. > > Obviously we can't ignore a button press when the slot is occupied, > because that's part of the "insert card, press button to power it up" > and "press button to power down card, remove card" flows. > > I'm asking about ignoring it when the slot is empty, which would mean > adding a check for card presence in pciehp_handle_button_press(). But > maybe there's a reason why we can't do that there? > > Bjorn > I think we can't add a check in pciehp_handle_button_press() because this function is handle the ABP event and the slot is occupied or empty is PDC event. Those two events are better not control in one function. Thanks.