Title: [6959] branches/2009R1/drivers/ata/libata-core.c: 1.
Revision
6959
Author
bhsong
Date
2009-07-09 21:49:11 -0500 (Thu, 09 Jul 2009)

Log Message

1. Fix bug [#5216], since irq is enabled after probe, we can use polling in probe;
That also fixed the problem "qc timeout (cmd 0x27) failed to read native max address (err_mask=0x4)
" for ATA	
2. Change IRQF_DISABLED flag to IRQ_NOAUTOEN since only IRQ_NOAUTOEN cares about whether irq is enabled with request

Modified Paths

Diff

Modified: branches/2009R1/drivers/ata/libata-core.c (6958 => 6959)


--- branches/2009R1/drivers/ata/libata-core.c	2009-07-10 00:00:49 UTC (rev 6958)
+++ branches/2009R1/drivers/ata/libata-core.c	2009-07-10 02:49:11 UTC (rev 6959)
@@ -62,6 +62,7 @@
 #include <linux/libata.h>
 #include <asm/byteorder.h>
 #include <linux/cdrom.h>
+#include <linux/irq.h>
 
 #include "libata.h"
 
@@ -5870,7 +5871,9 @@
 int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
 {
 	int i, rc;
+	struct irq_desc *desc;
 
+	desc = (host->irq > 0) ? irq_to_desc(host->irq) : NULL;
 	/* host must have been started */
 	if (!(host->flags & ATA_HOST_STARTED)) {
 		dev_printk(KERN_ERR, host->dev,
@@ -5931,6 +5934,10 @@
 	for (i = 0; i < host->n_ports; i++) {
 		struct ata_port *ap = host->ports[i];
 
+		/* to workaround the hardware interrupt issue, use polling for probe */
+		if (host->irq && (desc->status & IRQ_NOAUTOEN))
+			ap->flags |= ATA_FLAG_PIO_POLLING;
+
 		/* probe */
 		if (ap->ops->error_handler) {
 			struct ata_eh_info *ehi = &ap->link.eh_info;
@@ -5967,10 +5974,14 @@
 				 */
 			}
 		}
+
+		/* restore to irq mode for data transfer */
+		if (host->irq && (desc->status & IRQ_NOAUTOEN))
+			ap->flags &= ~ATA_FLAG_PIO_POLLING;
 	}
 
 	/* enable irq after probe if it is asked to be disabled when request*/
-	if (host->irq_flags & IRQF_DISABLED)
+	if (host->irq && (desc->status & IRQ_NOAUTOEN))
 		enable_irq(host->irq);
 
 	/* probes are done, now scan each port's disk(s) */
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to