Title: [6873] trunk/drivers/ata/libata-core.c: cleanup the codes of bug fix [#5216], schedule a function to enable_irq
Revision
6873
Author
bhsong
Date
2009-06-30 01:31:14 -0500 (Tue, 30 Jun 2009)

Log Message

cleanup the codes of bug fix [#5216], schedule a function to enable_irq

Modified Paths

Diff

Modified: trunk/drivers/ata/libata-core.c (6872 => 6873)


--- trunk/drivers/ata/libata-core.c	2009-06-30 05:57:22 UTC (rev 6872)
+++ trunk/drivers/ata/libata-core.c	2009-06-30 06:31:14 UTC (rev 6873)
@@ -5993,7 +5993,16 @@
 	host->ops = ops;
 }
 
+void async_irq_enable(void *data, async_cookie_t cookie)
+{
+	struct ata_host *host = data;
 
+	/* in order to make irq enabled after probing, we need to synchronize at this point */
+	async_synchronize_cookie(cookie);
+
+	enable_irq(host->irq);
+}
+
 static void async_port_probe(void *data, async_cookie_t cookie)
 {
 	int rc;
@@ -6050,12 +6059,6 @@
 	async_synchronize_cookie(cookie);
 
 	ata_scsi_scan_host(ap, 1);
-
-	/* enable irq after probe if it is asked to be disabled when request */
-	if (((ap - ap->host->ports[0]) / sizeof(*ap)) == (ap->host->n_ports - 1)) {
-		if (ap->host->irq_flags & IRQF_DISABLED)
-			enable_irq(ap->host->irq);
-	}
 }
 /**
  *	ata_host_register - register initialized ATA host
@@ -6138,6 +6141,10 @@
 		async_schedule(async_port_probe, ap);
 	}
 
+	/* enable irq after probe if it is asked to be disabled when request */
+	if (host->irq_flags & IRQF_DISABLED)
+		async_schedule(async_irq_enable, host);
+
 	return 0;
 }
 
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to