[PATCH] libata: fix ata_irq_on()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* IRQ must be cleared *before* unmasking not after.

* ata_wait_idle() causes spurious 1sec wait and there is no reason to
  wait for !DRQ.  DRQ waiting causes unnecessary delay on empty port
  which reports funky status like 0x7f.  !BSY waiting seems superflous
  too.  No caller depends on ata_irq_on() to wait for idle state.
  The port is either already idle on entry or the caller waits for
  idle status afterwards.  Wait only for !BSY without whining on
  failure.

Signed-off-by: Tejun Heo <htejun@xxxxxxxxx>
---

Jeff, this fixes 'abnormal status 0xXX' messages for empty ports.  The
message was triggerd from ata_bmdma_thaw().  Unlike old EH, new EH
thaws empty ports (mainly for hotplugging) and controllers which
reports set DRQ on empty ports triggers the message.  I think this
update should be included in #uptream-fixes too.  People are getting
annoyed by the message.

Thanks.

 drivers/ata/libata-sff.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Index: work/drivers/ata/libata-sff.c
===================================================================
--- work.orig/drivers/ata/libata-sff.c
+++ work/drivers/ata/libata-sff.c
@@ -51,7 +51,8 @@
 u8 ata_irq_on(struct ata_port *ap)
 {
 	struct ata_ioports *ioaddr = &ap->ioaddr;
-	u8 tmp;
+
+	ap->ops->irq_clear(ap);
 
 	ap->ctl &= ~ATA_NIEN;
 	ap->last_ctl = ap->ctl;
@@ -60,11 +61,8 @@ u8 ata_irq_on(struct ata_port *ap)
 		writeb(ap->ctl, (void __iomem *) ioaddr->ctl_addr);
 	else
 		outb(ap->ctl, ioaddr->ctl_addr);
-	tmp = ata_wait_idle(ap);
-
-	ap->ops->irq_clear(ap);
 
-	return tmp;
+	return ata_busy_wait(ap, ATA_BUSY, 1000);
 }
 
 /**
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux