Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21815
b: refs/heads/master
c: 7a7921e
h: refs/heads/master
i:
  21813: 5eb5b39
  21811: cb859db
  21807: f093618
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Feb 9, 2006
1 parent e194ea3 commit 3279759
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b911fc3ae0121ff0b72a52e58823c3f8ac3094d0
refs/heads/master: 7a7921e8661a6b9fb99400983ee67df7e125853b
32 changes: 21 additions & 11 deletions trunk/drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2277,6 +2277,24 @@ void ata_bus_reset(struct ata_port *ap)
DPRINTK("EXIT\n");
}

static int sata_phy_resume(struct ata_port *ap)
{
unsigned long timeout = jiffies + (HZ * 5);
u32 sstatus;

scr_write_flush(ap, SCR_CONTROL, 0x300);

/* Wait for phy to become ready, if necessary. */
do {
msleep(200);
sstatus = scr_read(ap, SCR_STATUS);
if ((sstatus & 0xf) != 1)
return 0;
} while (time_before(jiffies, timeout));

return -1;
}

/**
* ata_std_softreset - reset host port via ATA SRST
* @ap: port to reset
Expand Down Expand Up @@ -2357,8 +2375,7 @@ int ata_std_softreset(struct ata_port *ap, int verbose, unsigned int *classes)
*/
int sata_std_hardreset(struct ata_port *ap, int verbose, unsigned int *class)
{
u32 sstatus, serror;
unsigned long timeout = jiffies + (HZ * 5);
u32 serror;

DPRINTK("ENTER\n");

Expand All @@ -2371,15 +2388,8 @@ int sata_std_hardreset(struct ata_port *ap, int verbose, unsigned int *class)
*/
msleep(1);

scr_write_flush(ap, SCR_CONTROL, 0x300);

/* Wait for phy to become ready, if necessary. */
do {
msleep(200);
sstatus = scr_read(ap, SCR_STATUS);
if ((sstatus & 0xf) != 1)
break;
} while (time_before(jiffies, timeout));
/* Bring phy back */
sata_phy_resume(ap);

/* Clear SError */
serror = scr_read(ap, SCR_ERROR);
Expand Down

0 comments on commit 3279759

Please sign in to comment.