linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Gordeev <agordeev@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Alexander Gordeev <agordeev@redhat.com>,
	Tejun Heo <tj@kernel.org>, David Milburn <dmilburn@redhat.com>,
	linux-ide@vger.kernel.org
Subject: [PATCH 1/1] ahci: Do not receive interrupts sent by dummy ports
Date: Thu, 17 Apr 2014 18:06:15 +0200	[thread overview]
Message-ID: <dbaed51ffe73dec1966eba256c3b42ed22ed58f3.1397750166.git.agordeev@redhat.com> (raw)
In-Reply-To: <cover.1397750166.git.agordeev@redhat.com>

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>
Cc: Tejun Heo <tj@kernel.org>
Cc: David Milburn <dmilburn@redhat.com>
Cc: linux-ide@vger.kernel.org
---
 drivers/ata/ahci.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 44d40c7..71e15b7 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -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;
 	}
-- 
1.7.7.6


  reply	other threads:[~2014-04-17 17:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-17 16:06 [PATCH 0/1] ahci: Do not receive interrupts sent by dummy ports Alexander Gordeev
2014-04-17 16:06 ` Alexander Gordeev [this message]
2014-04-17 17:06   ` [PATCH 1/1] " Tejun Heo
2014-04-17 17:50     ` David Milburn
2014-04-18 19:56   ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dbaed51ffe73dec1966eba256c3b42ed22ed58f3.1397750166.git.agordeev@redhat.com \
    --to=agordeev@redhat.com \
    --cc=dmilburn@redhat.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).