aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/kernel/pSeries_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ppc64/kernel/pSeries_pci.c')
-rw-r--r--arch/ppc64/kernel/pSeries_pci.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/arch/ppc64/kernel/pSeries_pci.c b/arch/ppc64/kernel/pSeries_pci.c
index dfa6d3d3e9f0..1f5f141fb7a1 100644
--- a/arch/ppc64/kernel/pSeries_pci.c
+++ b/arch/ppc64/kernel/pSeries_pci.c
@@ -32,7 +32,7 @@
32 32
33#include "pci.h" 33#include "pci.h"
34 34
35static int __initdata s7a_workaround; 35static int __initdata s7a_workaround = -1;
36 36
37#if 0 37#if 0
38void pcibios_name_device(struct pci_dev *dev) 38void pcibios_name_device(struct pci_dev *dev)
@@ -65,6 +65,7 @@ static void __init check_s7a(void)
65 struct device_node *root; 65 struct device_node *root;
66 char *model; 66 char *model;
67 67
68 s7a_workaround = 0;
68 root = of_find_node_by_path("/"); 69 root = of_find_node_by_path("/");
69 if (root) { 70 if (root) {
70 model = get_property(root, "model", NULL); 71 model = get_property(root, "model", NULL);
@@ -74,6 +75,24 @@ static void __init check_s7a(void)
74 } 75 }
75} 76}
76 77
78void __devinit pSeries_irq_bus_setup(struct pci_bus *bus)
79{
80 struct pci_dev *dev;
81
82 if (s7a_workaround < 0)
83 check_s7a();
84 list_for_each_entry(dev, &bus->devices, bus_list) {
85 pci_read_irq_line(dev);
86 if (s7a_workaround) {
87 if (dev->irq > 16) {
88 dev->irq -= 3;
89 pci_write_config_byte(dev, PCI_INTERRUPT_LINE,
90 dev->irq);
91 }
92 }
93 }
94}
95
77static void __init pSeries_request_regions(void) 96static void __init pSeries_request_regions(void)
78{ 97{
79 if (!isa_io_base) 98 if (!isa_io_base)
@@ -89,20 +108,6 @@ static void __init pSeries_request_regions(void)
89 108
90void __init pSeries_final_fixup(void) 109void __init pSeries_final_fixup(void)
91{ 110{
92 struct pci_dev *dev = NULL;
93
94 check_s7a();
95
96 for_each_pci_dev(dev) {
97 pci_read_irq_line(dev);
98 if (s7a_workaround) {
99 if (dev->irq > 16) {
100 dev->irq -= 3;
101 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
102 }
103 }
104 }
105
106 phbs_remap_io(); 111 phbs_remap_io();
107 pSeries_request_regions(); 112 pSeries_request_regions();
108 113