Commit 88793c03 authored by Liu Xiang's avatar Liu Xiang Committed by Greg Kroah-Hartman

MIPS: irq: Allocate accurate order pages for irq stack

commit 72faa7a7 upstream.

The irq_pages is the number of pages for irq stack, but not the
order which is needed by __get_free_pages().
We can use get_order() to calculate the accurate order.
Signed-off-by: default avatarLiu Xiang <liu.xiang6@zte.com.cn>
Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
Fixes: fe8bd18f ("MIPS: Introduce irq_stack")
Cc: linux-mips@vger.kernel.org
Cc: stable@vger.kernel.org # v4.11+
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5691b93f
...@@ -52,6 +52,7 @@ asmlinkage void spurious_interrupt(void) ...@@ -52,6 +52,7 @@ asmlinkage void spurious_interrupt(void)
void __init init_IRQ(void) void __init init_IRQ(void)
{ {
int i; int i;
unsigned int order = get_order(IRQ_STACK_SIZE);
for (i = 0; i < NR_IRQS; i++) for (i = 0; i < NR_IRQS; i++)
irq_set_noprobe(i); irq_set_noprobe(i);
...@@ -62,8 +63,7 @@ void __init init_IRQ(void) ...@@ -62,8 +63,7 @@ void __init init_IRQ(void)
arch_init_irq(); arch_init_irq();
for_each_possible_cpu(i) { for_each_possible_cpu(i) {
int irq_pages = IRQ_STACK_SIZE / PAGE_SIZE; void *s = (void *)__get_free_pages(GFP_KERNEL, order);
void *s = (void *)__get_free_pages(GFP_KERNEL, irq_pages);
irq_stack[i] = s; irq_stack[i] = s;
pr_debug("CPU%d IRQ stack at 0x%p - 0x%p\n", i, pr_debug("CPU%d IRQ stack at 0x%p - 0x%p\n", i,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment