aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_mv.c
diff options
context:
space:
mode:
authorMark Lord <liml@rtr.ca>2009-01-19 18:05:42 -0500
committerJeff Garzik <jgarzik@redhat.com>2009-01-26 06:36:53 -0500
commitcae6edc3b5a536119374a5439d9b253cb26f05e1 (patch)
tree14c8706bb6a6a8135b12b66623e005df825b454f /drivers/ata/sata_mv.c
parentb0bccb18bc523d1d5060d25958f12438062829a9 (diff)
sata_mv: don't read hc_irq_cause
Remove silly read-modify-write sequences when clearing interrupts in hc_irq_cause. This gets rid of unneeded MMIO reads, resulting in a slight performance boost when switching between EDMA and non-EDMA modes (eg. for cache flushes). Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/sata_mv.c')
-rw-r--r--drivers/ata/sata_mv.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index ce9d6ad5a64f..68096289074b 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -35,8 +35,6 @@
35 * 35 *
36 * --> Investigate problems with PCI Message Signalled Interrupts (MSI). 36 * --> Investigate problems with PCI Message Signalled Interrupts (MSI).
37 * 37 *
38 * --> Cache frequently-accessed registers in mv_port_priv to reduce overhead.
39 *
40 * --> Develop a low-power-consumption strategy, and implement it. 38 * --> Develop a low-power-consumption strategy, and implement it.
41 * 39 *
42 * --> [Experiment, low priority] Investigate interrupt coalescing. 40 * --> [Experiment, low priority] Investigate interrupt coalescing.
@@ -884,18 +882,14 @@ static void mv_start_dma(struct ata_port *ap, void __iomem *port_mmio,
884 int hardport = mv_hardport_from_port(ap->port_no); 882 int hardport = mv_hardport_from_port(ap->port_no);
885 void __iomem *hc_mmio = mv_hc_base_from_port( 883 void __iomem *hc_mmio = mv_hc_base_from_port(
886 mv_host_base(ap->host), ap->port_no); 884 mv_host_base(ap->host), ap->port_no);
887 u32 hc_irq_cause, ipending; 885 u32 hc_irq_cause;
888 886
889 /* clear EDMA event indicators, if any */ 887 /* clear EDMA event indicators, if any */
890 writelfl(0, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS); 888 writelfl(0, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS);
891 889
892 /* clear EDMA interrupt indicator, if any */ 890 /* clear pending irq events */
893 hc_irq_cause = readl(hc_mmio + HC_IRQ_CAUSE_OFS); 891 hc_irq_cause = ~((DEV_IRQ | DMA_IRQ) << hardport);
894 ipending = (DEV_IRQ | DMA_IRQ) << hardport; 892 writelfl(hc_irq_cause, hc_mmio + HC_IRQ_CAUSE_OFS);
895 if (hc_irq_cause & ipending) {
896 writelfl(hc_irq_cause & ~ipending,
897 hc_mmio + HC_IRQ_CAUSE_OFS);
898 }
899 893
900 mv_edma_cfg(ap, want_ncq); 894 mv_edma_cfg(ap, want_ncq);
901 895
@@ -2821,8 +2815,7 @@ static void mv_eh_thaw(struct ata_port *ap)
2821 writel(0, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS); 2815 writel(0, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS);
2822 2816
2823 /* clear pending irq events */ 2817 /* clear pending irq events */
2824 hc_irq_cause = readl(hc_mmio + HC_IRQ_CAUSE_OFS); 2818 hc_irq_cause = ~((DEV_IRQ | DMA_IRQ) << hardport);
2825 hc_irq_cause &= ~((DEV_IRQ | DMA_IRQ) << hardport);
2826 writelfl(hc_irq_cause, hc_mmio + HC_IRQ_CAUSE_OFS); 2819 writelfl(hc_irq_cause, hc_mmio + HC_IRQ_CAUSE_OFS);
2827 2820
2828 mv_enable_port_irqs(ap, ERR_IRQ); 2821 mv_enable_port_irqs(ap, ERR_IRQ);