diff options
author | Andrew Banman <abanman@hpe.com> | 2017-03-09 11:42:11 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-03-13 09:26:28 -0400 |
commit | 8e3b21b6dbf0318d5b3a598572acc23f07189c40 (patch) | |
tree | 8e99b003495c5d50877ab17006a7fee1d4e423b9 | |
parent | e9be36443cecda1be20b2cc3b891676ff2af9dff (diff) |
x86/platform/uv/BAU: Cleanup bau_operations declaration and instances
Move the bau_operations declaration after bau struct declarations so the
bau structs can be referenced when adding new functions to
bau_operations. That way we avoid forward declarations of the bau
structs.
Likewise, move uv*_bau_ops structs down to avoid forward declarations of
new functions defined in the same file. Declare these structs __initconst
since they are only used during initialization. Similarly, declare the
bau_operations ops instance __ro_after_init as it is read-only after
initialization.
This is a preparatory patch for adding wait_completion to bau_operations.
Signed-off-by: Andrew Banman <abanman@hpe.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Mike Travis <mike.travis@hpe.com>
Cc: sivanich@hpe.com
Cc: rja@hpe.com
Cc: akpm@linux-foundation.org
Link: http://lkml.kernel.org/r/1489077734-111753-4-git-send-email-abanman@hpe.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/x86/include/asm/uv/uv_bau.h | 22 | ||||
-rw-r--r-- | arch/x86/platform/uv/tlb_uv.c | 43 |
2 files changed, 32 insertions, 33 deletions
diff --git a/arch/x86/include/asm/uv/uv_bau.h b/arch/x86/include/asm/uv/uv_bau.h index dcd63ed69162..695b873f4fd3 100644 --- a/arch/x86/include/asm/uv/uv_bau.h +++ b/arch/x86/include/asm/uv/uv_bau.h | |||
@@ -406,17 +406,6 @@ struct uv2_3_bau_msg_header { | |||
406 | /* bits 127:120 */ | 406 | /* bits 127:120 */ |
407 | }; | 407 | }; |
408 | 408 | ||
409 | /* Abstracted BAU functions */ | ||
410 | struct bau_operations { | ||
411 | unsigned long (*read_l_sw_ack)(void); | ||
412 | unsigned long (*read_g_sw_ack)(int pnode); | ||
413 | unsigned long (*bau_gpa_to_offset)(unsigned long vaddr); | ||
414 | void (*write_l_sw_ack)(unsigned long mmr); | ||
415 | void (*write_g_sw_ack)(int pnode, unsigned long mmr); | ||
416 | void (*write_payload_first)(int pnode, unsigned long mmr); | ||
417 | void (*write_payload_last)(int pnode, unsigned long mmr); | ||
418 | }; | ||
419 | |||
420 | /* | 409 | /* |
421 | * The activation descriptor: | 410 | * The activation descriptor: |
422 | * The format of the message to send, plus all accompanying control | 411 | * The format of the message to send, plus all accompanying control |
@@ -668,6 +657,17 @@ struct bau_control { | |||
668 | struct hub_and_pnode *thp; | 657 | struct hub_and_pnode *thp; |
669 | }; | 658 | }; |
670 | 659 | ||
660 | /* Abstracted BAU functions */ | ||
661 | struct bau_operations { | ||
662 | unsigned long (*read_l_sw_ack)(void); | ||
663 | unsigned long (*read_g_sw_ack)(int pnode); | ||
664 | unsigned long (*bau_gpa_to_offset)(unsigned long vaddr); | ||
665 | void (*write_l_sw_ack)(unsigned long mmr); | ||
666 | void (*write_g_sw_ack)(int pnode, unsigned long mmr); | ||
667 | void (*write_payload_first)(int pnode, unsigned long mmr); | ||
668 | void (*write_payload_last)(int pnode, unsigned long mmr); | ||
669 | }; | ||
670 | |||
671 | static inline void write_mmr_data_broadcast(int pnode, unsigned long mmr_image) | 671 | static inline void write_mmr_data_broadcast(int pnode, unsigned long mmr_image) |
672 | { | 672 | { |
673 | write_gmmr(pnode, UVH_BAU_DATA_BROADCAST, mmr_image); | 673 | write_gmmr(pnode, UVH_BAU_DATA_BROADCAST, mmr_image); |
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c index 70721c493291..e6994fd5597a 100644 --- a/arch/x86/platform/uv/tlb_uv.c +++ b/arch/x86/platform/uv/tlb_uv.c | |||
@@ -23,28 +23,7 @@ | |||
23 | #include <asm/irq_vectors.h> | 23 | #include <asm/irq_vectors.h> |
24 | #include <asm/timer.h> | 24 | #include <asm/timer.h> |
25 | 25 | ||
26 | static struct bau_operations ops; | 26 | static struct bau_operations ops __ro_after_init; |
27 | |||
28 | static struct bau_operations uv123_bau_ops = { | ||
29 | .bau_gpa_to_offset = uv_gpa_to_offset, | ||
30 | .read_l_sw_ack = read_mmr_sw_ack, | ||
31 | .read_g_sw_ack = read_gmmr_sw_ack, | ||
32 | .write_l_sw_ack = write_mmr_sw_ack, | ||
33 | .write_g_sw_ack = write_gmmr_sw_ack, | ||
34 | .write_payload_first = write_mmr_payload_first, | ||
35 | .write_payload_last = write_mmr_payload_last, | ||
36 | }; | ||
37 | |||
38 | static struct bau_operations uv4_bau_ops = { | ||
39 | .bau_gpa_to_offset = uv_gpa_to_soc_phys_ram, | ||
40 | .read_l_sw_ack = read_mmr_proc_sw_ack, | ||
41 | .read_g_sw_ack = read_gmmr_proc_sw_ack, | ||
42 | .write_l_sw_ack = write_mmr_proc_sw_ack, | ||
43 | .write_g_sw_ack = write_gmmr_proc_sw_ack, | ||
44 | .write_payload_first = write_mmr_proc_payload_first, | ||
45 | .write_payload_last = write_mmr_proc_payload_last, | ||
46 | }; | ||
47 | |||
48 | 27 | ||
49 | /* timeouts in nanoseconds (indexed by UVH_AGING_PRESCALE_SEL urgency7 30:28) */ | 28 | /* timeouts in nanoseconds (indexed by UVH_AGING_PRESCALE_SEL urgency7 30:28) */ |
50 | static int timeout_base_ns[] = { | 29 | static int timeout_base_ns[] = { |
@@ -2158,6 +2137,26 @@ fail: | |||
2158 | return 1; | 2137 | return 1; |
2159 | } | 2138 | } |
2160 | 2139 | ||
2140 | static const struct bau_operations uv123_bau_ops __initconst = { | ||
2141 | .bau_gpa_to_offset = uv_gpa_to_offset, | ||
2142 | .read_l_sw_ack = read_mmr_sw_ack, | ||
2143 | .read_g_sw_ack = read_gmmr_sw_ack, | ||
2144 | .write_l_sw_ack = write_mmr_sw_ack, | ||
2145 | .write_g_sw_ack = write_gmmr_sw_ack, | ||
2146 | .write_payload_first = write_mmr_payload_first, | ||
2147 | .write_payload_last = write_mmr_payload_last, | ||
2148 | }; | ||
2149 | |||
2150 | static const struct bau_operations uv4_bau_ops __initconst = { | ||
2151 | .bau_gpa_to_offset = uv_gpa_to_soc_phys_ram, | ||
2152 | .read_l_sw_ack = read_mmr_proc_sw_ack, | ||
2153 | .read_g_sw_ack = read_gmmr_proc_sw_ack, | ||
2154 | .write_l_sw_ack = write_mmr_proc_sw_ack, | ||
2155 | .write_g_sw_ack = write_gmmr_proc_sw_ack, | ||
2156 | .write_payload_first = write_mmr_proc_payload_first, | ||
2157 | .write_payload_last = write_mmr_proc_payload_last, | ||
2158 | }; | ||
2159 | |||
2161 | /* | 2160 | /* |
2162 | * Initialization of BAU-related structures | 2161 | * Initialization of BAU-related structures |
2163 | */ | 2162 | */ |