Skip to content

Commit 72faa7a

Browse files
Liu Xiangpaulburton
authored andcommitted
MIPS: irq: Allocate accurate order pages for irq stack
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: Liu Xiang <[email protected]> Signed-off-by: Paul Burton <[email protected]> Fixes: fe8bd18 ("MIPS: Introduce irq_stack") Cc: [email protected] Cc: [email protected] # v4.11+
1 parent d411da0 commit 72faa7a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/mips/kernel/irq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ asmlinkage void spurious_interrupt(void)
5252
void __init init_IRQ(void)
5353
{
5454
int i;
55+
unsigned int order = get_order(IRQ_STACK_SIZE);
5556

5657
for (i = 0; i < NR_IRQS; i++)
5758
irq_set_noprobe(i);
@@ -62,8 +63,7 @@ void __init init_IRQ(void)
6263
arch_init_irq();
6364

6465
for_each_possible_cpu(i) {
65-
int irq_pages = IRQ_STACK_SIZE / PAGE_SIZE;
66-
void *s = (void *)__get_free_pages(GFP_KERNEL, irq_pages);
66+
void *s = (void *)__get_free_pages(GFP_KERNEL, order);
6767

6868
irq_stack[i] = s;
6969
pr_debug("CPU%d IRQ stack at 0x%p - 0x%p\n", i,

0 commit comments

Comments
 (0)