From: Mark Lord <liml@rtr.ca>
To: Jeff Garzik <jgarzik@pobox.com>,
IDE/ATA development list <linux-ide@vger.kernel.org>,
Tejun Heo <htejun@gmail.com>
Subject: [PATCH 04/05] sata_mv: msi masking fix (v2)
Date: Wed, 21 Jan 2009 10:31:29 -0500 [thread overview]
Message-ID: <49773FD1.3040101@rtr.ca> (raw)
In-Reply-To: <49750774.1070005@rtr.ca>
Enable reliable use of Message-Signaled Interrupts (MSI) in sata_mv
by masking further chip interrupts within the main interrupt handler.
Based upon a suggestion by Grant Grundler.
MSI is working reliably in all of my test systems here now.
Signed-off-by: Mark Lord <mlord@pobox.com>
---
This replaces the originally posted [PATCH 05/04] version.
--- old/drivers/ata/sata_mv.c 2009-01-21 10:16:59.000000000 -0500
+++ linux/drivers/ata/sata_mv.c 2009-01-21 10:22:28.000000000 -0500
@@ -33,8 +33,6 @@
*
* --> ATAPI support (Marvell claims the 60xx/70xx chips can do it).
*
- * --> Investigate problems with PCI Message Signalled Interrupts (MSI).
- *
* --> Develop a low-power-consumption strategy, and implement it.
*
* --> [Experiment, low priority] Investigate interrupt coalescing.
@@ -70,7 +68,7 @@
#include <linux/libata.h>
#define DRV_NAME "sata_mv"
-#define DRV_VERSION "1.24"
+#define DRV_VERSION "1.25"
enum {
/* BAR's are enumerated in terms of pci_resource_start() terms */
@@ -2199,9 +2197,15 @@
struct ata_host *host = dev_instance;
struct mv_host_priv *hpriv = host->private_data;
unsigned int handled = 0;
+ int using_msi = hpriv->hp_flags & MV_HP_FLAG_MSI;
u32 main_irq_cause, pending_irqs;
spin_lock(&host->lock);
+
+ /* for MSI: block new interrupts while in here */
+ if (using_msi)
+ writel(0, hpriv->main_irq_mask_addr);
+
main_irq_cause = readl(hpriv->main_irq_cause_addr);
pending_irqs = main_irq_cause & hpriv->main_irq_mask;
/*
@@ -2215,6 +2219,11 @@
handled = mv_host_intr(host, pending_irqs);
}
spin_unlock(&host->lock);
+
+ /* for MSI: unmask; interrupt cause bits will retrigger now */
+ if (using_msi)
+ writel(hpriv->main_irq_mask, hpriv->main_irq_mask_addr);
+
return IRQ_RETVAL(handled);
}
@@ -3414,9 +3423,9 @@
if (rc)
return rc;
- /* Enable interrupts */
- if (msi && pci_enable_msi(pdev))
- pci_intx(pdev, 1);
+ /* Enable message-switched interrupts, if requested */
+ if (msi && 0 == pci_enable_msi(pdev))
+ hpriv->hp_flags |= MV_HP_FLAG_MSI;
mv_dump_pci_cfg(pdev, 0x68);
mv_print_info(host);
next prev parent reply other threads:[~2009-01-21 15:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-19 23:04 [PATCH 01/04] sata_mv: fix 8-port timeouts on 508x/6081 chips Mark Lord
2009-01-19 23:05 ` [PATCH 02/04] sata_mv: don't read hc_irq_cause Mark Lord
2009-01-19 23:06 ` [PATCH 03/04] sata_mv: remove bogus nsect restriction Mark Lord
2009-01-19 23:07 ` [PATCH 04/04] sata_mv: msi masking Mark Lord
2009-01-20 18:19 ` [PATCH 05/04] sata_mv: msi fix and cleanup Mark Lord
2009-01-20 18:49 ` [PATCH 06/06] sata_mv: remove experimental designation Mark Lord
2009-01-21 1:54 ` [PATCH 04/04] sata_mv: msi masking Grant Grundler
2009-01-21 15:15 ` Mark Lord
2009-01-21 15:31 ` Mark Lord [this message]
2009-01-21 15:34 ` [PATCH 05/05] sata_mv: no longer experimental (v2) Mark Lord
2009-01-26 11:43 ` Jeff Garzik
2009-01-21 17:03 ` [PATCH 04/05] sata_mv: msi masking fix (v2) Grant Grundler
2009-01-22 1:02 ` Tejun Heo
2009-01-22 5:17 ` Mark Lord
2009-01-22 5:19 ` Mark Lord
2009-01-22 5:22 ` Tejun Heo
2009-01-23 17:20 ` sata_mv: basic PIO-only ATAPI support? Mark Lord
2009-01-23 17:23 ` Mark Lord
2009-01-23 17:52 ` Alan Cox
2009-01-23 18:37 ` Mark Lord
2009-01-26 11:42 ` [PATCH 04/05] sata_mv: msi masking fix (v2) Jeff Garzik
2009-01-26 11:39 ` [PATCH 01/04] sata_mv: fix 8-port timeouts on 508x/6081 chips Jeff Garzik
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=49773FD1.3040101@rtr.ca \
--to=liml@rtr.ca \
--cc=htejun@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.