From: Lukas Wunner <lukas@wunner.de>
To: Rongguang Wei <clementwei90@163.com>
Cc: linux-pci@vger.kernel.org, bhelgaas@google.com,
Rongguang Wei <weirongguang@kylinos.cn>
Subject: Re: [PATCH v1] PCI: pciehp: Fix the slot in BLINKINGON_STATE when Presence Detect Changed event occurred
Date: Wed, 19 Apr 2023 09:48:32 +0200 [thread overview]
Message-ID: <20230419074832.GA28243@wunner.de> (raw)
In-Reply-To: <2c288cac-cc3b-09cb-efbb-2e07f3b16fe6@163.com>
On Wed, Apr 19, 2023 at 10:58:33AM +0800, Rongguang Wei wrote:
> I test the 1-line change and it make the test failed. The dmesg like this:
>
> pcieport 0000:00:01.5: pciehp: Slot(0-5): Attention button pressed
> pcieport 0000:00:01.5: pciehp: Slot(0-5): Powering off due to button press
> pcieport 0000:00:01.5: pciehp: Slot(0-5): Attention button pressed
> pcieport 0000:00:01.5: pciehp: Slot(0-5): Ignoring invalid state 0x4
[...]
> diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
> index 529c34808440..462a61fc7313 100644
> --- a/drivers/pci/hotplug/pciehp_ctrl.c
> +++ b/drivers/pci/hotplug/pciehp_ctrl.c
> @@ -256,7 +256,9 @@ void pciehp_handle_presence_or_link_change(struct controller *ctrl, u32 events)
> present = pciehp_card_present(ctrl);
> link_active = pciehp_check_link_active(ctrl);
> if (present <= 0 && link_active <= 0) {
> + ctrl->state = POWEROFF_STATE;
> mutex_unlock(&ctrl->state_lock);
My apologies, I made a mistake. I meant OFF_STATE, not POWEROFF_STATE.
Could you try that, without the addition below:
> + pciehp_disable_slot(ctrl, SURPRISE_REMOVAL);
> return;
> }
Sorry again and thanks,
Lukas
next prev parent reply other threads:[~2023-04-19 7:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-03 5:46 [PATCH v1] PCI: pciehp: Fix the slot in BLINKINGON_STATE when Presence Detect Changed event occurred Rongguang Wei
2023-04-10 5:00 ` Rongguang Wei
2023-04-11 18:30 ` Bjorn Helgaas
2023-04-16 15:18 ` Lukas Wunner
2023-04-17 3:04 ` Rongguang Wei
2023-04-17 7:11 ` Lukas Wunner
2023-04-19 2:58 ` Rongguang Wei
2023-04-19 7:48 ` Lukas Wunner [this message]
2023-04-20 9:46 ` Rongguang Wei
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=20230419074832.GA28243@wunner.de \
--to=lukas@wunner.de \
--cc=bhelgaas@google.com \
--cc=clementwei90@163.com \
--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).