Skip to content

Commit

Permalink
ahci: Do not receive interrupts sent by dummy ports
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Tested-by: David Milburn <dmilburn@redhat.com>
Cc: linux-ide@vger.kernel.org
Cc: stable@vger.kernel.org
Fixes: 5ca72c4 ("AHCI: Support multiple MSIs")
  • Loading branch information
Alexander Gordeev authored and Tejun Heo committed Apr 18, 2014
1 parent ccf8f53 commit 2cf532f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2cf532f

Please sign in to comment.