Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57560
b: refs/heads/master
c: e141d99
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Jun 11, 2007
1 parent 4828806 commit c78eb29
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 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: 5acd50f641e697cb42240f278350a4f8eac9b4f5
refs/heads/master: e141d999b682cda9907179e3b843acb64c34a1d8
32 changes: 19 additions & 13 deletions trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3061,22 +3061,28 @@ static int ata_bus_post_reset(struct ata_port *ap, unsigned int devmask,
}
}

/* if device 1 was found in ata_devchk, wait for
* register access, then wait for BSY to clear
/* if device 1 was found in ata_devchk, wait for register
* access briefly, then wait for BSY to clear.
*/
while (dev1) {
u8 nsect, lbal;
if (dev1) {
int i;

ap->ops->dev_select(ap, 1);
nsect = ioread8(ioaddr->nsect_addr);
lbal = ioread8(ioaddr->lbal_addr);
if ((nsect == 1) && (lbal == 1))
break;
if (time_after(jiffies, deadline))
return -EBUSY;
msleep(50); /* give drive a breather */
}
if (dev1) {

/* Wait for register access. Some ATAPI devices fail
* to set nsect/lbal after reset, so don't waste too
* much time on it. We're gonna wait for !BSY anyway.
*/
for (i = 0; i < 2; i++) {
u8 nsect, lbal;

nsect = ioread8(ioaddr->nsect_addr);
lbal = ioread8(ioaddr->lbal_addr);
if ((nsect == 1) && (lbal == 1))
break;
msleep(50); /* give drive a breather */
}

rc = ata_wait_ready(ap, deadline);
if (rc) {
if (rc != -ENODEV)
Expand Down

0 comments on commit c78eb29

Please sign in to comment.