aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sata_mv.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-05-15 07:57:47 -0400
committerTejun Heo <htejun@gmail.com>2006-05-15 07:57:47 -0400
commit81952c5497b40ae56835bd0d6537f8c6bdea07e7 (patch)
treefa2db695c56e481c271c7249197ad3b4a98b6087 /drivers/scsi/sata_mv.c
parent34bf21704c848fe00c516d1c8f163db08b70b137 (diff)
[PATCH] libata: use new SCR and on/offline functions
Use new SCR and on/offline functions. Note that for LLDD which know it implements SCR callbacks, SCR functions are guaranteed to succeed and ata_port_online() == !ata_port_offline(). Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers/scsi/sata_mv.c')
-rw-r--r--drivers/scsi/sata_mv.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/scsi/sata_mv.c b/drivers/scsi/sata_mv.c
index 181917ac0426..748569b615fc 100644
--- a/drivers/scsi/sata_mv.c
+++ b/drivers/scsi/sata_mv.c
@@ -1309,8 +1309,8 @@ static void mv_err_intr(struct ata_port *ap)
1309 edma_err_cause = readl(port_mmio + EDMA_ERR_IRQ_CAUSE_OFS); 1309 edma_err_cause = readl(port_mmio + EDMA_ERR_IRQ_CAUSE_OFS);
1310 1310
1311 if (EDMA_ERR_SERR & edma_err_cause) { 1311 if (EDMA_ERR_SERR & edma_err_cause) {
1312 serr = scr_read(ap, SCR_ERROR); 1312 sata_scr_read(ap, SCR_ERROR, &serr);
1313 scr_write_flush(ap, SCR_ERROR, serr); 1313 sata_scr_write_flush(ap, SCR_ERROR, serr);
1314 } 1314 }
1315 if (EDMA_ERR_SELF_DIS & edma_err_cause) { 1315 if (EDMA_ERR_SELF_DIS & edma_err_cause) {
1316 struct mv_port_priv *pp = ap->private_data; 1316 struct mv_port_priv *pp = ap->private_data;
@@ -1934,15 +1934,16 @@ static void __mv_phy_reset(struct ata_port *ap, int can_sleep)
1934 1934
1935 /* Issue COMRESET via SControl */ 1935 /* Issue COMRESET via SControl */
1936comreset_retry: 1936comreset_retry:
1937 scr_write_flush(ap, SCR_CONTROL, 0x301); 1937 sata_scr_write_flush(ap, SCR_CONTROL, 0x301);
1938 __msleep(1, can_sleep); 1938 __msleep(1, can_sleep);
1939 1939
1940 scr_write_flush(ap, SCR_CONTROL, 0x300); 1940 sata_scr_write_flush(ap, SCR_CONTROL, 0x300);
1941 __msleep(20, can_sleep); 1941 __msleep(20, can_sleep);
1942 1942
1943 timeout = jiffies + msecs_to_jiffies(200); 1943 timeout = jiffies + msecs_to_jiffies(200);
1944 do { 1944 do {
1945 sstatus = scr_read(ap, SCR_STATUS) & 0x3; 1945 sata_scr_read(ap, SCR_STATUS, &sstatus);
1946 sstatus &= 0x3;
1946 if ((sstatus == 3) || (sstatus == 0)) 1947 if ((sstatus == 3) || (sstatus == 0))
1947 break; 1948 break;
1948 1949
@@ -1959,11 +1960,12 @@ comreset_retry:
1959 "SCtrl 0x%08x\n", mv_scr_read(ap, SCR_STATUS), 1960 "SCtrl 0x%08x\n", mv_scr_read(ap, SCR_STATUS),
1960 mv_scr_read(ap, SCR_ERROR), mv_scr_read(ap, SCR_CONTROL)); 1961 mv_scr_read(ap, SCR_ERROR), mv_scr_read(ap, SCR_CONTROL));
1961 1962
1962 if (sata_dev_present(ap)) { 1963 if (ata_port_online(ap)) {
1963 ata_port_probe(ap); 1964 ata_port_probe(ap);
1964 } else { 1965 } else {
1966 sata_scr_read(ap, SCR_STATUS, &sstatus);
1965 printk(KERN_INFO "ata%u: no device found (phy stat %08x)\n", 1967 printk(KERN_INFO "ata%u: no device found (phy stat %08x)\n",
1966 ap->id, scr_read(ap, SCR_STATUS)); 1968 ap->id, sstatus);
1967 ata_port_disable(ap); 1969 ata_port_disable(ap);
1968 return; 1970 return;
1969 } 1971 }