Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752713AbdCMNmO (ORCPT ); Mon, 13 Mar 2017 09:42:14 -0400 Received: from terminus.zytor.com ([65.50.211.136]:57956 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751188AbdCMNmI (ORCPT ); Mon, 13 Mar 2017 09:42:08 -0400 Date: Mon, 13 Mar 2017 06:41:58 -0700 From: tip-bot for Andrew Banman Message-ID: Cc: tglx@linutronix.de, mike.travis@hpe.com, linux-kernel@vger.kernel.org, hpa@zytor.com, abanman@hpe.com, mingo@kernel.org Reply-To: mike.travis@hpe.com, tglx@linutronix.de, abanman@hpe.com, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org In-Reply-To: <1489077734-111753-6-git-send-email-abanman@hpe.com> References: <1489077734-111753-6-git-send-email-abanman@hpe.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/platform] x86/platform/uv/BAU: Add wait_completion to bau_operations Git-Commit-ID: 2620bbbf1f4f187952fb35861f4473860c432728 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4705 Lines: 123 Commit-ID: 2620bbbf1f4f187952fb35861f4473860c432728 Gitweb: http://git.kernel.org/tip/2620bbbf1f4f187952fb35861f4473860c432728 Author: Andrew Banman AuthorDate: Thu, 9 Mar 2017 10:42:13 -0600 Committer: Thomas Gleixner CommitDate: Mon, 13 Mar 2017 14:26:29 +0100 x86/platform/uv/BAU: Add wait_completion to bau_operations Remove the present wait_completion routine and add a function pointer by the same name to the bau_operations struct. Rather than switching on the UV hub version during message processing, set the architecture-specific uv*_wait_completion during initialization. The uv123_bau_ops struct must be split into uv1 and uv2_3 versions to accommodate the corresponding wait_completion routines. Signed-off-by: Andrew Banman Acked-by: Ingo Molnar Acked-by: Mike Travis Cc: sivanich@hpe.com Cc: rja@hpe.com Cc: akpm@linux-foundation.org Link: http://lkml.kernel.org/r/1489077734-111753-6-git-send-email-abanman@hpe.com Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/uv/uv_bau.h | 2 ++ arch/x86/platform/uv/tlb_uv.c | 31 ++++++++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/arch/x86/include/asm/uv/uv_bau.h b/arch/x86/include/asm/uv/uv_bau.h index 0ec7631..7cac798 100644 --- a/arch/x86/include/asm/uv/uv_bau.h +++ b/arch/x86/include/asm/uv/uv_bau.h @@ -672,6 +672,8 @@ struct bau_operations { void (*write_g_sw_ack)(int pnode, unsigned long mmr); void (*write_payload_first)(int pnode, unsigned long mmr); void (*write_payload_last)(int pnode, unsigned long mmr); + int (*wait_completion)(struct bau_desc*, + struct bau_control*, long try); }; static inline void write_mmr_data_broadcast(int pnode, unsigned long mmr_image) diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c index 13a7055..2a826dd 100644 --- a/arch/x86/platform/uv/tlb_uv.c +++ b/arch/x86/platform/uv/tlb_uv.c @@ -686,14 +686,6 @@ static int uv2_3_wait_completion(struct bau_desc *bau_desc, return FLUSH_COMPLETE; } -static int wait_completion(struct bau_desc *bau_desc, struct bau_control *bcp, long try) -{ - if (bcp->uvhub_version == UV_BAU_V1) - return uv1_wait_completion(bau_desc, bcp, try); - else - return uv2_3_wait_completion(bau_desc, bcp, try); -} - /* * Our retries are blocked by all destination sw ack resources being * in use, and a timeout is pending. In that case hardware immediately @@ -922,7 +914,7 @@ int uv_flush_send_and_wait(struct cpumask *flush_mask, struct bau_control *bcp, write_mmr_activation(index); try++; - completion_stat = wait_completion(bau_desc, bcp, try); + completion_stat = ops.wait_completion(bau_desc, bcp, try); handle_cmplt(completion_stat, bau_desc, bcp, hmaster, stat); @@ -2135,7 +2127,18 @@ fail: return 1; } -static const struct bau_operations uv123_bau_ops __initconst = { +static const struct bau_operations uv1_bau_ops __initconst = { + .bau_gpa_to_offset = uv_gpa_to_offset, + .read_l_sw_ack = read_mmr_sw_ack, + .read_g_sw_ack = read_gmmr_sw_ack, + .write_l_sw_ack = write_mmr_sw_ack, + .write_g_sw_ack = write_gmmr_sw_ack, + .write_payload_first = write_mmr_payload_first, + .write_payload_last = write_mmr_payload_last, + .wait_completion = uv1_wait_completion, +}; + +static const struct bau_operations uv2_3_bau_ops __initconst = { .bau_gpa_to_offset = uv_gpa_to_offset, .read_l_sw_ack = read_mmr_sw_ack, .read_g_sw_ack = read_gmmr_sw_ack, @@ -2143,6 +2146,7 @@ static const struct bau_operations uv123_bau_ops __initconst = { .write_g_sw_ack = write_gmmr_sw_ack, .write_payload_first = write_mmr_payload_first, .write_payload_last = write_mmr_payload_last, + .wait_completion = uv2_3_wait_completion, }; static const struct bau_operations uv4_bau_ops __initconst = { @@ -2153,6 +2157,7 @@ static const struct bau_operations uv4_bau_ops __initconst = { .write_g_sw_ack = write_gmmr_proc_sw_ack, .write_payload_first = write_mmr_proc_payload_first, .write_payload_last = write_mmr_proc_payload_last, + .wait_completion = uv2_3_wait_completion, }; /* @@ -2174,11 +2179,11 @@ static int __init uv_bau_init(void) if (is_uv4_hub()) ops = uv4_bau_ops; else if (is_uv3_hub()) - ops = uv123_bau_ops; + ops = uv2_3_bau_ops; else if (is_uv2_hub()) - ops = uv123_bau_ops; + ops = uv2_3_bau_ops; else if (is_uv1_hub()) - ops = uv123_bau_ops; + ops = uv1_bau_ops; for_each_possible_cpu(cur_cpu) { mask = &per_cpu(uv_flush_tlb_mask, cur_cpu);