blob: 63b33675848b01f77ef713b6224590f2a055a8b3 [file] [log] [blame]
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -07001/*
2 * This module supports the iSeries PCI bus interrupt handling
3 * Copyright (C) 20yy <Robert L Holtorf> <IBM Corp>
Stephen Rothwell89ef68f2005-06-21 17:15:50 -07004 * Copyright (C) 2004-2005 IBM Corporation
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -07005 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the:
18 * Free Software Foundation, Inc.,
19 * 59 Temple Place, Suite 330,
20 * Boston, MA 02111-1307 USA
21 *
22 * Change Activity:
23 * Created, December 13, 2000 by Wayne Holm
24 * End Change Activity
25 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070026#include <linux/pci.h>
27#include <linux/init.h>
28#include <linux/threads.h>
29#include <linux/smp.h>
30#include <linux/param.h>
31#include <linux/string.h>
32#include <linux/bootmem.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070033#include <linux/irq.h>
34#include <linux/spinlock.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
Stephen Rothwelle1995002005-11-16 18:53:29 +110036#include <asm/paca.h>
Kelly Daly1ec65d72005-11-02 13:46:07 +110037#include <asm/iseries/hv_types.h>
Kelly Dalye45423e2005-11-02 12:08:31 +110038#include <asm/iseries/hv_lp_event.h>
Kelly Daly8021b8a2005-11-02 11:41:12 +110039#include <asm/iseries/hv_call_xm.h>
Stephen Rothwelle1995002005-11-16 18:53:29 +110040#include <asm/iseries/it_lp_queue.h>
Stephen Rothwellb08567cb2005-09-28 23:37:01 +100041
42#include "irq.h"
Stephen Rothwell0d177df2006-05-19 16:46:28 +100043#include "pci.h"
Stephen Rothwellc6d2ea92005-10-14 17:16:17 +100044#include "call_pci.h"
Stephen Rothwell1224f372006-10-06 13:55:26 +100045#include "smp.h"
Stephen Rothwelle1995002005-11-16 18:53:29 +110046
Stephen Rothwellee2cdec2006-01-12 13:54:20 +110047#ifdef CONFIG_PCI
48
Stephen Rothwell60798c6a2005-11-16 17:47:43 +110049enum pci_event_type {
50 pe_bus_created = 0, /* PHB has been created */
51 pe_bus_error = 1, /* PHB has failed */
52 pe_bus_failed = 2, /* Msg to Secondary, Primary failed bus */
53 pe_node_failed = 4, /* Multi-adapter bridge has failed */
54 pe_node_recovered = 5, /* Multi-adapter bridge has recovered */
55 pe_bus_recovered = 12, /* PHB has been recovered */
56 pe_unquiese_bus = 18, /* Secondary bus unqiescing */
57 pe_bridge_error = 21, /* Bridge Error */
58 pe_slot_interrupt = 22 /* Slot interrupt */
Stephen Rothwell89ef68f2005-06-21 17:15:50 -070059};
60
Stephen Rothwell60798c6a2005-11-16 17:47:43 +110061struct pci_event {
62 struct HvLpEvent event;
Stephen Rothwell89ef68f2005-06-21 17:15:50 -070063 union {
Stephen Rothwell60798c6a2005-11-16 17:47:43 +110064 u64 __align; /* Align on an 8-byte boundary */
Stephen Rothwell89ef68f2005-06-21 17:15:50 -070065 struct {
66 u32 fisr;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +110067 HvBusNumber bus_number;
68 HvSubBusNumber sub_bus_number;
69 HvAgentId dev_id;
70 } slot;
71 struct {
72 HvBusNumber bus_number;
73 HvSubBusNumber sub_bus_number;
74 } bus;
75 struct {
76 HvBusNumber bus_number;
77 HvSubBusNumber sub_bus_number;
78 HvAgentId dev_id;
79 } node;
80 } data;
Stephen Rothwell89ef68f2005-06-21 17:15:50 -070081};
82
Stephen Rothwell1d7a6b92005-11-17 18:04:37 +110083static DEFINE_SPINLOCK(pending_irqs_lock);
84static int num_pending_irqs;
85static int pending_irqs[NR_IRQS];
86
Olaf Hering35a84c22006-10-07 22:08:26 +100087static void int_received(struct pci_event *event)
Stephen Rothwell89ef68f2005-06-21 17:15:50 -070088{
89 int irq;
90
Stephen Rothwell60798c6a2005-11-16 17:47:43 +110091 switch (event->event.xSubtype) {
92 case pe_slot_interrupt:
93 irq = event->event.xCorrelationToken;
Stephen Rothwell1d7a6b92005-11-17 18:04:37 +110094 if (irq < NR_IRQS) {
95 spin_lock(&pending_irqs_lock);
96 pending_irqs[irq]++;
97 num_pending_irqs++;
98 spin_unlock(&pending_irqs_lock);
99 } else {
100 printk(KERN_WARNING "int_received: bad irq number %d\n",
101 irq);
102 HvCallPci_eoi(event->data.slot.bus_number,
103 event->data.slot.sub_bus_number,
104 event->data.slot.dev_id);
105 }
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700106 break;
107 /* Ignore error recovery events for now */
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100108 case pe_bus_created:
109 printk(KERN_INFO "int_received: system bus %d created\n",
110 event->data.bus.bus_number);
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700111 break;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100112 case pe_bus_error:
113 case pe_bus_failed:
114 printk(KERN_INFO "int_received: system bus %d failed\n",
115 event->data.bus.bus_number);
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700116 break;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100117 case pe_bus_recovered:
118 case pe_unquiese_bus:
119 printk(KERN_INFO "int_received: system bus %d recovered\n",
120 event->data.bus.bus_number);
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700121 break;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100122 case pe_node_failed:
123 case pe_bridge_error:
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700124 printk(KERN_INFO
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100125 "int_received: multi-adapter bridge %d/%d/%d failed\n",
126 event->data.node.bus_number,
127 event->data.node.sub_bus_number,
128 event->data.node.dev_id);
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700129 break;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100130 case pe_node_recovered:
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700131 printk(KERN_INFO
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100132 "int_received: multi-adapter bridge %d/%d/%d recovered\n",
133 event->data.node.bus_number,
134 event->data.node.sub_bus_number,
135 event->data.node.dev_id);
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700136 break;
137 default:
138 printk(KERN_ERR
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100139 "int_received: unrecognized event subtype 0x%x\n",
140 event->event.xSubtype);
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700141 break;
142 }
143}
144
Olaf Hering35a84c22006-10-07 22:08:26 +1000145static void pci_event_handler(struct HvLpEvent *event)
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700146{
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100147 if (event && (event->xType == HvLpEvent_Type_PciIo)) {
Stephen Rothwell677f8c02006-01-12 13:47:43 +1100148 if (hvlpevent_is_int(event))
Olaf Hering35a84c22006-10-07 22:08:26 +1000149 int_received((struct pci_event *)event);
Stephen Rothwell677f8c02006-01-12 13:47:43 +1100150 else
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700151 printk(KERN_ERR
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100152 "pci_event_handler: unexpected ack received\n");
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100153 } else if (event)
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700154 printk(KERN_ERR
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100155 "pci_event_handler: Unrecognized PCI event type 0x%x\n",
156 (int)event->xType);
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700157 else
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100158 printk(KERN_ERR "pci_event_handler: NULL event received\n");
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700159}
160
Stephen Rothwell853f8282005-11-16 18:10:40 +1100161#define REAL_IRQ_TO_SUBBUS(irq) (((irq) >> 14) & 0xff)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700162#define REAL_IRQ_TO_BUS(irq) ((((irq) >> 6) & 0xff) + 1)
163#define REAL_IRQ_TO_IDSEL(irq) ((((irq) >> 3) & 7) + 1)
164#define REAL_IRQ_TO_FUNC(irq) ((irq) & 7)
165
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700166/*
167 * This will be called by device drivers (via enable_IRQ)
168 * to enable INTA in the bridge interrupt status register.
169 */
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100170static void iseries_enable_IRQ(unsigned int irq)
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700171{
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100172 u32 bus, dev_id, function, mask;
173 const u32 sub_bus = 0;
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000174 unsigned int rirq = (unsigned int)irq_map[irq].hwirq;
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700175
176 /* The IRQ has already been locked by the caller */
177 bus = REAL_IRQ_TO_BUS(rirq);
178 function = REAL_IRQ_TO_FUNC(rirq);
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100179 dev_id = (REAL_IRQ_TO_IDSEL(rirq) << 4) + function;
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700180
181 /* Unmask secondary INTA */
182 mask = 0x80000000;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100183 HvCallPci_unmaskInterrupts(bus, sub_bus, dev_id, mask);
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700184}
185
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100186/* This is called by iseries_activate_IRQs */
187static unsigned int iseries_startup_IRQ(unsigned int irq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188{
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100189 u32 bus, dev_id, function, mask;
190 const u32 sub_bus = 0;
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000191 unsigned int rirq = (unsigned int)irq_map[irq].hwirq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192
193 bus = REAL_IRQ_TO_BUS(rirq);
194 function = REAL_IRQ_TO_FUNC(rirq);
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100195 dev_id = (REAL_IRQ_TO_IDSEL(rirq) << 4) + function;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196
197 /* Link the IRQ number to the bridge */
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100198 HvCallXm_connectBusUnit(bus, sub_bus, dev_id, irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199
200 /* Unmask bridge interrupts in the FISR */
201 mask = 0x01010000 << function;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100202 HvCallPci_unmaskFisr(bus, sub_bus, dev_id, mask);
203 iseries_enable_IRQ(irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700204 return 0;
205}
206
207/*
208 * This is called out of iSeries_fixup to activate interrupt
209 * generation for usable slots
210 */
211void __init iSeries_activate_IRQs()
212{
213 int irq;
214 unsigned long flags;
215
216 for_each_irq (irq) {
217 irq_desc_t *desc = get_irq_desc(irq);
218
Ingo Molnard1bef4e2006-06-29 02:24:36 -0700219 if (desc && desc->chip && desc->chip->startup) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220 spin_lock_irqsave(&desc->lock, flags);
Ingo Molnard1bef4e2006-06-29 02:24:36 -0700221 desc->chip->startup(irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700222 spin_unlock_irqrestore(&desc->lock, flags);
223 }
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700224 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225}
226
227/* this is not called anywhere currently */
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100228static void iseries_shutdown_IRQ(unsigned int irq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700229{
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100230 u32 bus, dev_id, function, mask;
231 const u32 sub_bus = 0;
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000232 unsigned int rirq = (unsigned int)irq_map[irq].hwirq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700233
234 /* irq should be locked by the caller */
235 bus = REAL_IRQ_TO_BUS(rirq);
236 function = REAL_IRQ_TO_FUNC(rirq);
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100237 dev_id = (REAL_IRQ_TO_IDSEL(rirq) << 4) + function;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238
239 /* Invalidate the IRQ number in the bridge */
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100240 HvCallXm_connectBusUnit(bus, sub_bus, dev_id, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700241
242 /* Mask bridge interrupts in the FISR */
243 mask = 0x01010000 << function;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100244 HvCallPci_maskFisr(bus, sub_bus, dev_id, mask);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700245}
246
247/*
248 * This will be called by device drivers (via disable_IRQ)
249 * to disable INTA in the bridge interrupt status register.
250 */
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100251static void iseries_disable_IRQ(unsigned int irq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700252{
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100253 u32 bus, dev_id, function, mask;
254 const u32 sub_bus = 0;
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000255 unsigned int rirq = (unsigned int)irq_map[irq].hwirq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256
257 /* The IRQ has already been locked by the caller */
258 bus = REAL_IRQ_TO_BUS(rirq);
259 function = REAL_IRQ_TO_FUNC(rirq);
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100260 dev_id = (REAL_IRQ_TO_IDSEL(rirq) << 4) + function;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700261
262 /* Mask secondary INTA */
263 mask = 0x80000000;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100264 HvCallPci_maskInterrupts(bus, sub_bus, dev_id, mask);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700265}
266
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100267static void iseries_end_IRQ(unsigned int irq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700268{
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000269 unsigned int rirq = (unsigned int)irq_map[irq].hwirq;
Stephen Rothwell853f8282005-11-16 18:10:40 +1100270
271 HvCallPci_eoi(REAL_IRQ_TO_BUS(rirq), REAL_IRQ_TO_SUBBUS(rirq),
272 (REAL_IRQ_TO_IDSEL(rirq) << 4) + REAL_IRQ_TO_FUNC(rirq));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700273}
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700274
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000275static struct irq_chip iseries_pic = {
276 .typename = "iSeries irq controller",
277 .startup = iseries_startup_IRQ,
278 .shutdown = iseries_shutdown_IRQ,
279 .unmask = iseries_enable_IRQ,
280 .mask = iseries_disable_IRQ,
281 .eoi = iseries_end_IRQ
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700282};
283
284/*
285 * This is called out of iSeries_scan_slot to allocate an IRQ for an EADS slot
286 * It calculates the irq value for the slot.
Stephen Rothwell853f8282005-11-16 18:10:40 +1100287 * Note that sub_bus is always 0 (at the moment at least).
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700288 */
Stephen Rothwell853f8282005-11-16 18:10:40 +1100289int __init iSeries_allocate_IRQ(HvBusNumber bus,
Stephen Rothwell0d177df2006-05-19 16:46:28 +1000290 HvSubBusNumber sub_bus, u32 bsubbus)
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700291{
Stephen Rothwelld9ae2ba2005-11-10 18:11:19 +1100292 unsigned int realirq;
Stephen Rothwell0d177df2006-05-19 16:46:28 +1000293 u8 idsel = ISERIES_GET_DEVICE_FROM_SUBBUS(bsubbus);
294 u8 function = ISERIES_GET_FUNCTION_FROM_SUBBUS(bsubbus);
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700295
Stephen Rothwell853f8282005-11-16 18:10:40 +1100296 realirq = (((((sub_bus << 8) + (bus - 1)) << 3) + (idsel - 1)) << 3)
297 + function;
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000298
Benjamin Herrenschmidt6e99e452006-07-10 04:44:42 -0700299 return irq_create_mapping(NULL, realirq);
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700300}
Stephen Rothwelle1995002005-11-16 18:53:29 +1100301
Stephen Rothwellee2cdec2006-01-12 13:54:20 +1100302#endif /* CONFIG_PCI */
303
Stephen Rothwelle1995002005-11-16 18:53:29 +1100304/*
305 * Get the next pending IRQ.
306 */
Olaf Hering35a84c22006-10-07 22:08:26 +1000307unsigned int iSeries_get_irq(void)
Stephen Rothwelle1995002005-11-16 18:53:29 +1100308{
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000309 int irq = NO_IRQ_IGNORE;
Stephen Rothwelle1995002005-11-16 18:53:29 +1100310
Stephen Rothwelle1995002005-11-16 18:53:29 +1100311#ifdef CONFIG_SMP
David Gibson3356bb9f72006-01-13 10:26:42 +1100312 if (get_lppaca()->int_dword.fields.ipi_cnt) {
313 get_lppaca()->int_dword.fields.ipi_cnt = 0;
Stephen Rothwell1224f372006-10-06 13:55:26 +1000314 iSeries_smp_message_recv();
Stephen Rothwelle1995002005-11-16 18:53:29 +1100315 }
316#endif /* CONFIG_SMP */
317 if (hvlpevent_is_pending())
Olaf Hering35a84c22006-10-07 22:08:26 +1000318 process_hvlpevents();
Stephen Rothwelle1995002005-11-16 18:53:29 +1100319
Stephen Rothwellee2cdec2006-01-12 13:54:20 +1100320#ifdef CONFIG_PCI
Stephen Rothwell1d7a6b92005-11-17 18:04:37 +1100321 if (num_pending_irqs) {
322 spin_lock(&pending_irqs_lock);
323 for (irq = 0; irq < NR_IRQS; irq++) {
324 if (pending_irqs[irq]) {
325 pending_irqs[irq]--;
326 num_pending_irqs--;
327 break;
328 }
329 }
330 spin_unlock(&pending_irqs_lock);
331 if (irq >= NR_IRQS)
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000332 irq = NO_IRQ_IGNORE;
Stephen Rothwell1d7a6b92005-11-17 18:04:37 +1100333 }
Stephen Rothwellee2cdec2006-01-12 13:54:20 +1100334#endif
Stephen Rothwell1d7a6b92005-11-17 18:04:37 +1100335
336 return irq;
Stephen Rothwelle1995002005-11-16 18:53:29 +1100337}
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000338
Stephen Rothwellbe9e95b2007-03-04 17:03:48 +1100339#ifdef CONFIG_PCI
340
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000341static int iseries_irq_host_map(struct irq_host *h, unsigned int virq,
Benjamin Herrenschmidt6e99e452006-07-10 04:44:42 -0700342 irq_hw_number_t hw)
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000343{
344 set_irq_chip_and_handler(virq, &iseries_pic, handle_fasteoi_irq);
345
346 return 0;
347}
348
349static struct irq_host_ops iseries_irq_host_ops = {
350 .map = iseries_irq_host_map,
351};
352
353/*
354 * This is called by init_IRQ. set in ppc_md.init_IRQ by iSeries_setup.c
355 * It must be called before the bus walk.
356 */
357void __init iSeries_init_IRQ(void)
358{
359 /* Register PCI event handler and open an event path */
360 struct irq_host *host;
361 int ret;
362
363 /*
364 * The Hypervisor only allows us up to 256 interrupt
365 * sources (the irq number is passed in a u8).
366 */
367 irq_set_virq_count(256);
368
369 /* Create irq host. No need for a revmap since HV will give us
370 * back our virtual irq number
371 */
372 host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, 0, &iseries_irq_host_ops, 0);
373 BUG_ON(host == NULL);
374 irq_set_default_host(host);
375
376 ret = HvLpEvent_registerHandler(HvLpEvent_Type_PciIo,
377 &pci_event_handler);
378 if (ret == 0) {
379 ret = HvLpEvent_openPath(HvLpEvent_Type_PciIo, 0);
380 if (ret != 0)
381 printk(KERN_ERR "iseries_init_IRQ: open event path "
382 "failed with rc 0x%x\n", ret);
383 } else
384 printk(KERN_ERR "iseries_init_IRQ: register handler "
385 "failed with rc 0x%x\n", ret);
386}
387
Stephen Rothwellbe9e95b2007-03-04 17:03:48 +1100388#endif /* CONFIG_PCI */