提交 1974e201 编写于 作者: T Tejun Heo 提交者: Jeff Garzik

libata: skip 0xff polling for PATA controllers

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: NTejun Heo <htejun@gmail.com>
Tested-By: NLuca Tettamanti <kronos.it@gmail.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 f7fc0ceb
...@@ -3373,14 +3373,20 @@ void ata_wait_after_reset(struct ata_port *ap, unsigned long deadline) ...@@ -3373,14 +3373,20 @@ void ata_wait_after_reset(struct ata_port *ap, unsigned long deadline)
* to clear 0xff after reset. For example, HHD424020F7SV00 * to clear 0xff after reset. For example, HHD424020F7SV00
* iVDR needs >= 800ms while. Quantum GoVault needs even more * iVDR needs >= 800ms while. Quantum GoVault needs even more
* than that. * 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) { if (ap->flags & ATA_FLAG_SATA) {
u8 status = ata_chk_status(ap); while (1) {
u8 status = ata_chk_status(ap);
if (status != 0xff || time_after(jiffies, deadline)) if (status != 0xff || time_after(jiffies, deadline))
return; return;
msleep(50); msleep(50);
}
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册