All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glauber Costa <gcosta@redhat.com>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	tglx@linutronix.de, mingo@elte.hu, hugh@veritas.com
Subject: Re: [PATCH 11/15] x86: move enabling of io_apic to prepare_cpus
Date: Mon, 09 Jun 2008 16:44:19 -0300	[thread overview]
Message-ID: <484D8813.4040807@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.55.0806091620250.26593@cliff.in.clinika.pl>

[-- Attachment #1: Type: text/plain, Size: 443 bytes --]

Maciej W. Rozycki wrote:
> On Mon, 9 Jun 2008, Glauber Costa wrote:
> 
>> Do it, instead of keeping in io_apic_32.c. This is the way x86_64
>> already does.
> 
>  This change looks wrong -- is native_smp_prepare_cpus() at all run on
> !CONFIG_SMP?  I don't think so.  You have to do this differently.
> 
>   Maciej

How about this one instead?

This one does enable_IO_APIC in the init_uniprocessor too, and should 
account for the !smp case.

[-- Attachment #2: 0001-x86-move-enabling-of-io_apic-to-prepare_cpus.patch --]
[-- Type: text/x-patch, Size: 2526 bytes --]

>From 87f8366012e1dc3cf7212e241b0aa552d7825338 Mon Sep 17 00:00:00 2001
From: Glauber Costa <gcosta@redhat.com>
Date: Wed, 28 May 2008 17:04:12 -0300
Subject: [PATCH] x86: move enabling of io_apic to prepare_cpus

Do it, instead of keeping in io_apic_32.c. This is the way x86_64 already does.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
---
 arch/x86/kernel/apic_32.c    |    3 +++
 arch/x86/kernel/io_apic_32.c |    4 ++--
 arch/x86/kernel/smpboot.c    |    2 +-
 include/asm-x86/hw_irq.h     |    2 --
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c
index fa8cf79..8385dc6 100644
--- a/arch/x86/kernel/apic_32.c
+++ b/arch/x86/kernel/apic_32.c
@@ -1273,6 +1273,9 @@ int __init APIC_init_uniprocessor(void)
 	setup_local_APIC();
 
 #ifdef CONFIG_X86_IO_APIC
+	if (!skip_ioapic_setup && nr_ioapics)
+		enable_IO_APIC();
+
 	if (!smp_found_config || skip_ioapic_setup || !nr_ioapics)
 #endif
 		localise_nmi_watchdog();
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
index 7fc071f..fa4f0a0 100644
--- a/arch/x86/kernel/io_apic_32.c
+++ b/arch/x86/kernel/io_apic_32.c
@@ -1606,7 +1606,7 @@ void /*__init*/ print_PIC(void)
 
 #endif  /*  0  */
 
-static void __init enable_IO_APIC(void)
+void __init enable_IO_APIC(void)
 {
 	union IO_APIC_reg_01 reg_01;
 	int i8259_apic, i8259_pin;
@@ -2295,7 +2295,7 @@ void __init setup_IO_APIC(void)
 	for (i = first_system_vector; i < NR_VECTORS; i++)
 		set_bit(i, used_vectors);
 
-	enable_IO_APIC();
+	/* calling enable_IO_APIC() is moved to setup_local_APIC for BP */
 
 	if (acpi_ioapic)
 		io_apic_irqs = ~0;	/* all IRQs go through IOAPIC */
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index f5ac5b2..e537c7b 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1175,7 +1175,7 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
 	 */
 	setup_local_APIC();
 
-#ifdef CONFIG_X86_64
+#ifdef CONFIG_X86_IO_APIC
 	/*
 	 * Enable IO APIC before setting up error vector
 	 */
diff --git a/include/asm-x86/hw_irq.h b/include/asm-x86/hw_irq.h
index 18f067c..4c81d1b 100644
--- a/include/asm-x86/hw_irq.h
+++ b/include/asm-x86/hw_irq.h
@@ -67,9 +67,7 @@ extern void print_IO_APIC(void);
 extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
 extern void setup_ioapic_dest(void);
 
-#ifdef CONFIG_X86_64
 extern void enable_IO_APIC(void);
-#endif
 
 /* IPI functions */
 extern void send_IPI_self(int vector);
-- 
1.5.4.5


  parent reply	other threads:[~2008-06-09 19:49 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-09 14:16 [PATCH 0/15] Improve x86 smpboot integration Glauber Costa
2008-06-09 14:16 ` [PATCH 01/15] x86: use stack_start in x86_64 Glauber Costa
2008-06-09 14:16   ` [PATCH 02/15] x86: don't use gdt_page openly Glauber Costa
2008-06-09 14:16     ` [PATCH 03/15] x86: remove early_gdt_descr reference Glauber Costa
2008-06-09 14:16       ` [PATCH 04/15] x86: move x86_64 gdt closer to i386 Glauber Costa
2008-06-09 14:16         ` [PATCH 05/15] x86: use initial_code for i386 Glauber Costa
2008-06-09 14:16           ` [PATCH 06/15] x86: boot secondary cpus through initial_code Glauber Costa
2008-06-09 14:16             ` [PATCH 07/15] x86: clearing io_apic harmless for x86_64 Glauber Costa
2008-06-09 14:16               ` [PATCH 08/15] x86: remove ifdef from stepping Glauber Costa
2008-06-09 14:16                 ` [PATCH 09/15] x86: change __setup_vector_irq with setup_vector_irq Glauber Costa
2008-06-09 14:16                   ` [PATCH 10/15] x86: provide connect_bsp_APIC for x86_64 Glauber Costa
2008-06-09 14:16                     ` [PATCH 11/15] x86: move enabling of io_apic to prepare_cpus Glauber Costa
2008-06-09 14:16                       ` [PATCH 12/15] x86: change naming to match x86_64 Glauber Costa
2008-06-09 14:16                         ` [PATCH 13/15] x86: remove cpu from maps Glauber Costa
2008-06-09 14:16                           ` [PATCH 14/15] x86: move cpu_exit_clear to process_32.c Glauber Costa
2008-06-09 14:16                             ` [PATCH 15/15] x86: take load_sp0 out of smpboot.c Glauber Costa
2008-06-09 15:23                       ` [PATCH 11/15] x86: move enabling of io_apic to prepare_cpus Maciej W. Rozycki
2008-06-09 15:52                         ` Glauber Costa
2008-06-09 19:44                         ` Glauber Costa [this message]
2008-06-09 20:12                           ` Maciej W. Rozycki
2008-06-09 20:53                             ` Yinghai Lu
2008-06-09 21:00                               ` Maciej W. Rozycki
2008-06-10  2:46                                 ` Maciej W. Rozycki
2008-06-10  5:08                                   ` Yinghai Lu
2008-06-10 13:00                                     ` Glauber Costa
2008-06-10 13:30                                       ` Maciej W. Rozycki
2008-06-10 19:09                                         ` Yinghai Lu
2008-06-10 19:36                                           ` Maciej W. Rozycki
2008-06-10 19:49                                             ` Yinghai Lu
2008-06-11  0:29                                               ` Maciej W. Rozycki
2008-06-11  2:32                                                 ` Yinghai Lu
2008-06-11 12:57                                                   ` Maciej W. Rozycki
2008-06-09 21:02                             ` Glauber Costa
2008-06-09 15:23       ` [PATCH 03/15] x86: remove early_gdt_descr reference James Bottomley
2008-06-09 15:49         ` Glauber Costa
2008-06-09 17:20           ` James Bottomley
2008-06-09 17:23             ` Glauber Costa
2008-06-09 17:40               ` James Bottomley

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=484D8813.4040807@redhat.com \
    --to=gcosta@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@linux-mips.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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.