Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH v2 1/1] PCI/hotplug: Don't enable HPIE in poll mode
@ 2025-03-21 16:21 Ilpo Järvinen
  2025-03-21 17:09 ` Bjorn Helgaas
  0 siblings, 1 reply; 6+ messages in thread
From: Ilpo Järvinen @ 2025-03-21 16:21 UTC (permalink / raw)
  To: Bjorn Helgaas, Rafael J. Wysocki, Mika Westerberg, linux-pci,
	linux-kernel
  Cc: Ilpo Järvinen, Lukas Wunner

PCIe hotplug can operate in poll mode without interrupt handlers using
a polling kthread only. The commit eb34da60edee ("PCI: pciehp: Disable
hotplug interrupt during suspend") failed to consider that and enables
HPIE (Hot-Plug Interrupt Enable) unconditionally when resuming the
Port.

Only set HPIE if non-poll mode is in use. This makes
pcie_enable_interrupt() match how pcie_enable_notification() already
handles HPIE.

Fixes: eb34da60edee ("PCI: pciehp: Disable hotplug interrupt during suspend")
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
---

v2:
- Dropped other hotplug fixes/changes (Lukas' approach/fix is better)
- Fixed typo in shortlog

 drivers/pci/hotplug/pciehp_hpc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index bb5a8d9f03ad..28ab393af1c0 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -842,7 +842,9 @@ void pcie_enable_interrupt(struct controller *ctrl)
 {
 	u16 mask;
 
-	mask = PCI_EXP_SLTCTL_HPIE | PCI_EXP_SLTCTL_DLLSCE;
+	mask = PCI_EXP_SLTCTL_DLLSCE;
+	if (!pciehp_poll_mode)
+		mask |= PCI_EXP_SLTCTL_HPIE;
 	pcie_write_cmd(ctrl, mask, mask);
 }
 

base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-03-24 16:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-21 16:21 [PATCH v2 1/1] PCI/hotplug: Don't enable HPIE in poll mode Ilpo Järvinen
2025-03-21 17:09 ` Bjorn Helgaas
2025-03-21 18:07   ` Lukas Wunner
2025-03-21 20:51     ` Bjorn Helgaas
2025-03-24 11:00       ` Ilpo Järvinen
2025-03-24 16:41         ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox