public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Rongguang Wei <clementwei90@163.com>,
	Rongguang Wei <weirongguang@kylinos.cn>,
	linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [PATCH] PCI: pciehp: Simplify Attention Button logging
Date: Wed, 24 May 2023 12:08:23 +0200	[thread overview]
Message-ID: <20230524100823.GA23020@wunner.de> (raw)
In-Reply-To: <ZGzedx3zZ0exN6C9@bhelgaas>

On Tue, May 23, 2023 at 10:40:39AM -0500, Bjorn Helgaas wrote:
> I was trying to make it OFF/ON case parallel to the BLINKING case that
> only has one ctrl_info(), but I think that makes it a little harder to
> read in addition to being less efficient.
> 
> And the language is definitely confusing.   How about this?

Perfect, feel free to add my

Reviewed-by: Lukas Wunner <lukas@wunner.de>

to commit 6d433b9ddfda on pci/hotplug.

Thanks a lot!

Lukas

> @@ -166,11 +166,11 @@ void pciehp_handle_button_press(struct controller *ctrl)
>  	case ON_STATE:
>  		if (ctrl->state == ON_STATE) {
>  			ctrl->state = BLINKINGOFF_STATE;
> -			ctrl_info(ctrl, "Slot(%s): Powering off due to button press\n",
> +			ctrl_info(ctrl, "Slot(%s): Button press: will power off in 5 sec\n",
>  				  slot_name(ctrl));
>  		} else {
>  			ctrl->state = BLINKINGON_STATE;
> -			ctrl_info(ctrl, "Slot(%s) Powering on due to button press\n",
> +			ctrl_info(ctrl, "Slot(%s): Button press: will power on in 5 sec\n",
>  				  slot_name(ctrl));
>  		}
>  		/* blink power indicator and turn off attention */
> @@ -185,22 +185,23 @@ void pciehp_handle_button_press(struct controller *ctrl)
>  		 * press the attention again before the 5 sec. limit
>  		 * expires to cancel hot-add or hot-remove
>  		 */
> -		ctrl_info(ctrl, "Slot(%s): Button cancel\n", slot_name(ctrl));
>  		cancel_delayed_work(&ctrl->button_work);
>  		if (ctrl->state == BLINKINGOFF_STATE) {
>  			ctrl->state = ON_STATE;
>  			pciehp_set_indicators(ctrl, PCI_EXP_SLTCTL_PWR_IND_ON,
>  					      PCI_EXP_SLTCTL_ATTN_IND_OFF);
> +			ctrl_info(ctrl, "Slot(%s): Button press: canceling request to power off\n",
> +				  slot_name(ctrl));
>  		} else {
>  			ctrl->state = OFF_STATE;
>  			pciehp_set_indicators(ctrl, PCI_EXP_SLTCTL_PWR_IND_OFF,
>  					      PCI_EXP_SLTCTL_ATTN_IND_OFF);
> +			ctrl_info(ctrl, "Slot(%s): Button press: canceling request to power on\n",
> +				  slot_name(ctrl));
>  		}
> -		ctrl_info(ctrl, "Slot(%s): Action canceled due to button press\n",
> -			  slot_name(ctrl));
>  		break;

  reply	other threads:[~2023-05-24 10:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-22 21:40 [PATCH] PCI: pciehp: Simplify Attention Button logging Bjorn Helgaas
2023-05-22 21:53 ` Bjorn Helgaas
2023-05-23  5:29 ` Lukas Wunner
2023-05-23 15:40   ` Bjorn Helgaas
2023-05-24 10:08     ` Lukas Wunner [this message]
2023-05-24 16:54       ` Bjorn Helgaas

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=20230524100823.GA23020@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