Skip to content

Commit 07a1c2d

Browse files
rmullickgregkh
authored andcommitted
irq/core: Fix boot crash when the irqaffinity= boot parameter is passed on CPUMASK_OFFSTACK=y kernels(v1)
commit 10d94ff upstream. 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 <rakib.mullick@gmail.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/20171026045800.27087-1-rakib.mullick@gmail.com Link: http://lkml.kernel.org/r/20171101041451.12581-1-rakib.mullick@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Janne Huttunen <janne.huttunen@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 50b4d98 commit 07a1c2d

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)