[PATCH] [RFC] genirq/cpuhotplug, PCI/rcar-host: Silence set affinity failed warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is an RFC patch, I am looking for input on the approach taken here.
If the approach is sound, this patch would be split into proper patchset.

Various PCIe controllers that mux MSIs onto single IRQ line produce these
"IRQ%d: set affinity failed" warnings when entering suspend. This has been
discussed before [1] [2] and an example test case is included at the end
of this commit message.

Attempt to silence the warning by returning specific error code -EOPNOTSUPP
from the irqchip .irq_set_affinity callback, which skips printing the warning
in cpuhotplug.c . The -EOPNOTSUPP was chosen because it indicates exactly what
the problem is, it is not possible to set affinity of each MSI IRQ line to a
specific CPU due to hardware limitation.

```
$ grep 25 /proc/interrupts
 25:   0 0 0 0 0 0 0 0   PCIe MSI   0   Edge   PCIe PME

$ echo core > /sys/power/pm_test ; echo mem > /sys/power/state
...
Disabling non-boot CPUs ...
IRQ25: set affinity failed(-22). <---------- This is being silenced here
psci: CPU7 killed (polled 4 ms)
...
```

[1] https://lore.kernel.org/all/d4a6eea3c5e33a3a4056885419df95a7@xxxxxxxxxx/
[2] https://lore.kernel.org/all/5f4947b18bf381615a37aa81c2242477@xxxxxxxxxx/

Signed-off-by: Marek Vasut <marek.vasut+renesas@xxxxxxxxxxx>
---
Cc: "Krzysztof Wilczyński" <kw@xxxxxxxxx>
Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
Cc: Jisheng Zhang <Jisheng.Zhang@xxxxxxxxxxxxx>
Cc: Jon Hunter <jonathanh@xxxxxxxxxx>
Cc: Lorenzo Pieralisi <lpieralisi@xxxxxxxxxx>
Cc: Marc Zyngier <maz@xxxxxxxxxx>
Cc: Rob Herring <robh@xxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>
Cc: linux-pci@xxxxxxxxxxxxxxx
Cc: linux-renesas-soc@xxxxxxxxxxxxxxx
---
 drivers/pci/controller/pcie-rcar-host.c | 2 +-
 kernel/irq/cpuhotplug.c                 | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/controller/pcie-rcar-host.c b/drivers/pci/controller/pcie-rcar-host.c
index c01efc6ea64f6..2314b2b30df8a 100644
--- a/drivers/pci/controller/pcie-rcar-host.c
+++ b/drivers/pci/controller/pcie-rcar-host.c
@@ -660,7 +660,7 @@ static void rcar_msi_irq_unmask(struct irq_data *d)
 
 static int rcar_msi_set_affinity(struct irq_data *d, const struct cpumask *mask, bool force)
 {
-	return -EINVAL;
+	return -EOPNOTSUPP;
 }
 
 static void rcar_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c
index eb86283901565..822bd6ca40bf9 100644
--- a/kernel/irq/cpuhotplug.c
+++ b/kernel/irq/cpuhotplug.c
@@ -147,8 +147,10 @@ static bool migrate_one_irq(struct irq_desc *desc)
 	}
 
 	if (err) {
-		pr_warn_ratelimited("IRQ%u: set affinity failed(%d).\n",
-				    d->irq, err);
+		if (err != -EOPNOTSUPP) {
+			pr_warn_ratelimited("IRQ%u: set affinity failed(%d).\n",
+					    d->irq, err);
+		}
 		brokeaff = false;
 	}
 
-- 
2.43.0





[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux