aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMark Lord <liml@rtr.ca>2009-01-30 18:52:58 -0500
committerJeff Garzik <jgarzik@redhat.com>2009-03-24 22:02:38 -0400
commit66e57a2cb0c538d4f84a7233c224735fe1eaa672 (patch)
tree46ef73b2e5f3bc25d320b9ed7040dc0181d5883d /drivers
parentda14265e776f35067045b8555b5f5f7521e50bc4 (diff)
sata_mv: optimize use of mv_edma_cfg
Try and avoid unnecessary reconfiguration of the EDMA config register on every single non-EDMA I/O operation, by moving the call to mv_edma_cfg() into mv_stop_edma(). It must then also be invoked from mv_hardreset() and from mv_port_start(). Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/sata_mv.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 6f8a49bc4521..8f356e4417d2 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -979,6 +979,7 @@ static int mv_stop_edma(struct ata_port *ap)
979{ 979{
980 void __iomem *port_mmio = mv_ap_base(ap); 980 void __iomem *port_mmio = mv_ap_base(ap);
981 struct mv_port_priv *pp = ap->private_data; 981 struct mv_port_priv *pp = ap->private_data;
982 int err = 0;
982 983
983 if (!(pp->pp_flags & MV_PP_FLAG_EDMA_EN)) 984 if (!(pp->pp_flags & MV_PP_FLAG_EDMA_EN))
984 return 0; 985 return 0;
@@ -986,9 +987,10 @@ static int mv_stop_edma(struct ata_port *ap)
986 mv_wait_for_edma_empty_idle(ap); 987 mv_wait_for_edma_empty_idle(ap);
987 if (mv_stop_edma_engine(port_mmio)) { 988 if (mv_stop_edma_engine(port_mmio)) {
988 ata_port_printk(ap, KERN_ERR, "Unable to stop eDMA\n"); 989 ata_port_printk(ap, KERN_ERR, "Unable to stop eDMA\n");
989 return -EIO; 990 err = -EIO;
990 } 991 }
991 return 0; 992 mv_edma_cfg(ap, 0, 0);
993 return err;
992} 994}
993 995
994#ifdef ATA_DEBUG 996#ifdef ATA_DEBUG
@@ -1337,6 +1339,7 @@ static int mv_port_start(struct ata_port *ap)
1337 pp->sg_tbl_dma[tag] = pp->sg_tbl_dma[0]; 1339 pp->sg_tbl_dma[tag] = pp->sg_tbl_dma[0];
1338 } 1340 }
1339 } 1341 }
1342 mv_edma_cfg(ap, 0, 0);
1340 return 0; 1343 return 0;
1341 1344
1342out_port_free_dma_mem: 1345out_port_free_dma_mem:
@@ -1797,7 +1800,6 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc)
1797 * shadow block, etc registers. 1800 * shadow block, etc registers.
1798 */ 1801 */
1799 mv_stop_edma(ap); 1802 mv_stop_edma(ap);
1800 mv_edma_cfg(ap, 0, 0);
1801 mv_clear_and_enable_port_irqs(ap, mv_ap_base(ap), port_irqs); 1803 mv_clear_and_enable_port_irqs(ap, mv_ap_base(ap), port_irqs);
1802 mv_pmp_select(ap, qc->dev->link->pmp); 1804 mv_pmp_select(ap, qc->dev->link->pmp);
1803 return ata_sff_qc_issue(qc); 1805 return ata_sff_qc_issue(qc);
@@ -2997,6 +2999,7 @@ static int mv_hardreset(struct ata_link *link, unsigned int *class,
2997 extra = HZ; /* only extend it once, max */ 2999 extra = HZ; /* only extend it once, max */
2998 } 3000 }
2999 } while (sstatus != 0x0 && sstatus != 0x113 && sstatus != 0x123); 3001 } while (sstatus != 0x0 && sstatus != 0x113 && sstatus != 0x123);
3002 mv_edma_cfg(ap, 0, 0);
3000 3003
3001 return rc; 3004 return rc;
3002} 3005}