Skip to content

Commit 10d94ff

Browse files
rmullickIngo Molnar
authored andcommitted
irq/core: Fix boot crash when the irqaffinity= boot parameter is passed on CPUMASK_OFFSTACK=y kernels(v1)
When the irqaffinity= kernel parameter is passed in a CPUMASK_OFFSTACK=y kernel, it fails to boot, because zalloc_cpumask_var() cannot be used before initializing the slab allocator to allocate a cpumask. So, use alloc_bootmem_cpumask_var() instead. Also do some cleanups while at it: in init_irq_default_affinity() remove an #ifdef via using cpumask_available(). Signed-off-by: Rakib Mullick <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 16c0890 commit 10d94ff

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kernel/irq/irqdesc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static struct lock_class_key irq_desc_lock_class;
2727
#if defined(CONFIG_SMP)
2828
static int __init irq_affinity_setup(char *str)
2929
{
30-
zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
30+
alloc_bootmem_cpumask_var(&irq_default_affinity);
3131
cpulist_parse(str, irq_default_affinity);
3232
/*
3333
* Set at least the boot cpu. We don't want to end up with
@@ -40,10 +40,8 @@ __setup("irqaffinity=", irq_affinity_setup);
4040

4141
static void __init init_irq_default_affinity(void)
4242
{
43-
#ifdef CONFIG_CPUMASK_OFFSTACK
44-
if (!irq_default_affinity)
43+
if (!cpumask_available(irq_default_affinity))
4544
zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
46-
#endif
4745
if (cpumask_empty(irq_default_affinity))
4846
cpumask_setall(irq_default_affinity);
4947
}

0 commit comments

Comments
 (0)