Skip to content

Commit

Permalink
libata: skip 0xff polling for PATA controllers
Browse files Browse the repository at this point in the history
In a presentation of true workmanship, pata_ali asserts IRQ
permanantly if the TF status register is read more than once when
there's no device attached to the port.

Avoid waiting polling for !0xff if it's PATA.  It's needed only for
some rare SATA devices anyway.

This problem is reported by Luca Tettamanti in bugzilla bug 9298.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Tested-By: Luca Tettamanti <kronos.it@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Nov 8, 2007
1 parent f7fc0ce commit 1974e20
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3373,14 +3373,20 @@ void ata_wait_after_reset(struct ata_port *ap, unsigned long deadline)
* to clear 0xff after reset. For example, HHD424020F7SV00
* iVDR needs >= 800ms while. Quantum GoVault needs even more
* than that.
*
* Note that some PATA controllers (pata_ali) explode if
* status register is read more than once when there's no
* device attached.
*/
while (1) {
u8 status = ata_chk_status(ap);
if (ap->flags & ATA_FLAG_SATA) {
while (1) {
u8 status = ata_chk_status(ap);

if (status != 0xff || time_after(jiffies, deadline))
return;
if (status != 0xff || time_after(jiffies, deadline))
return;

msleep(50);
msleep(50);
}
}
}

Expand Down

0 comments on commit 1974e20

Please sign in to comment.