patch 8/8: ack more unsolicited irq Signed-off-by: Albert Lee <albertcc@xxxxxxxxxx> Cc: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> Cc: Mark Lord <liml@xxxxxx> Cc: Tejun Heo <htejun@xxxxxxxxx> --- To address Alan's concern about the unsolicited irq (hopefully), this patch tries to ack irq that happens after HSM accessing the port but before the data transfer that actually triggers INTRQ. For a typical transaction: 0. wait for irq or polling for device not busy 1. hsm starts accessing the port (ATA_PFLAG_HSM_WQ set) 2. hsm transfer the "head" part of the data 3. hsm acquires ap->lock 4. hsm transfer the "tail" part of the data (which may trigger INTRQ) 5. hsm clears ATA_PFLAG_HSM_WQ and release ap->lock This patch allows the irq handler to ack irqs that occur during 1 and 2. (Another patch 5/8 acks irq before 1 and when polling.) As previously discussed, the possible issue with this patch is: Some ATA/ATAPI devices might be unhappy if the STATUS register is read during data transfer (not sure if this is true or not). (Patch 5/8 doesn't have such issue.) diff -Nrup 07_irq_wq_fix/drivers/ata/libata-core.c 08_possible_ack/drivers/ata/libata-core.c --- 07_irq_wq_fix/drivers/ata/libata-core.c 2007-05-16 13:53:37.000000000 +0800 +++ 08_possible_ack/drivers/ata/libata-core.c 2007-05-16 13:53:45.000000000 +0800 @@ -5723,8 +5723,14 @@ inline unsigned int ata_host_intr (struc ap->print_id, qc->tf.protocol, ap->hsm_task_state); /* HSM accessing the port from the workqueue */ - if (ap->pflags & ATA_PFLAG_HSM_WQ) + if (ap->pflags & ATA_PFLAG_HSM_WQ) { + /* HSM is not transfering the last piece + * of data that triggers INTRQ yet. + * ack unsolicited irq. + */ + ata_chk_status(ap); goto idle_irq; + } /* polling, while HSM not yet active in wq */ if (qc->tf.flags & ATA_TFLAG_POLLING) { - 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