* [PATCH] libata: move ata_irq_on() into libata-sff.c
@ 2006-10-09 2:10 Tejun Heo
2006-10-09 2:20 ` [PATCH] libata: fix ata_irq_on() Tejun Heo
2006-11-01 5:14 ` [PATCH] libata: move ata_irq_on() into libata-sff.c Jeff Garzik
0 siblings, 2 replies; 3+ messages in thread
From: Tejun Heo @ 2006-10-09 2:10 UTC (permalink / raw)
To: Jeff Garzik, linux-ide
ata_irq_on() isn't used outside of libata core layer. The function is
TF/SFF interface specific but currently used by core path with some
hack too. Move it from include/linux/libata.h to
drivers/ata/libata-sff.c.
Signed-off-by: Tejun Heo <htejun@gmail.com>
---
drivers/ata/libata-sff.c | 29 +++++++++++++++++++++++++++++
drivers/ata/libata.h | 3 +++
include/linux/libata.h | 31 -------------------------------
3 files changed, 32 insertions(+), 31 deletions(-)
Index: work/drivers/ata/libata-sff.c
===================================================================
--- work.orig/drivers/ata/libata-sff.c
+++ work/drivers/ata/libata-sff.c
@@ -39,6 +39,35 @@
#include "libata.h"
/**
+ * ata_irq_on - Enable interrupts on a port.
+ * @ap: Port on which interrupts are enabled.
+ *
+ * Enable interrupts on a legacy IDE device using MMIO or PIO,
+ * wait for idle, clear any pending interrupts.
+ *
+ * LOCKING:
+ * Inherited from caller.
+ */
+u8 ata_irq_on(struct ata_port *ap)
+{
+ struct ata_ioports *ioaddr = &ap->ioaddr;
+ u8 tmp;
+
+ ap->ctl &= ~ATA_NIEN;
+ ap->last_ctl = ap->ctl;
+
+ if (ap->flags & ATA_FLAG_MMIO)
+ 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;
+}
+
+/**
* ata_tf_load_pio - send taskfile registers to host controller
* @ap: Port to which output is sent
* @tf: ATA taskfile register set
Index: work/drivers/ata/libata.h
===================================================================
--- work.orig/drivers/ata/libata.h
+++ work/drivers/ata/libata.h
@@ -119,4 +119,7 @@ extern void ata_scsi_error(struct Scsi_H
extern void ata_port_wait_eh(struct ata_port *ap);
extern void ata_qc_schedule_eh(struct ata_queued_cmd *qc);
+/* libata-sff.c */
+extern u8 ata_irq_on(struct ata_port *ap);
+
#endif /* __LIBATA_H__ */
Index: work/include/linux/libata.h
===================================================================
--- work.orig/include/linux/libata.h
+++ work/include/linux/libata.h
@@ -1148,37 +1148,6 @@ static inline void ata_qc_reinit(struct
}
/**
- * ata_irq_on - Enable interrupts on a port.
- * @ap: Port on which interrupts are enabled.
- *
- * Enable interrupts on a legacy IDE device using MMIO or PIO,
- * wait for idle, clear any pending interrupts.
- *
- * LOCKING:
- * Inherited from caller.
- */
-
-static inline u8 ata_irq_on(struct ata_port *ap)
-{
- struct ata_ioports *ioaddr = &ap->ioaddr;
- u8 tmp;
-
- ap->ctl &= ~ATA_NIEN;
- ap->last_ctl = ap->ctl;
-
- if (ap->flags & ATA_FLAG_MMIO)
- 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;
-}
-
-
-/**
* ata_irq_ack - Acknowledge a device interrupt.
* @ap: Port on which interrupts are enabled.
*
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH] libata: fix ata_irq_on()
2006-10-09 2:10 [PATCH] libata: move ata_irq_on() into libata-sff.c Tejun Heo
@ 2006-10-09 2:20 ` Tejun Heo
2006-11-01 5:14 ` [PATCH] libata: move ata_irq_on() into libata-sff.c Jeff Garzik
1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2006-10-09 2:20 UTC (permalink / raw)
To: Jeff Garzik, linux-ide
* 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@gmail.com>
---
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);
}
/**
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] libata: move ata_irq_on() into libata-sff.c
2006-10-09 2:10 [PATCH] libata: move ata_irq_on() into libata-sff.c Tejun Heo
2006-10-09 2:20 ` [PATCH] libata: fix ata_irq_on() Tejun Heo
@ 2006-11-01 5:14 ` Jeff Garzik
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2006-11-01 5:14 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide
Tejun Heo wrote:
> ata_irq_on() isn't used outside of libata core layer. The function is
> TF/SFF interface specific but currently used by core path with some
> hack too. Move it from include/linux/libata.h to
> drivers/ata/libata-sff.c.
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
applied
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-11-01 5:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-09 2:10 [PATCH] libata: move ata_irq_on() into libata-sff.c Tejun Heo
2006-10-09 2:20 ` [PATCH] libata: fix ata_irq_on() Tejun Heo
2006-11-01 5:14 ` [PATCH] libata: move ata_irq_on() into libata-sff.c Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).