Skip to content
  • Markos Chandras's avatar
    MIPS: malta: Fix GIC interrupt offsets · 13b7ea63
    Markos Chandras authored
    
    
    The GIC interrupt offsets are calculated based on the value of NR_CPUS.
    However, this is wrong because NR_CPUS may or may not contain the real
    number of the actual cpus present in the system. We fix that by using
    the 'nr_cpu_ids' variable which contains the real number of cpus in
    the system. Previously, an MT core (eg with 8 VPEs) will fail to boot if
    NR_CPUS was > 8 with the following errors:
    
    ------------[ cut here ]------------
    WARNING: CPU: 0 PID: 0 at kernel/irq/chip.c:670 __irq_set_handler+0x15c/0x164()
    Modules linked in:
    CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W    3.12.0-rc5-00087-gced5633 5
    Stack : 00000006 00000004 00000000 00000000 00000000 00000000 807a4f36 00000053
              807a0000 00000000 80173218 80565aa8 00000000 00000000 00000000 0000000
              00000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000
              00000000 00000000 00000000 8054fd00 8054fd94 80500514 805657a7 8016eb4
              807a0000 80500514 00000000 00000000 80565aa8 8079a5d8 80565766 8054fd0
              ...
    Call Trace:
    [<801098c0>] show_stack+0x64/0x7c
    [<8049c6b0>] dump_stack+0x64/0x84
    [<8012efc4>] warn_slowpath_common+0x84/0xb4
    [<8012f00c>] warn_slowpath_null+0x18/0x24
    [<80173218>] __irq_set_handler+0x15c/0x164
    [<80587cf4>] arch_init_ipiirq+0x2c/0x3c
    [<805880c8>] arch_init_irq+0x3c4/0x4bc
    [<80588e28>] init_IRQ+0x3c/0x50
    [<805847e8>] start_kernel+0x230/0x3d8
    
    ---[ end trace 4eaa2a86a8e2da26 ]---
    
    This is now fixed and the Malta board can boot with any NR_CPUS value
    which also helps supporting more processors in a single kernel binary.
    
    Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/6091/
    
    
    Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
    13b7ea63