Skip to contentSkip to conversation

sparc/pci_msi: Clear the MSI descriptor irq on teardown

PATCH In review Imre Kaloz 3 participants 3 messages Sep 27 – Oct 3

Subsystems (3)
lore
Share & tools
lore

Imre Kaloz

author
#0 lore raw

PATCH 1/1 sparc/pci_msi: Clear the MSI descriptor irq on teardown

Since commit 2f2940d16823 ("genirq/msi: Remove filter from msi_free_descs_free_range()") the MSI core expects msi_desc::irq to be cleared by the architecture teardown before the descriptor is freed. sparc64_teardown_msi_irq() never clears it, so disabling MSI or MSI-X warns in msi_domain_free_descs() and leaks the descriptor.

Clear it once the MSI has been torn down.

Fixes 2f2940d16823 ("genirq/msi: Remove filter from msi_free_descs_free_range()")
---
 arch/sparc/kernel/pci_msi.c | 1 +
 1 file changed, 1 insertion(+)
arch/sparc/kernel/pci_msi.c +1 -0
index acb2f83a1d5c..bb1610497b50 100644
@@ -211,6 +211,7 @@ static void sparc64_teardown_msi_irq(unsigned int irq,
 
 	free_msi(pbm, msi_num);
 
+	irq_get_msi_desc(irq)->irq = 0;
 	irq_set_chip(irq, NULL);
 	irq_free(irq);
 }

base-commit: fe2ec83746e501645709761605c2464a44fd2929

Signature · 1 line
2.47.3
#1 lore raw
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 11 lines

Since commit 2f2940d16823 ("genirq/msi: Remove filter from msi_free_descs_free_range()") the MSI core expects msi_desc::irq to be cleared by the architecture teardown before the descriptor is freed. sparc64_teardown_msi_irq() never clears it, so disabling MSI or MSI-X warns in msi_domain_free_descs() and leaks the descriptor.

Clear it once the MSI has been torn down.

Fixes 2f2940d16823 ("genirq/msi: Remove filter from msi_free_descs_free_range()")

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Tested-by on v1 1/1
#2 lore raw
In reply to Imre Kaloz
Quoted 7 lines · Imre Kaloz

Since commit 2f2940d16823 ("genirq/msi: Remove filter from msi_free_descs_free_range()") the MSI core expects msi_desc::irq to be cleared by the architecture teardown before the descriptor is freed. sparc64_teardown_msi_irq() never clears it, so disabling MSI or MSI-X warns in msi_domain_free_descs() and leaks the descriptor.

Clear it once the MSI has been torn down.

Tested on a SPARC T7-1 (M7) with 7.3-rc5 and ixgbe. Without the patch the first MSI-X teardown warns at kernel/irq/msi.c:214. With it, 30 teardowns through ethtool -L and 3 unbind/bind cycles give no warning, and the device keeps the expected number of MSI-X vectors.