All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Rongguang Wei <clementwei90@163.com>
Cc: 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: Fri, 12 May 2023 07:20:12 +0200	[thread overview]
Message-ID: <20230512052012.GA7481@wunner.de> (raw)
In-Reply-To: <20230512021518.336460-1-clementwei90@163.com>

On Fri, May 12, 2023 at 10:15:18AM +0800, Rongguang Wei wrote:
> pciehp's behavior is incorrect if the Attention Button is pressed
> on an unoccupied slot.
[...]
> V2: Update to simple code and avoid gratuitous message.
> V3: Add Suggested-by.
> V4: Add state change conditional and message.
> 
> Fixes: d331710ea78f ("PCI: pciehp: Become resilient to missed events")
> Link: https://lore.kernel.org/linux-pci/20230403054619.19163-1-clementwei90@163.com/
> Link: https://lore.kernel.org/linux-pci/20230421025641.655991-1-clementwei90@163.com/

The changes from previous versions of the patch as well as the links to
those previous versions are usually placed below the three dashes.
That way they don't become part of the git history as they're generally
not interesting for future readers.  (The exception of that rule is the
gpu subsystem which habitually puts the changelog in the commit message.)

However I don't think you need to respin the patch because of that as
Bjorn can fix up the commit message when applying.  Just so you know
for future submissions.

> Suggested-by: Lukas Wunner <lukas@wunner.de>
> Signed-off-by: Rongguang Wei <weirongguang@kylinos.cn>

Reviewed-by: Lukas Wunner <lukas@wunner.de>
Cc: stable@vger.kernel.org # v4.19+

Thanks!

Lukas

> ---
>  drivers/pci/hotplug/pciehp_ctrl.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
> index 529c34808440..32baba1b7f13 100644
> --- a/drivers/pci/hotplug/pciehp_ctrl.c
> +++ b/drivers/pci/hotplug/pciehp_ctrl.c
> @@ -256,6 +256,14 @@ 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) {
> +		if (ctrl->state == BLINKINGON_STATE) {
> +			ctrl->state = OFF_STATE;
> +			cancel_delayed_work(&ctrl->button_work);
> +			pciehp_set_indicators(ctrl, PCI_EXP_SLTCTL_PWR_IND_OFF,
> +					      INDICATOR_NOOP);
> +			ctrl_info(ctrl, "Slot(%s): Card not present\n",
> +				  slot_name(ctrl));
> +		}
>  		mutex_unlock(&ctrl->state_lock);
>  		return;
>  	}
> -- 
> 2.25.1

  reply	other threads:[~2023-05-12  5:20 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 [this message]
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
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=20230512052012.GA7481@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.