Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29267
b: refs/heads/master
c: ecc2e2b
h: refs/heads/master
i:
  29265: b59f771
  29263: ee3ac0b
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Apr 11, 2006
1 parent ac81c6f commit 201f1b5
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 4 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: 0eaa6058a6a664ce692e3dc38c6891a74ca47f59
refs/heads/master: ecc2e2b9c97719592b3078d5a5a8666551c91115
43 changes: 40 additions & 3 deletions trunk/drivers/scsi/sata_sil24.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,47 @@ static int sil24_softreset(struct ata_port *ap, unsigned int *class)

static int sil24_hardreset(struct ata_port *ap, unsigned int *class)
{
unsigned int dummy_class;
void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr;
const char *reason;
int tout_msec;
u32 tmp;

/* sil24 does the right thing(tm) without any protection */
ata_set_sata_spd(ap);

tout_msec = 100;
if (sata_dev_present(ap))
tout_msec = 5000;

writel(PORT_CS_DEV_RST, port + PORT_CTRL_STAT);
tmp = ata_wait_register(port + PORT_CTRL_STAT,
PORT_CS_DEV_RST, PORT_CS_DEV_RST, 10, tout_msec);

/* SStatus oscillates between zero and valid status for short
* duration after DEV_RST, give it time to settle.
*/
msleep(100);

if (tmp & PORT_CS_DEV_RST) {
if (!sata_dev_present(ap))
return 0;
reason = "link not ready";
goto err;
}

if (ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT)) {
reason = "device not ready";
goto err;
}

/* sil24 doesn't report device signature after hard reset */
return sata_std_hardreset(ap, &dummy_class);
/* sil24 doesn't report device class code after hardreset,
* leave *class alone.
*/
return 0;

err:
printk(KERN_ERR "ata%u: hardreset failed (%s)\n", ap->id, reason);
return -EIO;
}

static int sil24_probe_reset(struct ata_port *ap, unsigned int *classes)
Expand Down

0 comments on commit 201f1b5

Please sign in to comment.