aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2016-04-29 17:54:13 -0400
committerIngo Molnar <mingo@kernel.org>2016-05-04 02:48:49 -0400
commitd38bb135d814e96811e1a0778564d7a2df922e28 (patch)
tree1fcce8804b029d59fdbb9693add14b419f078bd7 /arch
parent0045ddd23f21ad1964c01228257bc6c692e1c2f9 (diff)
x86/platform/UV: Move scir info to the per cpu info struct
Change the references to the SCIR fields to the new per cpu info structs. Tested-by: John Estabrook <estabrook@sgi.com> Tested-by: Gary Kroening <gfk@sgi.com> Tested-by: Nathan Zimmer <nzimmer@sgi.com> Signed-off-by: Mike Travis <travis@sgi.com> Reviewed-by: Dimitri Sivanich <sivanich@sgi.com> Cc: Andrew Banman <abanman@sgi.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Len Brown <len.brown@intel.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Russ Anderson <rja@sgi.com> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/20160429215404.452538234@asylum.americas.sgi.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/uv/uv_hub.h17
-rw-r--r--arch/x86/kernel/apic/x2apic_uv_x.c18
2 files changed, 19 insertions, 16 deletions
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h
index 2ff0eb8058ae..b8c5a6198ca1 100644
--- a/arch/x86/include/asm/uv/uv_hub.h
+++ b/arch/x86/include/asm/uv/uv_hub.h
@@ -127,6 +127,7 @@
127 */ 127 */
128#define UV_MAX_NASID_VALUE (UV_MAX_NUMALINK_BLADES * 2) 128#define UV_MAX_NASID_VALUE (UV_MAX_NUMALINK_BLADES * 2)
129 129
130/* System Controller Interface Reg info */
130struct uv_scir_s { 131struct uv_scir_s {
131 struct timer_list timer; 132 struct timer_list timer;
132 unsigned long offset; 133 unsigned long offset;
@@ -161,7 +162,6 @@ struct uv_hub_info_s {
161 unsigned char blade_processor_id; 162 unsigned char blade_processor_id;
162 unsigned char m_val; 163 unsigned char m_val;
163 unsigned char n_val; 164 unsigned char n_val;
164 struct uv_scir_s scir;
165}; 165};
166 166
167DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info); 167DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info);
@@ -179,6 +179,9 @@ DECLARE_PER_CPU(struct uv_cpu_info_s, __uv_cpu_info);
179#define uv_cpu_info this_cpu_ptr(&__uv_cpu_info) 179#define uv_cpu_info this_cpu_ptr(&__uv_cpu_info)
180#define uv_cpu_info_per(cpu) (&per_cpu(__uv_cpu_info, cpu)) 180#define uv_cpu_info_per(cpu) (&per_cpu(__uv_cpu_info, cpu))
181 181
182#define uv_scir_info (&uv_cpu_info->scir)
183#define uv_cpu_scir_info(cpu) (&uv_cpu_info_per(cpu)->scir)
184
182/* 185/*
183 * HUB revision ranges for each UV HUB architecture. 186 * HUB revision ranges for each UV HUB architecture.
184 * This is a software convention - NOT the hardware revision numbers in 187 * This is a software convention - NOT the hardware revision numbers in
@@ -686,9 +689,9 @@ DECLARE_PER_CPU(struct uv_cpu_nmi_s, uv_cpu_nmi);
686/* Update SCIR state */ 689/* Update SCIR state */
687static inline void uv_set_scir_bits(unsigned char value) 690static inline void uv_set_scir_bits(unsigned char value)
688{ 691{
689 if (uv_hub_info->scir.state != value) { 692 if (uv_scir_info->state != value) {
690 uv_hub_info->scir.state = value; 693 uv_scir_info->state = value;
691 uv_write_local_mmr8(uv_hub_info->scir.offset, value); 694 uv_write_local_mmr8(uv_scir_info->offset, value);
692 } 695 }
693} 696}
694 697
@@ -699,10 +702,10 @@ static inline unsigned long uv_scir_offset(int apicid)
699 702
700static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value) 703static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value)
701{ 704{
702 if (uv_cpu_hub_info(cpu)->scir.state != value) { 705 if (uv_cpu_scir_info(cpu)->state != value) {
703 uv_write_global_mmr8(uv_cpu_to_pnode(cpu), 706 uv_write_global_mmr8(uv_cpu_to_pnode(cpu),
704 uv_cpu_hub_info(cpu)->scir.offset, value); 707 uv_cpu_scir_info(cpu)->offset, value);
705 uv_cpu_hub_info(cpu)->scir.state = value; 708 uv_cpu_scir_info(cpu)->state = value;
706 } 709 }
707} 710}
708 711
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 067aa5122f42..c8acda9f1622 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -756,8 +756,8 @@ static __init void uv_rtc_init(void)
756 */ 756 */
757static void uv_heartbeat(unsigned long ignored) 757static void uv_heartbeat(unsigned long ignored)
758{ 758{
759 struct timer_list *timer = &uv_hub_info->scir.timer; 759 struct timer_list *timer = &uv_scir_info->timer;
760 unsigned char bits = uv_hub_info->scir.state; 760 unsigned char bits = uv_scir_info->state;
761 761
762 /* flip heartbeat bit */ 762 /* flip heartbeat bit */
763 bits ^= SCIR_CPU_HEARTBEAT; 763 bits ^= SCIR_CPU_HEARTBEAT;
@@ -777,14 +777,14 @@ static void uv_heartbeat(unsigned long ignored)
777 777
778static void uv_heartbeat_enable(int cpu) 778static void uv_heartbeat_enable(int cpu)
779{ 779{
780 while (!uv_cpu_hub_info(cpu)->scir.enabled) { 780 while (!uv_cpu_scir_info(cpu)->enabled) {
781 struct timer_list *timer = &uv_cpu_hub_info(cpu)->scir.timer; 781 struct timer_list *timer = &uv_cpu_scir_info(cpu)->timer;
782 782
783 uv_set_cpu_scir_bits(cpu, SCIR_CPU_HEARTBEAT|SCIR_CPU_ACTIVITY); 783 uv_set_cpu_scir_bits(cpu, SCIR_CPU_HEARTBEAT|SCIR_CPU_ACTIVITY);
784 setup_timer(timer, uv_heartbeat, cpu); 784 setup_timer(timer, uv_heartbeat, cpu);
785 timer->expires = jiffies + SCIR_CPU_HB_INTERVAL; 785 timer->expires = jiffies + SCIR_CPU_HB_INTERVAL;
786 add_timer_on(timer, cpu); 786 add_timer_on(timer, cpu);
787 uv_cpu_hub_info(cpu)->scir.enabled = 1; 787 uv_cpu_scir_info(cpu)->enabled = 1;
788 788
789 /* also ensure that boot cpu is enabled */ 789 /* also ensure that boot cpu is enabled */
790 cpu = 0; 790 cpu = 0;
@@ -794,9 +794,9 @@ static void uv_heartbeat_enable(int cpu)
794#ifdef CONFIG_HOTPLUG_CPU 794#ifdef CONFIG_HOTPLUG_CPU
795static void uv_heartbeat_disable(int cpu) 795static void uv_heartbeat_disable(int cpu)
796{ 796{
797 if (uv_cpu_hub_info(cpu)->scir.enabled) { 797 if (uv_cpu_scir_info(cpu)->enabled) {
798 uv_cpu_hub_info(cpu)->scir.enabled = 0; 798 uv_cpu_scir_info(cpu)->enabled = 0;
799 del_timer(&uv_cpu_hub_info(cpu)->scir.timer); 799 del_timer(&uv_cpu_scir_info(cpu)->timer);
800 } 800 }
801 uv_set_cpu_scir_bits(cpu, 0xff); 801 uv_set_cpu_scir_bits(cpu, 0xff);
802} 802}
@@ -1055,13 +1055,13 @@ void __init uv_system_init(void)
1055 1055
1056 uv_cpu_hub_info(cpu)->numa_blade_id = blade; 1056 uv_cpu_hub_info(cpu)->numa_blade_id = blade;
1057 uv_cpu_hub_info(cpu)->pnode = pnode; 1057 uv_cpu_hub_info(cpu)->pnode = pnode;
1058 uv_cpu_hub_info(cpu)->scir.offset = uv_scir_offset(apicid);
1059 uv_cpu_hub_info(cpu)->blade_processor_id = lcpu; 1058 uv_cpu_hub_info(cpu)->blade_processor_id = lcpu;
1060 uv_node_to_blade[nodeid] = blade; 1059 uv_node_to_blade[nodeid] = blade;
1061 uv_cpu_to_blade[cpu] = blade; 1060 uv_cpu_to_blade[cpu] = blade;
1062 1061
1063 /* Initialize per cpu info list */ 1062 /* Initialize per cpu info list */
1064 uv_cpu_info_per(cpu)->p_uv_hub_info = uv_cpu_hub_info(cpu); 1063 uv_cpu_info_per(cpu)->p_uv_hub_info = uv_cpu_hub_info(cpu);
1064 uv_cpu_info_per(cpu)->scir.offset = uv_scir_offset(apicid);
1065 } 1065 }
1066 1066
1067 /* Add blade/pnode info for nodes without cpus */ 1067 /* Add blade/pnode info for nodes without cpus */