linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Rongguang Wei <clementwei90@163.com>,
	bhelgaas@google.com, linux-pci@vger.kernel.org,
	Rongguang Wei <weirongguang@kylinos.cn>
Subject: Re: [PATCH v4] PCI: pciehp: Fix the slot in BLINKINGON_STATE when Presence Detect Changed event occurred
Date: Sat, 20 May 2023 10:31:18 +0200	[thread overview]
Message-ID: <20230520083118.GA2713@wunner.de> (raw)
In-Reply-To: <ZGfiR7ricXXo3JgO@bhelgaas>

On Fri, May 19, 2023 at 03:55:35PM -0500, Bjorn Helgaas wrote:
> On Wed, May 17, 2023 at 04:02:01PM -0500, Bjorn Helgaas wrote:
> > On Fri, May 12, 2023 at 10:15:18AM +0800, Rongguang Wei wrote:
> > > From: Rongguang Wei <weirongguang@kylinos.cn>
> > > 
> > > pciehp's behavior is incorrect if the Attention Button is pressed
> > > on an unoccupied slot.
> > > 
> > > When a Presence Detect Changed event has occurred, the slot status
> > > in either BLINKINGOFF_STATE or OFF_STATE, turn it off unconditionally.
> 
> Was this supposed to say "BLINKINGOFF_STATE or ON_STATE"
> (not "OFF_STATE")?

Yes I think you're right.


> I propose the following commit log:
[...]
>   pciehp_queue_pushbutton_work() synthesizes a Presence Detect Changed
>   event, and pciehp_handle_presence_or_link_change() exits when it
>   finds the slot empty, leaving the slot in BLINKINGON_STATE with the
>   Power Indicator blinking.
> 
>   To fix the indefinitely blinking Power Indicator, change
>   pciehp_handle_presence_or_link_change() to put the empty slot back
>   in OFF_STATE and turn off the Power Indicator before exiting.

The indefinitely blinking Power Indicator is only one half of the problem.
The other half is that the next button press doesn't result in slot
bringup, even if the slot is occupied and the 5 second timeout has
elapsed.  Suggested wording, feel free to rephrase as you see fit:

  Because the slot was previously left in BLINKINGON_STATE, the next
  button press was interpreted as a "button cancel" event, even if the
  slot was occupied upon that next button press:  pciehp stopped blinking
  and did not perform another slot bringup attempt.

  By putting the slot in OFF_STATE, such user-unfriendly behavior is
  avoided:  Instead, the next button press will result in the slot
  starting to blink again and another bringup attempt after 5 seconds.

Thanks,

Lukas

  reply	other threads:[~2023-05-20  8:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-12  2:15 [PATCH v4] PCI: pciehp: Fix the slot in BLINKINGON_STATE when Presence Detect Changed event occurred Rongguang Wei
2023-05-12  5:20 ` Lukas Wunner
2023-05-17 21:02 ` Bjorn Helgaas
2023-05-18  6:25   ` Lukas Wunner
2023-05-18 11:09     ` Bjorn Helgaas
2023-05-19  1:27       ` Rongguang Wei
2023-05-19  6:22       ` Lukas Wunner
2023-05-19 20:55   ` Bjorn Helgaas
2023-05-20  8:31     ` Lukas Wunner [this message]
2023-05-22 21:10       ` Bjorn Helgaas
2023-05-23  5:03         ` Lukas Wunner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230520083118.GA2713@wunner.de \
    --to=lukas@wunner.de \
    --cc=bhelgaas@google.com \
    --cc=clementwei90@163.com \
    --cc=helgaas@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=weirongguang@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).