blob: 9f9972bc69ebd31e24e9828b1232d2366f457f2e [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>
33#include <linux/ide.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070034#include <linux/irq.h>
35#include <linux/spinlock.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070036
Stephen Rothwelle1995002005-11-16 18:53:29 +110037#include <asm/paca.h>
Kelly Daly1ec65d72005-11-02 13:46:07 +110038#include <asm/iseries/hv_types.h>
Kelly Dalye45423e2005-11-02 12:08:31 +110039#include <asm/iseries/hv_lp_event.h>
Kelly Daly8021b8a2005-11-02 11:41:12 +110040#include <asm/iseries/hv_call_xm.h>
Stephen Rothwelle1995002005-11-16 18:53:29 +110041#include <asm/iseries/it_lp_queue.h>
Stephen Rothwellb08567cb2005-09-28 23:37:01 +100042
43#include "irq.h"
Stephen Rothwell0d177df2006-05-19 16:46:28 +100044#include "pci.h"
Stephen Rothwellc6d2ea92005-10-14 17:16:17 +100045#include "call_pci.h"
Stephen Rothwell1224f372006-10-06 13:55:26 +100046#include "smp.h"
Stephen Rothwelle1995002005-11-16 18:53:29 +110047
Stephen Rothwellee2cdec2006-01-12 13:54:20 +110048#ifdef CONFIG_PCI
49
Stephen Rothwell60798c6a2005-11-16 17:47:43 +110050enum pci_event_type {
51 pe_bus_created = 0, /* PHB has been created */
52 pe_bus_error = 1, /* PHB has failed */
53 pe_bus_failed = 2, /* Msg to Secondary, Primary failed bus */
54 pe_node_failed = 4, /* Multi-adapter bridge has failed */
55 pe_node_recovered = 5, /* Multi-adapter bridge has recovered */
56 pe_bus_recovered = 12, /* PHB has been recovered */
57 pe_unquiese_bus = 18, /* Secondary bus unqiescing */
58 pe_bridge_error = 21, /* Bridge Error */
59 pe_slot_interrupt = 22 /* Slot interrupt */
Stephen Rothwell89ef68f2005-06-21 17:15:50 -070060};
61
Stephen Rothwell60798c6a2005-11-16 17:47:43 +110062struct pci_event {
63 struct HvLpEvent event;
Stephen Rothwell89ef68f2005-06-21 17:15:50 -070064 union {
Stephen Rothwell60798c6a2005-11-16 17:47:43 +110065 u64 __align; /* Align on an 8-byte boundary */
Stephen Rothwell89ef68f2005-06-21 17:15:50 -070066 struct {
67 u32 fisr;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +110068 HvBusNumber bus_number;
69 HvSubBusNumber sub_bus_number;
70 HvAgentId dev_id;
71 } slot;
72 struct {
73 HvBusNumber bus_number;
74 HvSubBusNumber sub_bus_number;
75 } bus;
76 struct {
77 HvBusNumber bus_number;
78 HvSubBusNumber sub_bus_number;
79 HvAgentId dev_id;
80 } node;
81 } data;
Stephen Rothwell89ef68f2005-06-21 17:15:50 -070082};
83
Stephen Rothwell1d7a6b92005-11-17 18:04:37 +110084static DEFINE_SPINLOCK(pending_irqs_lock);
85static int num_pending_irqs;
86static int pending_irqs[NR_IRQS];
87
Olaf Hering35a84c22006-10-07 22:08:26 +100088static void int_received(struct pci_event *event)
Stephen Rothwell89ef68f2005-06-21 17:15:50 -070089{
90 int irq;
91
Stephen Rothwell60798c6a2005-11-16 17:47:43 +110092 switch (event->event.xSubtype) {
93 case pe_slot_interrupt:
94 irq = event->event.xCorrelationToken;
Stephen Rothwell1d7a6b92005-11-17 18:04:37 +110095 if (irq < NR_IRQS) {
96 spin_lock(&pending_irqs_lock);
97 pending_irqs[irq]++;
98 num_pending_irqs++;
99 spin_unlock(&pending_irqs_lock);
100 } else {
101 printk(KERN_WARNING "int_received: bad irq number %d\n",
102 irq);
103 HvCallPci_eoi(event->data.slot.bus_number,
104 event->data.slot.sub_bus_number,
105 event->data.slot.dev_id);
106 }
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700107 break;
108 /* Ignore error recovery events for now */
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100109 case pe_bus_created:
110 printk(KERN_INFO "int_received: system bus %d created\n",
111 event->data.bus.bus_number);
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700112 break;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100113 case pe_bus_error:
114 case pe_bus_failed:
115 printk(KERN_INFO "int_received: system bus %d failed\n",
116 event->data.bus.bus_number);
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700117 break;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100118 case pe_bus_recovered:
119 case pe_unquiese_bus:
120 printk(KERN_INFO "int_received: system bus %d recovered\n",
121 event->data.bus.bus_number);
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700122 break;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100123 case pe_node_failed:
124 case pe_bridge_error:
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700125 printk(KERN_INFO
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100126 "int_received: multi-adapter bridge %d/%d/%d failed\n",
127 event->data.node.bus_number,
128 event->data.node.sub_bus_number,
129 event->data.node.dev_id);
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700130 break;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100131 case pe_node_recovered:
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700132 printk(KERN_INFO
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100133 "int_received: multi-adapter bridge %d/%d/%d recovered\n",
134 event->data.node.bus_number,
135 event->data.node.sub_bus_number,
136 event->data.node.dev_id);
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700137 break;
138 default:
139 printk(KERN_ERR
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100140 "int_received: unrecognized event subtype 0x%x\n",
141 event->event.xSubtype);
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700142 break;
143 }
144}
145
Olaf Hering35a84c22006-10-07 22:08:26 +1000146static void pci_event_handler(struct HvLpEvent *event)
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700147{
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100148 if (event && (event->xType == HvLpEvent_Type_PciIo)) {
Stephen Rothwell677f8c02006-01-12 13:47:43 +1100149 if (hvlpevent_is_int(event))
Olaf Hering35a84c22006-10-07 22:08:26 +1000150 int_received((struct pci_event *)event);
Stephen Rothwell677f8c02006-01-12 13:47:43 +1100151 else
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700152 printk(KERN_ERR
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100153 "pci_event_handler: unexpected ack received\n");
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100154 } else if (event)
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700155 printk(KERN_ERR
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100156 "pci_event_handler: Unrecognized PCI event type 0x%x\n",
157 (int)event->xType);
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700158 else
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100159 printk(KERN_ERR "pci_event_handler: NULL event received\n");
Stephen Rothwell89ef68f2005-06-21 17:15:50 -0700160}
161
Stephen Rothwell853f8282005-11-16 18:10:40 +1100162#define REAL_IRQ_TO_SUBBUS(irq) (((irq) >> 14) & 0xff)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163#define REAL_IRQ_TO_BUS(irq) ((((irq) >> 6) & 0xff) + 1)
164#define REAL_IRQ_TO_IDSEL(irq) ((((irq) >> 3) & 7) + 1)
165#define REAL_IRQ_TO_FUNC(irq) ((irq) & 7)
166
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700167/*
168 * This will be called by device drivers (via enable_IRQ)
169 * to enable INTA in the bridge interrupt status register.
170 */
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100171static void iseries_enable_IRQ(unsigned int irq)
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700172{
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100173 u32 bus, dev_id, function, mask;
174 const u32 sub_bus = 0;
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000175 unsigned int rirq = (unsigned int)irq_map[irq].hwirq;
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700176
177 /* The IRQ has already been locked by the caller */
178 bus = REAL_IRQ_TO_BUS(rirq);
179 function = REAL_IRQ_TO_FUNC(rirq);
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100180 dev_id = (REAL_IRQ_TO_IDSEL(rirq) << 4) + function;
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700181
182 /* Unmask secondary INTA */
183 mask = 0x80000000;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100184 HvCallPci_unmaskInterrupts(bus, sub_bus, dev_id, mask);
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700185}
186
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100187/* This is called by iseries_activate_IRQs */
188static unsigned int iseries_startup_IRQ(unsigned int irq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189{
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100190 u32 bus, dev_id, function, mask;
191 const u32 sub_bus = 0;
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000192 unsigned int rirq = (unsigned int)irq_map[irq].hwirq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700193
194 bus = REAL_IRQ_TO_BUS(rirq);
195 function = REAL_IRQ_TO_FUNC(rirq);
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100196 dev_id = (REAL_IRQ_TO_IDSEL(rirq) << 4) + function;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197
198 /* Link the IRQ number to the bridge */
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100199 HvCallXm_connectBusUnit(bus, sub_bus, dev_id, irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700200
201 /* Unmask bridge interrupts in the FISR */
202 mask = 0x01010000 << function;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100203 HvCallPci_unmaskFisr(bus, sub_bus, dev_id, mask);
204 iseries_enable_IRQ(irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205 return 0;
206}
207
208/*
209 * This is called out of iSeries_fixup to activate interrupt
210 * generation for usable slots
211 */
212void __init iSeries_activate_IRQs()
213{
214 int irq;
215 unsigned long flags;
216
217 for_each_irq (irq) {
218 irq_desc_t *desc = get_irq_desc(irq);
219
Ingo Molnard1bef4e2006-06-29 02:24:36 -0700220 if (desc && desc->chip && desc->chip->startup) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700221 spin_lock_irqsave(&desc->lock, flags);
Ingo Molnard1bef4e2006-06-29 02:24:36 -0700222 desc->chip->startup(irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700223 spin_unlock_irqrestore(&desc->lock, flags);
224 }
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700225 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700226}
227
228/* this is not called anywhere currently */
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100229static void iseries_shutdown_IRQ(unsigned int irq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700230{
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100231 u32 bus, dev_id, function, mask;
232 const u32 sub_bus = 0;
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000233 unsigned int rirq = (unsigned int)irq_map[irq].hwirq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700234
235 /* irq should be locked by the caller */
236 bus = REAL_IRQ_TO_BUS(rirq);
237 function = REAL_IRQ_TO_FUNC(rirq);
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100238 dev_id = (REAL_IRQ_TO_IDSEL(rirq) << 4) + function;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239
240 /* Invalidate the IRQ number in the bridge */
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100241 HvCallXm_connectBusUnit(bus, sub_bus, dev_id, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242
243 /* Mask bridge interrupts in the FISR */
244 mask = 0x01010000 << function;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100245 HvCallPci_maskFisr(bus, sub_bus, dev_id, mask);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246}
247
248/*
249 * This will be called by device drivers (via disable_IRQ)
250 * to disable INTA in the bridge interrupt status register.
251 */
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100252static void iseries_disable_IRQ(unsigned int irq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700253{
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100254 u32 bus, dev_id, function, mask;
255 const u32 sub_bus = 0;
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000256 unsigned int rirq = (unsigned int)irq_map[irq].hwirq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700257
258 /* The IRQ has already been locked by the caller */
259 bus = REAL_IRQ_TO_BUS(rirq);
260 function = REAL_IRQ_TO_FUNC(rirq);
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100261 dev_id = (REAL_IRQ_TO_IDSEL(rirq) << 4) + function;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700262
263 /* Mask secondary INTA */
264 mask = 0x80000000;
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100265 HvCallPci_maskInterrupts(bus, sub_bus, dev_id, mask);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266}
267
Stephen Rothwell60798c6a2005-11-16 17:47:43 +1100268static void iseries_end_IRQ(unsigned int irq)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700269{
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000270 unsigned int rirq = (unsigned int)irq_map[irq].hwirq;
Stephen Rothwell853f8282005-11-16 18:10:40 +1100271
272 HvCallPci_eoi(REAL_IRQ_TO_BUS(rirq), REAL_IRQ_TO_SUBBUS(rirq),
273 (REAL_IRQ_TO_IDSEL(rirq) << 4) + REAL_IRQ_TO_FUNC(rirq));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700274}
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700275
Benjamin Herrenschmidtb9e5b4e2006-07-03 19:32:51 +1000276static struct irq_chip iseries_pic = {
277 .typename = "iSeries irq controller",
278 .startup = iseries_startup_IRQ,
279 .shutdown = iseries_shutdown_IRQ,
280 .unmask = iseries_enable_IRQ,
281 .mask = iseries_disable_IRQ,
282 .eoi = iseries_end_IRQ
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700283};
284
285/*
286 * This is called out of iSeries_scan_slot to allocate an IRQ for an EADS slot
287 * It calculates the irq value for the slot.
Stephen Rothwell853f8282005-11-16 18:10:40 +1100288 * Note that sub_bus is always 0 (at the moment at least).
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700289 */
Stephen Rothwell853f8282005-11-16 18:10:40 +1100290int __init iSeries_allocate_IRQ(HvBusNumber bus,
Stephen Rothwell0d177df2006-05-19 16:46:28 +1000291 HvSubBusNumber sub_bus, u32 bsubbus)
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700292{
Stephen Rothwelld9ae2ba2005-11-10 18:11:19 +1100293 unsigned int realirq;
Stephen Rothwell0d177df2006-05-19 16:46:28 +1000294 u8 idsel = ISERIES_GET_DEVICE_FROM_SUBBUS(bsubbus);
295 u8 function = ISERIES_GET_FUNCTION_FROM_SUBBUS(bsubbus);
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700296
Stephen Rothwell853f8282005-11-16 18:10:40 +1100297 realirq = (((((sub_bus << 8) + (bus - 1)) << 3) + (idsel - 1)) << 3)
298 + function;
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000299
Benjamin Herrenschmidt6e99e452006-07-10 04:44:42 -0700300 return irq_create_mapping(NULL, realirq);
Stephen Rothwell0c3b4f12005-06-21 17:15:49 -0700301}
Stephen Rothwelle1995002005-11-16 18:53:29 +1100302
Stephen Rothwellee2cdec2006-01-12 13:54:20 +1100303#endif /* CONFIG_PCI */
304
Stephen Rothwelle1995002005-11-16 18:53:29 +1100305/*
306 * Get the next pending IRQ.
307 */
Olaf Hering35a84c22006-10-07 22:08:26 +1000308unsigned int iSeries_get_irq(void)
Stephen Rothwelle1995002005-11-16 18:53:29 +1100309{
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000310 int irq = NO_IRQ_IGNORE;
Stephen Rothwelle1995002005-11-16 18:53:29 +1100311
Stephen Rothwelle1995002005-11-16 18:53:29 +1100312#ifdef CONFIG_SMP
David Gibson3356bb9f72006-01-13 10:26:42 +1100313 if (get_lppaca()->int_dword.fields.ipi_cnt) {
314 get_lppaca()->int_dword.fields.ipi_cnt = 0;
Stephen Rothwell1224f372006-10-06 13:55:26 +1000315 iSeries_smp_message_recv();
Stephen Rothwelle1995002005-11-16 18:53:29 +1100316 }
317#endif /* CONFIG_SMP */
318 if (hvlpevent_is_pending())
Olaf Hering35a84c22006-10-07 22:08:26 +1000319 process_hvlpevents();
Stephen Rothwelle1995002005-11-16 18:53:29 +1100320
Stephen Rothwellee2cdec2006-01-12 13:54:20 +1100321#ifdef CONFIG_PCI
Stephen Rothwell1d7a6b92005-11-17 18:04:37 +1100322 if (num_pending_irqs) {
323 spin_lock(&pending_irqs_lock);
324 for (irq = 0; irq < NR_IRQS; irq++) {
325 if (pending_irqs[irq]) {
326 pending_irqs[irq]--;
327 num_pending_irqs--;
328 break;
329 }
330 }
331 spin_unlock(&pending_irqs_lock);
332 if (irq >= NR_IRQS)
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000333 irq = NO_IRQ_IGNORE;
Stephen Rothwell1d7a6b92005-11-17 18:04:37 +1100334 }
Stephen Rothwellee2cdec2006-01-12 13:54:20 +1100335#endif
Stephen Rothwell1d7a6b92005-11-17 18:04:37 +1100336
337 return irq;
Stephen Rothwelle1995002005-11-16 18:53:29 +1100338}
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000339
Stephen Rothwellbe9e95b2007-03-04 17:03:48 +1100340#ifdef CONFIG_PCI
341
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000342static int iseries_irq_host_map(struct irq_host *h, unsigned int virq,
Benjamin Herrenschmidt6e99e452006-07-10 04:44:42 -0700343 irq_hw_number_t hw)
Benjamin Herrenschmidt0ebfff12006-07-03 21:36:01 +1000344{
345 set_irq_chip_and_handler(virq, &iseries_pic, handle_fasteoi_irq);
346
347 return 0;
348}
349
350static struct irq_host_ops iseries_irq_host_ops = {
351 .map = iseries_irq_host_map,
352};
353
354/*
355 * This is called by init_IRQ. set in ppc_md.init_IRQ by iSeries_setup.c
356 * It must be called before the bus walk.
357 */
358void __init iSeries_init_IRQ(void)
359{
360 /* Register PCI event handler and open an event path */
361 struct irq_host *host;
362 int ret;
363
364 /*
365 * The Hypervisor only allows us up to 256 interrupt
366 * sources (the irq number is passed in a u8).
367 */
368 irq_set_virq_count(256);
369
370 /* Create irq host. No need for a revmap since HV will give us
371 * back our virtual irq number
372 */
373 host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, 0, &iseries_irq_host_ops, 0);
374 BUG_ON(host == NULL);
375 irq_set_default_host(host);
376
377 ret = HvLpEvent_registerHandler(HvLpEvent_Type_PciIo,
378 &pci_event_handler);
379 if (ret == 0) {
380 ret = HvLpEvent_openPath(HvLpEvent_Type_PciIo, 0);
381 if (ret != 0)
382 printk(KERN_ERR "iseries_init_IRQ: open event path "
383 "failed with rc 0x%x\n", ret);
384 } else
385 printk(KERN_ERR "iseries_init_IRQ: register handler "
386 "failed with rc 0x%x\n", ret);
387}
388
Stephen Rothwellbe9e95b2007-03-04 17:03:48 +1100389#endif /* CONFIG_PCI */