From: Yinghai Lu <yinghai@kernel.org>
To: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Gleb Natapov <gleb@redhat.com>,
"Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>
Subject: Re: [PATCH] x86: move dmar_table_init out of enable_IR
Date: Mon, 17 Aug 2009 13:47:10 -0700 [thread overview]
Message-ID: <4A89C1CE.9040501@kernel.org> (raw)
In-Reply-To: <1250534019.2709.94.camel@sbs-t61.sc.intel.com>
Suresh Siddha wrote:
> On Mon, 2009-08-17 at 11:19 -0700, Yinghai Lu wrote:
>> ---
>> arch/x86/kernel/apic/apic.c | 22 +++++++++++++---------
>> 1 file changed, 13 insertions(+), 9 deletions(-)
>>
>> Index: linux-2.6/arch/x86/kernel/apic/apic.c
>> ===================================================================
>> --- linux-2.6.orig/arch/x86/kernel/apic/apic.c
>> +++ linux-2.6/arch/x86/kernel/apic/apic.c
>> @@ -1365,14 +1365,6 @@ void enable_x2apic(void)
>> int __init enable_IR(void)
>> {
>> #ifdef CONFIG_INTR_REMAP
>> - int ret;
>> -
>> - ret = dmar_table_init();
>> - if (ret) {
>> - pr_debug("dmar_table_init() failed with %d:\n", ret);
>> - return 0;
>> - }
>> -
>> if (!intr_remapping_supported()) {
>> pr_debug("intr-remapping not supported\n");
>> return 0;
>> @@ -1400,6 +1392,14 @@ void __init enable_IR_x2apic(void)
>> unsigned long flags;
>> struct IO_APIC_route_entry **ioapic_entries = NULL;
>> int ret, x2apic_enabled = 0;
>> + int dmar_table_init_ret = 0;
>> +
>> +#ifdef CONFIG_INTR_REMAP
>> + dmar_table_init_ret = dmar_table_init();
>> + if (dmar_table_init_ret)
>> + pr_debug("dmar_table_init() failed with %d:\n",
>> + dmar_table_init_ret);
>> +#endif
>
> We can remove this ifdef check, as dmar_table_init() already handles
> the !config_intr_remap
>
> Also, at this error condition, we should simply return if the cpu has no
> x2apic support. There is no x2apic support and we failed to enable
> interrupt-remapping. No need to go further down.
like this ?
---
arch/x86/kernel/apic/apic.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
Index: linux-2.6/arch/x86/kernel/apic/apic.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/apic/apic.c
+++ linux-2.6/arch/x86/kernel/apic/apic.c
@@ -1392,14 +1392,11 @@ void __init enable_IR_x2apic(void)
unsigned long flags;
struct IO_APIC_route_entry **ioapic_entries = NULL;
int ret, x2apic_enabled = 0;
- int dmar_table_init_ret = 0;
+ int dmar_table_init_ret;
-#ifdef CONFIG_INTR_REMAP
dmar_table_init_ret = dmar_table_init();
- if (dmar_table_init_ret)
- pr_debug("dmar_table_init() failed with %d:\n",
- dmar_table_init_ret);
-#endif
+ if (dmar_table_init_ret && !x2apic_supported())
+ return;
ioapic_entries = alloc_ioapic_entries();
if (!ioapic_entries) {
next prev parent reply other threads:[~2009-08-17 20:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-17 17:53 [PATCH] x86: move dmar_table_init out of enable_IR Yinghai Lu
[not found] ` <20090817180924.GA8599@elte.hu>
2009-08-17 18:19 ` Yinghai Lu
2009-08-17 18:33 ` Suresh Siddha
2009-08-17 20:47 ` Yinghai Lu [this message]
2009-08-17 22:53 ` Suresh Siddha
2009-08-17 19:25 ` [tip:x86/apic] x86, apic: Move dmar_table_init() out of enable_IR() tip-bot for Yinghai Lu
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=4A89C1CE.9040501@kernel.org \
--to=yinghai@kernel.org \
--cc=gleb@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
--cc=venkatesh.pallipadi@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox