aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/iseries/irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/iseries/irq.c')
-rw-r--r--arch/powerpc/platforms/iseries/irq.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c
index ba446bf355a9..4fb96f0b2df6 100644
--- a/arch/powerpc/platforms/iseries/irq.c
+++ b/arch/powerpc/platforms/iseries/irq.c
@@ -167,11 +167,11 @@ static void pci_event_handler(struct HvLpEvent *event)
167 * This will be called by device drivers (via enable_IRQ) 167 * This will be called by device drivers (via enable_IRQ)
168 * to enable INTA in the bridge interrupt status register. 168 * to enable INTA in the bridge interrupt status register.
169 */ 169 */
170static void iseries_enable_IRQ(unsigned int irq) 170static void iseries_enable_IRQ(struct irq_data *d)
171{ 171{
172 u32 bus, dev_id, function, mask; 172 u32 bus, dev_id, function, mask;
173 const u32 sub_bus = 0; 173 const u32 sub_bus = 0;
174 unsigned int rirq = (unsigned int)irq_map[irq].hwirq; 174 unsigned int rirq = (unsigned int)irq_map[d->irq].hwirq;
175 175
176 /* The IRQ has already been locked by the caller */ 176 /* The IRQ has already been locked by the caller */
177 bus = REAL_IRQ_TO_BUS(rirq); 177 bus = REAL_IRQ_TO_BUS(rirq);
@@ -184,23 +184,23 @@ static void iseries_enable_IRQ(unsigned int irq)
184} 184}
185 185
186/* This is called by iseries_activate_IRQs */ 186/* This is called by iseries_activate_IRQs */
187static unsigned int iseries_startup_IRQ(unsigned int irq) 187static unsigned int iseries_startup_IRQ(struct irq_data *d)
188{ 188{
189 u32 bus, dev_id, function, mask; 189 u32 bus, dev_id, function, mask;
190 const u32 sub_bus = 0; 190 const u32 sub_bus = 0;
191 unsigned int rirq = (unsigned int)irq_map[irq].hwirq; 191 unsigned int rirq = (unsigned int)irq_map[d->irq].hwirq;
192 192
193 bus = REAL_IRQ_TO_BUS(rirq); 193 bus = REAL_IRQ_TO_BUS(rirq);
194 function = REAL_IRQ_TO_FUNC(rirq); 194 function = REAL_IRQ_TO_FUNC(rirq);
195 dev_id = (REAL_IRQ_TO_IDSEL(rirq) << 4) + function; 195 dev_id = (REAL_IRQ_TO_IDSEL(rirq) << 4) + function;
196 196
197 /* Link the IRQ number to the bridge */ 197 /* Link the IRQ number to the bridge */
198 HvCallXm_connectBusUnit(bus, sub_bus, dev_id, irq); 198 HvCallXm_connectBusUnit(bus, sub_bus, dev_id, d->irq);
199 199
200 /* Unmask bridge interrupts in the FISR */ 200 /* Unmask bridge interrupts in the FISR */
201 mask = 0x01010000 << function; 201 mask = 0x01010000 << function;
202 HvCallPci_unmaskFisr(bus, sub_bus, dev_id, mask); 202 HvCallPci_unmaskFisr(bus, sub_bus, dev_id, mask);
203 iseries_enable_IRQ(irq); 203 iseries_enable_IRQ(d);
204 return 0; 204 return 0;
205} 205}
206 206
@@ -215,21 +215,26 @@ void __init iSeries_activate_IRQs()
215 215
216 for_each_irq (irq) { 216 for_each_irq (irq) {
217 struct irq_desc *desc = irq_to_desc(irq); 217 struct irq_desc *desc = irq_to_desc(irq);
218 struct irq_chip *chip;
218 219
219 if (desc && desc->chip && desc->chip->startup) { 220 if (!desc)
221 continue;
222
223 chip = get_irq_desc_chip(desc);
224 if (chip && chip->irq_startup) {
220 raw_spin_lock_irqsave(&desc->lock, flags); 225 raw_spin_lock_irqsave(&desc->lock, flags);
221 desc->chip->startup(irq); 226 chip->irq_startup(&desc->irq_data);
222 raw_spin_unlock_irqrestore(&desc->lock, flags); 227 raw_spin_unlock_irqrestore(&desc->lock, flags);
223 } 228 }
224 } 229 }
225} 230}
226 231
227/* this is not called anywhere currently */ 232/* this is not called anywhere currently */
228static void iseries_shutdown_IRQ(unsigned int irq) 233static void iseries_shutdown_IRQ(struct irq_data *d)
229{ 234{
230 u32 bus, dev_id, function, mask; 235 u32 bus, dev_id, function, mask;
231 const u32 sub_bus = 0; 236 const u32 sub_bus = 0;
232 unsigned int rirq = (unsigned int)irq_map[irq].hwirq; 237 unsigned int rirq = (unsigned int)irq_map[d->irq].hwirq;
233 238
234 /* irq should be locked by the caller */ 239 /* irq should be locked by the caller */
235 bus = REAL_IRQ_TO_BUS(rirq); 240 bus = REAL_IRQ_TO_BUS(rirq);
@@ -248,11 +253,11 @@ static void iseries_shutdown_IRQ(unsigned int irq)
248 * This will be called by device drivers (via disable_IRQ) 253 * This will be called by device drivers (via disable_IRQ)
249 * to disable INTA in the bridge interrupt status register. 254 * to disable INTA in the bridge interrupt status register.
250 */ 255 */
251static void iseries_disable_IRQ(unsigned int irq) 256static void iseries_disable_IRQ(struct irq_data *d)
252{ 257{
253 u32 bus, dev_id, function, mask; 258 u32 bus, dev_id, function, mask;
254 const u32 sub_bus = 0; 259 const u32 sub_bus = 0;
255 unsigned int rirq = (unsigned int)irq_map[irq].hwirq; 260 unsigned int rirq = (unsigned int)irq_map[d->irq].hwirq;
256 261
257 /* The IRQ has already been locked by the caller */ 262 /* The IRQ has already been locked by the caller */
258 bus = REAL_IRQ_TO_BUS(rirq); 263 bus = REAL_IRQ_TO_BUS(rirq);
@@ -264,9 +269,9 @@ static void iseries_disable_IRQ(unsigned int irq)
264 HvCallPci_maskInterrupts(bus, sub_bus, dev_id, mask); 269 HvCallPci_maskInterrupts(bus, sub_bus, dev_id, mask);
265} 270}
266 271
267static void iseries_end_IRQ(unsigned int irq) 272static void iseries_end_IRQ(struct irq_data *d)
268{ 273{
269 unsigned int rirq = (unsigned int)irq_map[irq].hwirq; 274 unsigned int rirq = (unsigned int)irq_map[d->irq].hwirq;
270 275
271 HvCallPci_eoi(REAL_IRQ_TO_BUS(rirq), REAL_IRQ_TO_SUBBUS(rirq), 276 HvCallPci_eoi(REAL_IRQ_TO_BUS(rirq), REAL_IRQ_TO_SUBBUS(rirq),
272 (REAL_IRQ_TO_IDSEL(rirq) << 4) + REAL_IRQ_TO_FUNC(rirq)); 277 (REAL_IRQ_TO_IDSEL(rirq) << 4) + REAL_IRQ_TO_FUNC(rirq));
@@ -274,11 +279,11 @@ static void iseries_end_IRQ(unsigned int irq)
274 279
275static struct irq_chip iseries_pic = { 280static struct irq_chip iseries_pic = {
276 .name = "iSeries", 281 .name = "iSeries",
277 .startup = iseries_startup_IRQ, 282 .irq_startup = iseries_startup_IRQ,
278 .shutdown = iseries_shutdown_IRQ, 283 .irq_shutdown = iseries_shutdown_IRQ,
279 .unmask = iseries_enable_IRQ, 284 .irq_unmask = iseries_enable_IRQ,
280 .mask = iseries_disable_IRQ, 285 .irq_mask = iseries_disable_IRQ,
281 .eoi = iseries_end_IRQ 286 .irq_eoi = iseries_end_IRQ
282}; 287};
283 288
284/* 289/*