diff options
author | Andrew Banman <abanman@sgi.com> | 2016-09-21 12:09:16 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-09-22 05:16:13 -0400 |
commit | 5e4f96fe2a61c759d5d47f8112813618805c85a0 (patch) | |
tree | 37224ea5cac6cf9d41ca20db6460daded10c7284 /arch/x86/platform/uv | |
parent | 60e1c842c7ea3dd6a65660864554565cc737dd86 (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>
Diffstat (limited to 'arch/x86/platform/uv')
-rw-r--r-- | arch/x86/platform/uv/tlb_uv.c | 19 |
1 files changed, 19 insertions, 0 deletions
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 | ||
27 | static struct bau_operations ops; | ||
28 | |||
29 | static 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) */ |
28 | static int timeout_base_ns[] = { | 40 | static 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)); |