Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1731497

[PATCH v9 03/12] x86/apic: Split local APIC timer setup from the APIC setup

From Dou Liyang <douly.fnst@cn.fujitsu.com>
Newsgroups linux.kernel
Subject [PATCH v9 03/12] x86/apic: Split local APIC timer setup from the APIC setup
Date 2017-09-13 11:20 +0200
Message-ID <upbZV-5r0-33@gated-at.bofh.it> (permalink)
References <upbZU-5r0-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


apic_bsp_setup() sets up the local APIC, I/O APIC and APIC timer.

The local APIC and I/O APIC setup belongs to interrupt delivery mode
setup. Setting up the local APIC timer for booting CPU is another job
and has nothing to do with interrupt delivery mode setup.

Split local APIC timer setup from the APIC setup, keep it in the
original position for SMP and UP kernel for preparation.

Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
---
 arch/x86/kernel/apic/apic.c | 4 ++--
 arch/x86/kernel/smpboot.c   | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 08585bc..ad37324 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -2397,8 +2397,6 @@ int __init apic_bsp_setup(bool upmode)
 	end_local_APIC_setup();
 	irq_remap_enable_fault_handling();
 	setup_IO_APIC();
-	/* Setup local timer */
-	x86_init.timers.setup_percpu_clockev();
 	return id;
 }
 
@@ -2438,6 +2436,8 @@ int __init APIC_init_uniprocessor(void)
 
 	default_setup_apic_routing();
 	apic_bsp_setup(true);
+	/* Setup local timer */
+	x86_init.timers.setup_percpu_clockev();
 	return 0;
 }
 
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index cd6622c..dde8f1c 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1337,6 +1337,8 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
 	case SMP_FORCE_UP:
 		disable_smp();
 		apic_bsp_setup(false);
+		/* Setup local timer */
+		x86_init.timers.setup_percpu_clockev();
 		return;
 	case SMP_OK:
 		break;
@@ -1351,6 +1353,9 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
 	default_setup_apic_routing();
 	cpu0_logical_apicid = apic_bsp_setup(false);
 
+	/* Setup local timer */
+	x86_init.timers.setup_percpu_clockev();
+
 	pr_info("CPU0: ");
 	print_cpu_info(&cpu_data(0));
 
-- 
2.5.5

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v9 00/12] Unify the interrupt delivery mode and do its setup in advance Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-09-13 11:20 +0200
  [PATCH v9 12/12] x86/apic: Remove the init_bsp_APIC() Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-09-13 11:20 +0200
  [PATCH v9] ACPI / init: Invoke early ACPI initialization earlier Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-09-13 11:20 +0200
  [PATCH v9 10/12] x86/xen: Bypass intr mode setup in enlighten_pv system Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-09-13 11:20 +0200
    Re: [Xen-devel] [PATCH v9 10/12] x86/xen: Bypass intr mode setup in  enlighten_pv system Juergen Gross <jgross@suse.com> - 2017-09-13 11:50 +0200
      Re: [Xen-devel] [PATCH v9 10/12] x86/xen: Bypass intr mode setup in  enlighten_pv system Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-09-13 12:10 +0200
    [PATCH v10 10/12] x86/xen: Bypass intr mode setup in enlighten_pv system Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-09-13 12:30 +0200
  [PATCH v9 03/12] x86/apic: Split local APIC timer setup from the APIC setup Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-09-13 11:20 +0200
  [PATCH v9 11/12] x86/time: Initialize interrupt mode behind timer init Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-09-13 11:20 +0200
  [PATCH v9 02/12] x86/apic: Prepare for unifying the interrupt delivery modes setup Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-09-13 11:20 +0200
  [PATCH v9 09/12] x86/init: add intr_mode_init to x86_init_ops Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-09-13 11:20 +0200
  [PATCH v9 05/12] x86/apic: Unify interrupt mode setup for SMP-capable system Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-09-13 11:20 +0200
  [PATCH v9 06/12] x86/apic: Mark the apic_intr_mode extern for sanity check cleanup Dou Liyang <douly.fnst@cn.fujitsu.com> - 2017-09-13 11:20 +0200

csiph-web