Skip to content

Commit

Permalink
x86/apic: Simplify enable_IR_x2apic(), remove try_to_enable_IR()
Browse files Browse the repository at this point in the history
The following commit:

  2e63ad4 ("x86/apic: Do not init irq remapping if ioapic is disabled")

... added a check for skipped IO-APIC setup to enable_IR_x2apic(), but this
check is also duplicated in try_to_enable_IR() - and it will never succeed in
calling irq_remapping_enable().

Remove the whole irq_remapping_enable() complication: if the IO-APIC is
disabled we cannot enable IRQ remapping.

Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: bp@alien8.de
Cc: nicstange@gmail.com
Cc: wanpeng.li@hotmail.com
Link: http://lkml.kernel.org/r/1487841401-1543-1-git-send-email-douly.fnst@cn.fujitsu.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Dou Liyang authored and Ingo Molnar committed Mar 1, 2017
1 parent bb3f0a5 commit 11277aa
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions arch/x86/kernel/apic/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1610,24 +1610,15 @@ static inline void try_to_enable_x2apic(int remap_mode) { }
static inline void __x2apic_enable(void) { }
#endif /* !CONFIG_X86_X2APIC */

static int __init try_to_enable_IR(void)
{
#ifdef CONFIG_X86_IO_APIC
if (!x2apic_enabled() && skip_ioapic_setup) {
pr_info("Not enabling interrupt remapping due to skipped IO-APIC setup\n");
return -1;
}
#endif
return irq_remapping_enable();
}

void __init enable_IR_x2apic(void)
{
unsigned long flags;
int ret, ir_stat;

if (skip_ioapic_setup)
if (skip_ioapic_setup) {
pr_info("Not enabling interrupt remapping due to skipped IO-APIC setup\n");
return;
}

ir_stat = irq_remapping_prepare();
if (ir_stat < 0 && !x2apic_supported())
Expand All @@ -1645,7 +1636,7 @@ void __init enable_IR_x2apic(void)

/* If irq_remapping_prepare() succeeded, try to enable it */
if (ir_stat >= 0)
ir_stat = try_to_enable_IR();
ir_stat = irq_remapping_enable();
/* ir_stat contains the remap mode or an error code */
try_to_enable_x2apic(ir_stat);

Expand Down

0 comments on commit 11277aa

Please sign in to comment.