aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:27 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:27 -0400
commit255115fb35f80735c21a1cbe9809e9795a3af26e (patch)
tree55952820ef05e6f11c80c828b83a6cfdac366a84 /drivers
parentc7db966bbbf216b336da921e5d7ba5b9c8467ac1 (diff)
ide: allow host drivers to specify IRQ flags
* Add ->irq_flags field to struct ide_port_info and struct ide_host. * Update host drivers and IDE PCI code to use ->irq_flags field. * Convert init_irq() and ide_intr() to use host->irq_flags. This fixes handling of shared IRQs for non-PCI hosts and removes ugly ifdeffery from core IDE code. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/buddha.c1
-rw-r--r--drivers/ide/delkin_cb.c1
-rw-r--r--drivers/ide/falconide.c1
-rw-r--r--drivers/ide/gayle.c1
-rw-r--r--drivers/ide/ide-cs.c1
-rw-r--r--drivers/ide/ide-io.c15
-rw-r--r--drivers/ide/ide-probe.c13
-rw-r--r--drivers/ide/macide.c1
-rw-r--r--drivers/ide/q40ide.c1
-rw-r--r--drivers/ide/scc_pata.c1
-rw-r--r--drivers/ide/setup-pci.c4
-rw-r--r--drivers/ide/sgiioc4.c1
12 files changed, 20 insertions, 21 deletions
diff --git a/drivers/ide/buddha.c b/drivers/ide/buddha.c
index 606c3320fa58..d028f8864bc1 100644
--- a/drivers/ide/buddha.c
+++ b/drivers/ide/buddha.c
@@ -145,6 +145,7 @@ static void __init buddha_setup_ports(hw_regs_t *hw, unsigned long base,
145 145
146static const struct ide_port_info buddha_port_info = { 146static const struct ide_port_info buddha_port_info = {
147 .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA, 147 .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
148 .irq_flags = IRQF_SHARED,
148}; 149};
149 150
150 /* 151 /*
diff --git a/drivers/ide/delkin_cb.c b/drivers/ide/delkin_cb.c
index bacb1194c9c9..f153b95619bb 100644
--- a/drivers/ide/delkin_cb.c
+++ b/drivers/ide/delkin_cb.c
@@ -66,6 +66,7 @@ static const struct ide_port_info delkin_cb_port_info = {
66 .port_ops = &delkin_cb_port_ops, 66 .port_ops = &delkin_cb_port_ops,
67 .host_flags = IDE_HFLAG_IO_32BIT | IDE_HFLAG_UNMASK_IRQS | 67 .host_flags = IDE_HFLAG_IO_32BIT | IDE_HFLAG_UNMASK_IRQS |
68 IDE_HFLAG_NO_DMA, 68 IDE_HFLAG_NO_DMA,
69 .irq_flags = IRQF_SHARED,
69 .init_chipset = delkin_cb_init_chipset, 70 .init_chipset = delkin_cb_init_chipset,
70}; 71};
71 72
diff --git a/drivers/ide/falconide.c b/drivers/ide/falconide.c
index bb0c86e976e4..6085feb1fae8 100644
--- a/drivers/ide/falconide.c
+++ b/drivers/ide/falconide.c
@@ -105,6 +105,7 @@ static const struct ide_port_info falconide_port_info = {
105 .tp_ops = &falconide_tp_ops, 105 .tp_ops = &falconide_tp_ops,
106 .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_SERIALIZE | 106 .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_SERIALIZE |
107 IDE_HFLAG_NO_DMA, 107 IDE_HFLAG_NO_DMA,
108 .irq_flags = IRQF_SHARED,
108}; 109};
109 110
110static void __init falconide_setup_ports(hw_regs_t *hw) 111static void __init falconide_setup_ports(hw_regs_t *hw)
diff --git a/drivers/ide/gayle.c b/drivers/ide/gayle.c
index dce01765adbc..dc778251cb05 100644
--- a/drivers/ide/gayle.c
+++ b/drivers/ide/gayle.c
@@ -120,6 +120,7 @@ static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base,
120static const struct ide_port_info gayle_port_info = { 120static const struct ide_port_info gayle_port_info = {
121 .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_SERIALIZE | 121 .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_SERIALIZE |
122 IDE_HFLAG_NO_DMA, 122 IDE_HFLAG_NO_DMA,
123 .irq_flags = IRQF_SHARED,
123}; 124};
124 125
125 /* 126 /*
diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c
index f50210fe558f..9e47f3529d55 100644
--- a/drivers/ide/ide-cs.c
+++ b/drivers/ide/ide-cs.c
@@ -154,6 +154,7 @@ static const struct ide_port_ops idecs_port_ops = {
154static const struct ide_port_info idecs_port_info = { 154static const struct ide_port_info idecs_port_info = {
155 .port_ops = &idecs_port_ops, 155 .port_ops = &idecs_port_ops,
156 .host_flags = IDE_HFLAG_NO_DMA, 156 .host_flags = IDE_HFLAG_NO_DMA,
157 .irq_flags = IRQF_SHARED,
157}; 158};
158 159
159static struct ide_host *idecs_register(unsigned long io, unsigned long ctl, 160static struct ide_host *idecs_register(unsigned long io, unsigned long ctl,
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 030b0ea1a1e1..7007c48e27ae 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -841,6 +841,7 @@ static void unexpected_intr(int irq, ide_hwif_t *hwif)
841irqreturn_t ide_intr (int irq, void *dev_id) 841irqreturn_t ide_intr (int irq, void *dev_id)
842{ 842{
843 ide_hwif_t *hwif = (ide_hwif_t *)dev_id; 843 ide_hwif_t *hwif = (ide_hwif_t *)dev_id;
844 struct ide_host *host = hwif->host;
844 ide_drive_t *uninitialized_var(drive); 845 ide_drive_t *uninitialized_var(drive);
845 ide_handler_t *handler; 846 ide_handler_t *handler;
846 unsigned long flags; 847 unsigned long flags;
@@ -848,8 +849,8 @@ irqreturn_t ide_intr (int irq, void *dev_id)
848 irqreturn_t irq_ret = IRQ_NONE; 849 irqreturn_t irq_ret = IRQ_NONE;
849 int plug_device = 0; 850 int plug_device = 0;
850 851
851 if (hwif->host->host_flags & IDE_HFLAG_SERIALIZE) { 852 if (host->host_flags & IDE_HFLAG_SERIALIZE) {
852 if (hwif != hwif->host->cur_port) 853 if (hwif != host->cur_port)
853 goto out_early; 854 goto out_early;
854 } 855 }
855 856
@@ -872,27 +873,19 @@ irqreturn_t ide_intr (int irq, void *dev_id)
872 * 873 *
873 * For PCI, we cannot tell the difference, 874 * For PCI, we cannot tell the difference,
874 * so in that case we just ignore it and hope it goes away. 875 * so in that case we just ignore it and hope it goes away.
875 *
876 * FIXME: unexpected_intr should be hwif-> then we can
877 * remove all the ifdef PCI crap
878 */ 876 */
879#ifdef CONFIG_BLK_DEV_IDEPCI 877 if ((host->irq_flags & IRQF_SHARED) == 0) {
880 if (hwif->chipset != ide_pci)
881#endif /* CONFIG_BLK_DEV_IDEPCI */
882 {
883 /* 878 /*
884 * Probably not a shared PCI interrupt, 879 * Probably not a shared PCI interrupt,
885 * so we can safely try to do something about it: 880 * so we can safely try to do something about it:
886 */ 881 */
887 unexpected_intr(irq, hwif); 882 unexpected_intr(irq, hwif);
888#ifdef CONFIG_BLK_DEV_IDEPCI
889 } else { 883 } else {
890 /* 884 /*
891 * Whack the status register, just in case 885 * Whack the status register, just in case
892 * we have a leftover pending IRQ. 886 * we have a leftover pending IRQ.
893 */ 887 */
894 (void)hwif->tp_ops->read_status(hwif); 888 (void)hwif->tp_ops->read_status(hwif);
895#endif /* CONFIG_BLK_DEV_IDEPCI */
896 } 889 }
897 goto out; 890 goto out;
898 } 891 }
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 4b00945cf7d1..f3a56595eb75 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -837,20 +837,13 @@ static int ide_port_setup_devices(ide_hwif_t *hwif)
837static int init_irq (ide_hwif_t *hwif) 837static int init_irq (ide_hwif_t *hwif)
838{ 838{
839 struct ide_io_ports *io_ports = &hwif->io_ports; 839 struct ide_io_ports *io_ports = &hwif->io_ports;
840 irq_handler_t irq_handler; 840 struct ide_host *host = hwif->host;
841 int sa = 0; 841 irq_handler_t irq_handler = host->irq_handler;
842 int sa = host->irq_flags;
842 843
843 irq_handler = hwif->host->irq_handler;
844 if (irq_handler == NULL) 844 if (irq_handler == NULL)
845 irq_handler = ide_intr; 845 irq_handler = ide_intr;
846 846
847#if defined(__mc68000__)
848 sa = IRQF_SHARED;
849#endif /* __mc68000__ */
850
851 if (hwif->chipset == ide_pci)
852 sa = IRQF_SHARED;
853
854 if (io_ports->ctl_addr) 847 if (io_ports->ctl_addr)
855 hwif->tp_ops->set_irq(hwif, 1); 848 hwif->tp_ops->set_irq(hwif, 1);
856 849
diff --git a/drivers/ide/macide.c b/drivers/ide/macide.c
index 56112ee9f5a8..4b1718e83283 100644
--- a/drivers/ide/macide.c
+++ b/drivers/ide/macide.c
@@ -82,6 +82,7 @@ static void __init macide_setup_ports(hw_regs_t *hw, unsigned long base,
82 82
83static const struct ide_port_info macide_port_info = { 83static const struct ide_port_info macide_port_info = {
84 .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA, 84 .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
85 .irq_flags = IRQF_SHARED,
85}; 86};
86 87
87static const char *mac_ide_name[] = 88static const char *mac_ide_name[] =
diff --git a/drivers/ide/q40ide.c b/drivers/ide/q40ide.c
index ebd576df2d84..32f669d656a6 100644
--- a/drivers/ide/q40ide.c
+++ b/drivers/ide/q40ide.c
@@ -112,6 +112,7 @@ static const struct ide_tp_ops q40ide_tp_ops = {
112static const struct ide_port_info q40ide_port_info = { 112static const struct ide_port_info q40ide_port_info = {
113 .tp_ops = &q40ide_tp_ops, 113 .tp_ops = &q40ide_tp_ops,
114 .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA, 114 .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
115 .irq_flags = IRQF_SHARED,
115}; 116};
116 117
117/* 118/*
diff --git a/drivers/ide/scc_pata.c b/drivers/ide/scc_pata.c
index 540bc842f3ad..ae965da5dde0 100644
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -891,6 +891,7 @@ static const struct ide_port_info scc_chipset __devinitdata = {
891 .port_ops = &scc_port_ops, 891 .port_ops = &scc_port_ops,
892 .dma_ops = &scc_dma_ops, 892 .dma_ops = &scc_dma_ops,
893 .host_flags = IDE_HFLAG_SINGLE, 893 .host_flags = IDE_HFLAG_SINGLE,
894 .irq_flags = IRQF_SHARED,
894 .pio_mask = ATA_PIO4, 895 .pio_mask = ATA_PIO4,
895}; 896};
896 897
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 24bc884826fc..a19dbccd7617 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -558,6 +558,8 @@ int ide_pci_init_one(struct pci_dev *dev, const struct ide_port_info *d,
558 558
559 host->host_priv = priv; 559 host->host_priv = priv;
560 560
561 host->irq_flags = IRQF_SHARED;
562
561 pci_set_drvdata(dev, host); 563 pci_set_drvdata(dev, host);
562 564
563 ret = do_ide_setup_pci_device(dev, d, 1); 565 ret = do_ide_setup_pci_device(dev, d, 1);
@@ -606,6 +608,8 @@ int ide_pci_init_two(struct pci_dev *dev1, struct pci_dev *dev2,
606 608
607 host->host_priv = priv; 609 host->host_priv = priv;
608 610
611 host->irq_flags = IRQF_SHARED;
612
609 pci_set_drvdata(pdev[0], host); 613 pci_set_drvdata(pdev[0], host);
610 pci_set_drvdata(pdev[1], host); 614 pci_set_drvdata(pdev[1], host);
611 615
diff --git a/drivers/ide/sgiioc4.c b/drivers/ide/sgiioc4.c
index fdb9d7037694..1cffe70f385d 100644
--- a/drivers/ide/sgiioc4.c
+++ b/drivers/ide/sgiioc4.c
@@ -557,6 +557,7 @@ static const struct ide_port_info sgiioc4_port_info __devinitconst = {
557 .port_ops = &sgiioc4_port_ops, 557 .port_ops = &sgiioc4_port_ops,
558 .dma_ops = &sgiioc4_dma_ops, 558 .dma_ops = &sgiioc4_dma_ops,
559 .host_flags = IDE_HFLAG_MMIO, 559 .host_flags = IDE_HFLAG_MMIO,
560 .irq_flags = IRQF_SHARED,
560 .mwdma_mask = ATA_MWDMA2_ONLY, 561 .mwdma_mask = ATA_MWDMA2_ONLY,
561}; 562};
562 563