All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Dou Liyang <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: douly.fnst@cn.fujitsu.com, torvalds@linux-foundation.org,
	linux-kernel@vger.kernel.org, peterz@infradead.org,
	tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com
Subject: [tip:x86/urgent] x86/apic: Simplify enable_IR_x2apic(), remove try_to_enable_IR()
Date: Wed, 1 Mar 2017 01:14:45 -0800	[thread overview]
Message-ID: <tip-11277aabcbbe13916151af897d29a5e9f71ca73f@git.kernel.org> (raw)
In-Reply-To: <1487841401-1543-1-git-send-email-douly.fnst@cn.fujitsu.com>

Commit-ID:  11277aabcbbe13916151af897d29a5e9f71ca73f
Gitweb:     http://git.kernel.org/tip/11277aabcbbe13916151af897d29a5e9f71ca73f
Author:     Dou Liyang <douly.fnst@cn.fujitsu.com>
AuthorDate: Thu, 23 Feb 2017 17:16:41 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 1 Mar 2017 10:09:09 +0100

x86/apic: Simplify enable_IR_x2apic(), remove try_to_enable_IR()

The following commit:

  2e63ad4bd5dd ("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>
---
 arch/x86/kernel/apic/apic.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 11088b8..aee7ded 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -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())
@@ -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);
 

      parent reply	other threads:[~2017-03-01  9:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-23  9:16 [PATCH] x86/apic: Remove the extra judgement of skipped IO APIC setup Dou Liyang
2017-03-01  9:04 ` Ingo Molnar
2017-03-01  9:31   ` Dou Liyang
2017-03-01  9:14 ` tip-bot for Dou Liyang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-11277aabcbbe13916151af897d29a5e9f71ca73f@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=douly.fnst@cn.fujitsu.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.