ahci: Do not receive interrupts sent by dummy ports
cover ahci: Do not receive interrupts sent by dummy ports
Tejun, David,
I would expect handle_bad_irq()->print_irq_desc() gets called if dummy port interrupt arrived. Could be a spurious interrupt complain as well.
Alexander Gordeev (1):
ahci: Do not receive interrupts sent by dummy ports
drivers/ata/ahci.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-)
Signature · 1 line
1.7.7.6
PATCH 1/1 ahci: Do not receive interrupts sent by dummy ports
In multiple MSI mode all AHCI ports (including dummy) get assigned separate MSI vectors and (as result of execution pci_enable_msi_exact() function) separate IRQ numbers, (mapped to the MSI vectors).
Therefore, although interrupts from dummy ports are not desired they are still enabled. We do not request IRQs for dummy ports, but that only means we do not assign AHCI-specific ISRs to corresponding IRQ numbers.
As result, dummy port interrupts still could come and traverse all the way from the PCI device to the kernel, causing unnecessary overhead.
This update disables IRQs for dummy ports and prevents the described issue.
--- drivers/ata/ahci.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-)
drivers/ata/ahci.c +10 -6
@@ -1241,12 +1241,16 @@ int ahci_host_activate(struct ata_host *host, int irq, unsigned int n_msis)for (i =0 ; i < host->n_ports; i++) {struct ahci_port_priv *pp = host->ports[i]->private_data; -/* pp is NULL for dummy ports */ -if (pp) - rc =devm_request_threaded_irq (host->dev, - irq + i, ahci_hw_interrupt, - ahci_thread_fn,IRQF_SHARED , - pp->irq_desc, host->ports[i]); +/* Do not receive interrupts sent by dummy ports */ +if (!pp) { +disable_irq (irq + i); +continue ; + } + + rc =devm_request_threaded_irq (host->dev, irq + i, + ahci_hw_interrupt, + ahci_thread_fn,IRQF_SHARED , + pp->irq_desc, host->ports[i]);if (rc) goto out_free_irqs; }
Signature · 1 line
1.7.7.6
Quoted 14 lines · Alexander Gordeev
In multiple MSI mode all AHCI ports (including dummy) get assigned separate MSI vectors and (as result of execution
pci_enable_msi_exact()function) separate IRQ numbers, (mapped to the MSI vectors).Therefore, although interrupts from dummy ports are not desired they are still enabled. We do not request IRQs for dummy ports, but that only means we do not assign AHCI-specific ISRs to corresponding IRQ numbers.
As result, dummy port interrupts still could come and traverse all the way from the PCI device to the kernel, causing unnecessary overhead.
Quoted 7 lines
This update disables IRQs for dummy ports and prevents the described issue.
Signed-off-by Alexander Gordeev <[email protected]>Cc Tejun Heo <[email protected]>Cc David Milburn <[email protected]>
David, can you please test the patch?
Thanks.
Signature · 1 line
tejun
Quoted 18 lines · Tejun Heo
Quoted 17 lines · Alexander Gordeev
In multiple MSI mode all AHCI ports (including dummy) get assigned separate MSI vectors and (as result of execution
pci_enable_msi_exact()function) separate IRQ numbers, (mapped to the MSI vectors).Therefore, although interrupts from dummy ports are not desired they are still enabled. We do not request IRQs for dummy ports, but that only means we do not assign AHCI-specific ISRs to corresponding IRQ numbers.
As result, dummy port interrupts still could come and traverse all the way from the PCI device to the kernel, causing unnecessary overhead.
This update disables IRQs for dummy ports and prevents the described issue.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Alexander Gordeev <[email protected]>Cc Tejun Heo <[email protected]>Cc David Milburn <[email protected]>David, can you please test the patch?
Hi,
I have re-tested successfully, this patch prevents the crash when using kdump, and I boot tested a system that boots off ahci and has dummy ports present, no problems seen.
Thanks,
David
Quoted 14 lines · Alexander Gordeev
In multiple MSI mode all AHCI ports (including dummy) get assigned separate MSI vectors and (as result of execution
pci_enable_msi_exact()function) separate IRQ numbers, (mapped to the MSI vectors).Therefore, although interrupts from dummy ports are not desired they are still enabled. We do not request IRQs for dummy ports, but that only means we do not assign AHCI-specific ISRs to corresponding IRQ numbers.
As result, dummy port interrupts still could come and traverse all the way from the PCI device to the kernel, causing unnecessary overhead.
Quoted 7 lines
This update disables IRQs for dummy ports and prevents the described issue.
Signed-off-by Alexander Gordeev <[email protected]>Cc Tejun Heo <[email protected]>Cc David Milburn <[email protected]>
Applied to libata/for-3.15-fixes w/ David's tested-by added.
Thanks.
Signature · 1 line
tejun