Skip to content

Commit 5054133

Browse files
committed
PCI: pciehp: Simplify Attention Button logging
Previously, pressing the Attention Button always logged two lines, the first from pciehp_ist() and the second from pciehp_handle_button_press(): Attention button pressed Powering on due to button press Since pciehp_handle_button_press() always logs the more detailed message, remove the generic "Attention button pressed" message. Reword the pciehp_handle_button_press() to be of the form: Button press: will power on in 5 sec Button press: will power off in 5 sec Button press: canceling request to power on Button press: canceling request to power off Button press: ignoring invalid state %#x Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Lukas Wunner <[email protected]>
1 parent ac9a786 commit 5054133

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

drivers/pci/hotplug/pciehp_ctrl.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ void pciehp_handle_button_press(struct controller *ctrl)
166166
case ON_STATE:
167167
if (ctrl->state == ON_STATE) {
168168
ctrl->state = BLINKINGOFF_STATE;
169-
ctrl_info(ctrl, "Slot(%s): Powering off due to button press\n",
169+
ctrl_info(ctrl, "Slot(%s): Button press: will power off in 5 sec\n",
170170
slot_name(ctrl));
171171
} else {
172172
ctrl->state = BLINKINGON_STATE;
173-
ctrl_info(ctrl, "Slot(%s) Powering on due to button press\n",
173+
ctrl_info(ctrl, "Slot(%s): Button press: will power on in 5 sec\n",
174174
slot_name(ctrl));
175175
}
176176
/* blink power indicator and turn off attention */
@@ -185,22 +185,23 @@ void pciehp_handle_button_press(struct controller *ctrl)
185185
* press the attention again before the 5 sec. limit
186186
* expires to cancel hot-add or hot-remove
187187
*/
188-
ctrl_info(ctrl, "Slot(%s): Button cancel\n", slot_name(ctrl));
189188
cancel_delayed_work(&ctrl->button_work);
190189
if (ctrl->state == BLINKINGOFF_STATE) {
191190
ctrl->state = ON_STATE;
192191
pciehp_set_indicators(ctrl, PCI_EXP_SLTCTL_PWR_IND_ON,
193192
PCI_EXP_SLTCTL_ATTN_IND_OFF);
193+
ctrl_info(ctrl, "Slot(%s): Button press: canceling request to power off\n",
194+
slot_name(ctrl));
194195
} else {
195196
ctrl->state = OFF_STATE;
196197
pciehp_set_indicators(ctrl, PCI_EXP_SLTCTL_PWR_IND_OFF,
197198
PCI_EXP_SLTCTL_ATTN_IND_OFF);
199+
ctrl_info(ctrl, "Slot(%s): Button press: canceling request to power on\n",
200+
slot_name(ctrl));
198201
}
199-
ctrl_info(ctrl, "Slot(%s): Action canceled due to button press\n",
200-
slot_name(ctrl));
201202
break;
202203
default:
203-
ctrl_err(ctrl, "Slot(%s): Ignoring invalid state %#x\n",
204+
ctrl_err(ctrl, "Slot(%s): Button press: ignoring invalid state %#x\n",
204205
slot_name(ctrl), ctrl->state);
205206
break;
206207
}

drivers/pci/hotplug/pciehp_hpc.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -722,11 +722,8 @@ static irqreturn_t pciehp_ist(int irq, void *dev_id)
722722
}
723723

724724
/* Check Attention Button Pressed */
725-
if (events & PCI_EXP_SLTSTA_ABP) {
726-
ctrl_info(ctrl, "Slot(%s): Attention button pressed\n",
727-
slot_name(ctrl));
725+
if (events & PCI_EXP_SLTSTA_ABP)
728726
pciehp_handle_button_press(ctrl);
729-
}
730727

731728
/* Check Power Fault Detected */
732729
if (events & PCI_EXP_SLTSTA_PFD) {

0 commit comments

Comments
 (0)