diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug/ibmphp_core.c | 56 | ||||
-rw-r--r-- | drivers/pci/htirq.c | 4 | ||||
-rw-r--r-- | drivers/pci/intr_remapping.c | 15 |
3 files changed, 39 insertions, 36 deletions
diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c index dd18f857dfb0..ef53b05a411a 100644 --- a/drivers/pci/hotplug/ibmphp_core.c +++ b/drivers/pci/hotplug/ibmphp_core.c | |||
@@ -153,45 +153,49 @@ int ibmphp_init_devno(struct slot **cur_slot) | |||
153 | return -1; | 153 | return -1; |
154 | } | 154 | } |
155 | for (loop = 0; loop < len; loop++) { | 155 | for (loop = 0; loop < len; loop++) { |
156 | if ((*cur_slot)->number == rtable->slots[loop].slot) { | 156 | if ((*cur_slot)->number == rtable->slots[loop].slot && |
157 | if ((*cur_slot)->bus == rtable->slots[loop].bus) { | 157 | (*cur_slot)->bus == rtable->slots[loop].bus) { |
158 | int ioapic = -1, ioapic_pin = -1; | ||
159 | int triggering, polarity; | ||
160 | |||
158 | (*cur_slot)->device = PCI_SLOT(rtable->slots[loop].devfn); | 161 | (*cur_slot)->device = PCI_SLOT(rtable->slots[loop].devfn); |
159 | for (i = 0; i < 4; i++) | 162 | for (i = 0; i < 4; i++) |
160 | (*cur_slot)->irq[i] = IO_APIC_get_PCI_irq_vector((int) (*cur_slot)->bus, | 163 | (*cur_slot)->irq[i] = IO_APIC_get_PCI_irq_vector((int) (*cur_slot)->bus, |
161 | (int) (*cur_slot)->device, i); | 164 | (int) (*cur_slot)->device, i. |
162 | 165 | &ioapic, &ioapic_pin, | |
163 | debug("(*cur_slot)->irq[0] = %x\n", | 166 | &triggering, &polarity); |
164 | (*cur_slot)->irq[0]); | 167 | |
165 | debug("(*cur_slot)->irq[1] = %x\n", | 168 | debug("(*cur_slot)->irq[0] = %x\n", |
166 | (*cur_slot)->irq[1]); | 169 | (*cur_slot)->irq[0]); |
167 | debug("(*cur_slot)->irq[2] = %x\n", | 170 | debug("(*cur_slot)->irq[1] = %x\n", |
168 | (*cur_slot)->irq[2]); | 171 | (*cur_slot)->irq[1]); |
169 | debug("(*cur_slot)->irq[3] = %x\n", | 172 | debug("(*cur_slot)->irq[2] = %x\n", |
170 | (*cur_slot)->irq[3]); | 173 | (*cur_slot)->irq[2]); |
171 | 174 | debug("(*cur_slot)->irq[3] = %x\n", | |
172 | debug("rtable->exlusive_irqs = %x\n", | 175 | (*cur_slot)->irq[3]); |
176 | |||
177 | debug("rtable->exlusive_irqs = %x\n", | ||
173 | rtable->exclusive_irqs); | 178 | rtable->exclusive_irqs); |
174 | debug("rtable->slots[loop].irq[0].bitmap = %x\n", | 179 | debug("rtable->slots[loop].irq[0].bitmap = %x\n", |
175 | rtable->slots[loop].irq[0].bitmap); | 180 | rtable->slots[loop].irq[0].bitmap); |
176 | debug("rtable->slots[loop].irq[1].bitmap = %x\n", | 181 | debug("rtable->slots[loop].irq[1].bitmap = %x\n", |
177 | rtable->slots[loop].irq[1].bitmap); | 182 | rtable->slots[loop].irq[1].bitmap); |
178 | debug("rtable->slots[loop].irq[2].bitmap = %x\n", | 183 | debug("rtable->slots[loop].irq[2].bitmap = %x\n", |
179 | rtable->slots[loop].irq[2].bitmap); | 184 | rtable->slots[loop].irq[2].bitmap); |
180 | debug("rtable->slots[loop].irq[3].bitmap = %x\n", | 185 | debug("rtable->slots[loop].irq[3].bitmap = %x\n", |
181 | rtable->slots[loop].irq[3].bitmap); | 186 | rtable->slots[loop].irq[3].bitmap); |
182 | 187 | ||
183 | debug("rtable->slots[loop].irq[0].link = %x\n", | 188 | debug("rtable->slots[loop].irq[0].link = %x\n", |
184 | rtable->slots[loop].irq[0].link); | 189 | rtable->slots[loop].irq[0].link); |
185 | debug("rtable->slots[loop].irq[1].link = %x\n", | 190 | debug("rtable->slots[loop].irq[1].link = %x\n", |
186 | rtable->slots[loop].irq[1].link); | 191 | rtable->slots[loop].irq[1].link); |
187 | debug("rtable->slots[loop].irq[2].link = %x\n", | 192 | debug("rtable->slots[loop].irq[2].link = %x\n", |
188 | rtable->slots[loop].irq[2].link); | 193 | rtable->slots[loop].irq[2].link); |
189 | debug("rtable->slots[loop].irq[3].link = %x\n", | 194 | debug("rtable->slots[loop].irq[3].link = %x\n", |
190 | rtable->slots[loop].irq[3].link); | 195 | rtable->slots[loop].irq[3].link); |
191 | debug("end of init_devno\n"); | 196 | debug("end of init_devno\n"); |
192 | kfree(rtable); | 197 | kfree(rtable); |
193 | return 0; | 198 | return 0; |
194 | } | ||
195 | } | 199 | } |
196 | } | 200 | } |
197 | 201 | ||
diff --git a/drivers/pci/htirq.c b/drivers/pci/htirq.c index 6808d8333ecc..737a1c44b07a 100644 --- a/drivers/pci/htirq.c +++ b/drivers/pci/htirq.c | |||
@@ -98,6 +98,7 @@ int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update) | |||
98 | int max_irq; | 98 | int max_irq; |
99 | int pos; | 99 | int pos; |
100 | int irq; | 100 | int irq; |
101 | int node; | ||
101 | 102 | ||
102 | pos = pci_find_ht_capability(dev, HT_CAPTYPE_IRQ); | 103 | pos = pci_find_ht_capability(dev, HT_CAPTYPE_IRQ); |
103 | if (!pos) | 104 | if (!pos) |
@@ -125,7 +126,8 @@ int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update) | |||
125 | cfg->msg.address_lo = 0xffffffff; | 126 | cfg->msg.address_lo = 0xffffffff; |
126 | cfg->msg.address_hi = 0xffffffff; | 127 | cfg->msg.address_hi = 0xffffffff; |
127 | 128 | ||
128 | irq = create_irq(); | 129 | node = dev_to_node(&dev->dev); |
130 | irq = create_irq_nr(0, node); | ||
129 | 131 | ||
130 | if (irq <= 0) { | 132 | if (irq <= 0) { |
131 | kfree(cfg); | 133 | kfree(cfg); |
diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c index 842039e4955b..3a0cb0bb0593 100644 --- a/drivers/pci/intr_remapping.c +++ b/drivers/pci/intr_remapping.c | |||
@@ -31,15 +31,12 @@ struct irq_2_iommu { | |||
31 | }; | 31 | }; |
32 | 32 | ||
33 | #ifdef CONFIG_GENERIC_HARDIRQS | 33 | #ifdef CONFIG_GENERIC_HARDIRQS |
34 | static struct irq_2_iommu *get_one_free_irq_2_iommu(int cpu) | 34 | static struct irq_2_iommu *get_one_free_irq_2_iommu(int node) |
35 | { | 35 | { |
36 | struct irq_2_iommu *iommu; | 36 | struct irq_2_iommu *iommu; |
37 | int node; | ||
38 | |||
39 | node = cpu_to_node(cpu); | ||
40 | 37 | ||
41 | iommu = kzalloc_node(sizeof(*iommu), GFP_ATOMIC, node); | 38 | iommu = kzalloc_node(sizeof(*iommu), GFP_ATOMIC, node); |
42 | printk(KERN_DEBUG "alloc irq_2_iommu on cpu %d node %d\n", cpu, node); | 39 | printk(KERN_DEBUG "alloc irq_2_iommu on node %d\n", node); |
43 | 40 | ||
44 | return iommu; | 41 | return iommu; |
45 | } | 42 | } |
@@ -56,7 +53,7 @@ static struct irq_2_iommu *irq_2_iommu(unsigned int irq) | |||
56 | return desc->irq_2_iommu; | 53 | return desc->irq_2_iommu; |
57 | } | 54 | } |
58 | 55 | ||
59 | static struct irq_2_iommu *irq_2_iommu_alloc_cpu(unsigned int irq, int cpu) | 56 | static struct irq_2_iommu *irq_2_iommu_alloc_node(unsigned int irq, int node) |
60 | { | 57 | { |
61 | struct irq_desc *desc; | 58 | struct irq_desc *desc; |
62 | struct irq_2_iommu *irq_iommu; | 59 | struct irq_2_iommu *irq_iommu; |
@@ -64,7 +61,7 @@ static struct irq_2_iommu *irq_2_iommu_alloc_cpu(unsigned int irq, int cpu) | |||
64 | /* | 61 | /* |
65 | * alloc irq desc if not allocated already. | 62 | * alloc irq desc if not allocated already. |
66 | */ | 63 | */ |
67 | desc = irq_to_desc_alloc_cpu(irq, cpu); | 64 | desc = irq_to_desc_alloc_node(irq, node); |
68 | if (!desc) { | 65 | if (!desc) { |
69 | printk(KERN_INFO "can not get irq_desc for %d\n", irq); | 66 | printk(KERN_INFO "can not get irq_desc for %d\n", irq); |
70 | return NULL; | 67 | return NULL; |
@@ -73,14 +70,14 @@ static struct irq_2_iommu *irq_2_iommu_alloc_cpu(unsigned int irq, int cpu) | |||
73 | irq_iommu = desc->irq_2_iommu; | 70 | irq_iommu = desc->irq_2_iommu; |
74 | 71 | ||
75 | if (!irq_iommu) | 72 | if (!irq_iommu) |
76 | desc->irq_2_iommu = get_one_free_irq_2_iommu(cpu); | 73 | desc->irq_2_iommu = get_one_free_irq_2_iommu(node); |
77 | 74 | ||
78 | return desc->irq_2_iommu; | 75 | return desc->irq_2_iommu; |
79 | } | 76 | } |
80 | 77 | ||
81 | static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq) | 78 | static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq) |
82 | { | 79 | { |
83 | return irq_2_iommu_alloc_cpu(irq, boot_cpu_id); | 80 | return irq_2_iommu_alloc_node(irq, cpu_to_node(boot_cpu_id)); |
84 | } | 81 | } |
85 | 82 | ||
86 | #else /* !CONFIG_SPARSE_IRQ */ | 83 | #else /* !CONFIG_SPARSE_IRQ */ |