Skip to content

Commit 8d0ea29

Browse files
hmynenimpe
authored andcommitted
powerpc/xive: Define xive_native_alloc_irq_on_chip()
This function allocates IRQ on a specific chip. VAS needs per chip IRQ allocation and will have IRQ handler per VAS instance. Signed-off-by: Haren Myneni <haren@linux.ibm.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/1587016720.2275.1047.camel@hbabu-laptop
1 parent ae83d0b commit 8d0ea29

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

‎arch/powerpc/include/asm/xive.h‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#ifndef _ASM_POWERPC_XIVE_H
66
#define _ASM_POWERPC_XIVE_H
77

8+
#include <asm/opal-api.h>
9+
810
#define XIVE_INVALID_VP 0xffffffff
911

1012
#ifdef CONFIG_PPC_XIVE
@@ -108,7 +110,6 @@ void xive_native_free_vp_block(u32 vp_base);
108110
int xive_native_populate_irq_data(u32 hw_irq,
109111
struct xive_irq_data *data);
110112
void xive_cleanup_irq_data(struct xive_irq_data *xd);
111-
u32 xive_native_alloc_irq(void);
112113
void xive_native_free_irq(u32 irq);
113114
int xive_native_configure_irq(u32 hw_irq, u32 target, u8 prio, u32 sw_irq);
114115

@@ -137,6 +138,12 @@ int xive_native_set_queue_state(u32 vp_id, uint32_t prio, u32 qtoggle,
137138
u32 qindex);
138139
int xive_native_get_vp_state(u32 vp_id, u64 *out_state);
139140
bool xive_native_has_queue_state_support(void);
141+
extern u32 xive_native_alloc_irq_on_chip(u32 chip_id);
142+
143+
static inline u32 xive_native_alloc_irq(void)
144+
{
145+
return xive_native_alloc_irq_on_chip(OPAL_XIVE_ANY_CHIP);
146+
}
140147

141148
#else
142149

‎arch/powerpc/sysdev/xive/native.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,12 @@ static int xive_native_get_ipi(unsigned int cpu, struct xive_cpu *xc)
280280
}
281281
#endif /* CONFIG_SMP */
282282

283-
u32 xive_native_alloc_irq(void)
283+
u32 xive_native_alloc_irq_on_chip(u32 chip_id)
284284
{
285285
s64 rc;
286286

287287
for (;;) {
288-
rc = opal_xive_allocate_irq(OPAL_XIVE_ANY_CHIP);
288+
rc = opal_xive_allocate_irq(chip_id);
289289
if (rc != OPAL_BUSY)
290290
break;
291291
msleep(OPAL_BUSY_DELAY_MS);
@@ -294,7 +294,7 @@ u32 xive_native_alloc_irq(void)
294294
return 0;
295295
return rc;
296296
}
297-
EXPORT_SYMBOL_GPL(xive_native_alloc_irq);
297+
EXPORT_SYMBOL_GPL(xive_native_alloc_irq_on_chip);
298298

299299
void xive_native_free_irq(u32 irq)
300300
{

0 commit comments

Comments
 (0)