Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89266
b: refs/heads/master
c: a89611e
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Apr 17, 2008
1 parent cad1bb2 commit 45b4322
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 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: aa2731ad9ad80ac3fca48bd1c4cf0eceede4810e
refs/heads/master: a89611e8489ac24f371c9fd6fef6605b170b16ba
14 changes: 12 additions & 2 deletions trunk/drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,16 @@ static int ahci_exec_polled_cmd(struct ata_port *ap, int pmp,
return 0;
}

static int ahci_check_ready(struct ata_link *link)
{
void __iomem *mmio = link->ap->ioaddr.cmd_addr;
u8 status = readl(mmio + PORT_TFDATA) & 0xFF;

if (!(status & ATA_BUSY))
return 1;
return 0;
}

static int ahci_do_softreset(struct ata_link *link, unsigned int *class,
int pmp, unsigned long deadline)
{
Expand Down Expand Up @@ -1303,7 +1313,7 @@ static int ahci_do_softreset(struct ata_link *link, unsigned int *class,
ahci_exec_polled_cmd(ap, pmp, &tf, 0, 0, 0);

/* wait for link to become ready */
rc = ata_sff_wait_after_reset(link, 1, deadline);
rc = ata_wait_after_reset(link, deadline, ahci_check_ready);
/* link occupied, -ENODEV too is an error */
if (rc) {
reason = "device not ready";
Expand Down Expand Up @@ -1426,7 +1436,7 @@ static int ahci_p5wdh_hardreset(struct ata_link *link, unsigned int *class,
* have to be reset again. For most cases, this should
* suffice while making probing snappish enough.
*/
rc = ata_sff_wait_after_reset(link, 1, jiffies + 2 * HZ);
rc = ata_wait_after_reset(link, jiffies + 2 * HZ, ahci_check_ready);
if (rc)
ahci_kick_engine(ap, 0);

Expand Down

0 comments on commit 45b4322

Please sign in to comment.