aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Banman <abanman@sgi.com>2016-09-21 12:09:16 -0400
committerIngo Molnar <mingo@kernel.org>2016-09-22 05:16:13 -0400
commit5e4f96fe2a61c759d5d47f8112813618805c85a0 (patch)
tree37224ea5cac6cf9d41ca20db6460daded10c7284
parent60e1c842c7ea3dd6a65660864554565cc737dd86 (diff)
x86/platform/uv/BAU: Add generic function pointers
Many BAU functions have different implementations depending on the UV version. Rather than switching on the uvhub_version throughout the driver, we can define a set of operations for each version. This is especially beneficial for UV4, which will require many new MMR read/write functions. Currently, the set of abstracted functions are the same for UV1, UV2, and UV3. The functions were chosen because each one will have a different implementation for UV4. Other functions will be added as needed to handle new implementations or to cleanup the existing differences between UV1, UV2, and UV3, i.e. read_status and wait_completion. Signed-off-by: Andrew Banman <abanman@sgi.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Mike Travis <travis@sgi.com> Acked-by: Dimitri Sivanich <sivanich@sgi.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: akpm@linux-foundation.org Cc: rja@sgi.com Link: http://lkml.kernel.org/r/1474474161-265604-6-git-send-email-abanman@sgi.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/include/asm/uv/uv_bau.h11
-rw-r--r--arch/x86/platform/uv/tlb_uv.c19
2 files changed, 30 insertions, 0 deletions
diff --git a/arch/x86/include/asm/uv/uv_bau.h b/arch/x86/include/asm/uv/uv_bau.h
index a46f270e2789..a7a93a5beb00 100644
--- a/arch/x86/include/asm/uv/uv_bau.h
+++ b/arch/x86/include/asm/uv/uv_bau.h
@@ -385,6 +385,17 @@ struct uv2_3_bau_msg_header {
385 /* bits 127:120 */ 385 /* bits 127:120 */
386}; 386};
387 387
388/* Abstracted BAU functions */
389struct bau_operations {
390 unsigned long (*read_l_sw_ack)(void);
391 unsigned long (*read_g_sw_ack)(int pnode);
392 unsigned long (*bau_gpa_to_offset)(unsigned long vaddr);
393 void (*write_l_sw_ack)(unsigned long mmr);
394 void (*write_g_sw_ack)(int pnode, unsigned long mmr);
395 void (*write_payload_first)(int pnode, unsigned long mmr);
396 void (*write_payload_last)(int pnode, unsigned long mmr);
397};
398
388/* 399/*
389 * The activation descriptor: 400 * The activation descriptor:
390 * The format of the message to send, plus all accompanying control 401 * The format of the message to send, plus all accompanying control
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c
index 34b2a48143d5..a33a43358e4e 100644
--- a/arch/x86/platform/uv/tlb_uv.c
+++ b/arch/x86/platform/uv/tlb_uv.c
@@ -24,6 +24,18 @@
24#include <asm/irq_vectors.h> 24#include <asm/irq_vectors.h>
25#include <asm/timer.h> 25#include <asm/timer.h>
26 26
27static struct bau_operations ops;
28
29static struct bau_operations uv123_bau_ops = {
30 .bau_gpa_to_offset = uv_gpa_to_offset,
31 .read_l_sw_ack = read_mmr_sw_ack,
32 .read_g_sw_ack = read_gmmr_sw_ack,
33 .write_l_sw_ack = write_mmr_sw_ack,
34 .write_g_sw_ack = write_gmmr_sw_ack,
35 .write_payload_first = write_mmr_payload_first,
36 .write_payload_last = write_mmr_payload_last,
37};
38
27/* timeouts in nanoseconds (indexed by UVH_AGING_PRESCALE_SEL urgency7 30:28) */ 39/* timeouts in nanoseconds (indexed by UVH_AGING_PRESCALE_SEL urgency7 30:28) */
28static int timeout_base_ns[] = { 40static int timeout_base_ns[] = {
29 20, 41 20,
@@ -2135,6 +2147,13 @@ static int __init uv_bau_init(void)
2135 if (!is_uv_system()) 2147 if (!is_uv_system())
2136 return 0; 2148 return 0;
2137 2149
2150 if (is_uv3_hub())
2151 ops = uv123_bau_ops;
2152 else if (is_uv2_hub())
2153 ops = uv123_bau_ops;
2154 else if (is_uv1_hub())
2155 ops = uv123_bau_ops;
2156
2138 for_each_possible_cpu(cur_cpu) { 2157 for_each_possible_cpu(cur_cpu) {
2139 mask = &per_cpu(uv_flush_tlb_mask, cur_cpu); 2158 mask = &per_cpu(uv_flush_tlb_mask, cur_cpu);
2140 zalloc_cpumask_var_node(mask, GFP_KERNEL, cpu_to_node(cur_cpu)); 2159 zalloc_cpumask_var_node(mask, GFP_KERNEL, cpu_to_node(cur_cpu));