linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.22-rc7] libata: fix assigned IRQ reporting
@ 2007-07-02 16:38 Tejun Heo
  2007-07-02 21:47 ` Francois Romieu
  2007-07-03 14:07 ` Jeff Garzik
  0 siblings, 2 replies; 13+ messages in thread
From: Tejun Heo @ 2007-07-02 16:38 UTC (permalink / raw)
  To: Jeff Garzik, linux-ide; +Cc: Alan Cox

host->irq and host->irq2 should be set before ata_host_register() for
IRQ reporting to work.  Move up host->irq assignment in
ata_host_activate() and add it to ata_pci_init_one() native path and
pata_cs5520.

The port info printing in ata_host_register() doesn't fit all the
different controllers.  It should probably be moved out to LLDs with
some helpers in the future.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
 drivers/ata/libata-core.c |    6 +++---
 drivers/ata/libata-sff.c  |    5 +++--
 drivers/ata/pata_cs5520.c |    5 +++++
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index bfc59a1..e57a9f8 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6424,14 +6424,14 @@ int ata_host_activate(struct ata_host *host, int irq,
 	if (rc)
 		return rc;
 
+	/* Used to print device info at probe */
+	host->irq = irq;
+
 	rc = ata_host_register(host, sht);
 	/* if failed, just free the IRQ and leave ports alone */
 	if (rc)
 		devm_free_irq(host->dev, irq, host);
 
-	/* Used to print device info at probe */
-	host->irq = irq;
-
 	return rc;
 }
 
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index ce84805..fa1c22c 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -1065,10 +1065,11 @@ int ata_pci_init_one(struct pci_dev *pdev,
 	if (rc)
 		goto err_out;
 
-	if (!legacy_mode)
+	if (!legacy_mode) {
 		rc = devm_request_irq(dev, pdev->irq, pi->port_ops->irq_handler,
 				      IRQF_SHARED, DRV_NAME, host);
-	else {
+		host->irq = pdev->irq;
+	} else {
 		irq_handler_t handler[2] = { host->ops->irq_handler,
 					     host->ops->irq_handler };
 		unsigned int irq_flags[2] = { IRQF_SHARED, IRQF_SHARED };
diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c
index 1aabe15..00cf013 100644
--- a/drivers/ata/pata_cs5520.c
+++ b/drivers/ata/pata_cs5520.c
@@ -284,6 +284,11 @@ static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_devi
 				      ata_interrupt, 0, DRV_NAME, host);
 		if (rc)
 			return rc;
+
+		if (i == 0)
+			host->irq = irq[0];
+		else
+			host->irq2 = irq[1];
 	}
 
 	return ata_host_register(host, &cs5520_sht);

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-07-10 22:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-02 16:38 [PATCH 2.6.22-rc7] libata: fix assigned IRQ reporting Tejun Heo
2007-07-02 21:47 ` Francois Romieu
2007-07-03  1:19   ` Tejun Heo
2007-07-03 22:22     ` Francois Romieu
2007-07-04  5:33       ` Tejun Heo
2007-07-04  5:46         ` Tejun Heo
2007-07-04 18:59           ` Francois Romieu
2007-07-05  2:38             ` Tejun Heo
2007-07-05 22:45               ` Francois Romieu
2007-07-06  6:40                 ` Tejun Heo
2007-07-10 18:24                   ` Francois Romieu
2007-07-10 21:44                     ` Francois Romieu
2007-07-03 14:07 ` 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).