From: tip-bot for Andrew Banman <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: abanman@hpe.com, tglx@linutronix.de, mike.travis@hpe.com,
mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org
Subject: [tip:x86/platform] x86/platform/uv/BAU: Implement uv4_wait_completion with read_status
Date: Mon, 13 Mar 2017 06:42:28 -0700 [thread overview]
Message-ID: <tip-2f2a033fb5819c393d65da9b6233e095f3690f15@git.kernel.org> (raw)
In-Reply-To: <1489077734-111753-7-git-send-email-abanman@hpe.com>
Commit-ID: 2f2a033fb5819c393d65da9b6233e095f3690f15
Gitweb: http://git.kernel.org/tip/2f2a033fb5819c393d65da9b6233e095f3690f15
Author: Andrew Banman <abanman@hpe.com>
AuthorDate: Thu, 9 Mar 2017 10:42:14 -0600
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 13 Mar 2017 14:26:29 +0100
x86/platform/uv/BAU: Implement uv4_wait_completion with read_status
UV4 does not employ a software-timeout as in previous generations so a new
wait_completion routine without this logic is required. Certain completion
statuses require the AUX status bit in addition to ERROR and BUSY.
Add the read_status routine to construct the full completion status. Use
read_status in the uv4_wait_completion routine to handle all possible
completion statuses.
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-7-git-send-email-abanman@hpe.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/platform/uv/tlb_uv.c | 58 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 57 insertions(+), 1 deletion(-)
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c
index 2a826dd..42e65fe 100644
--- a/arch/x86/platform/uv/tlb_uv.c
+++ b/arch/x86/platform/uv/tlb_uv.c
@@ -687,6 +687,62 @@ static int uv2_3_wait_completion(struct bau_desc *bau_desc,
}
/*
+ * Returns the status of current BAU message for cpu desc as a bit field
+ * [Error][Busy][Aux]
+ */
+static u64 read_status(u64 status_mmr, int index, int desc)
+{
+ u64 stat;
+
+ stat = ((read_lmmr(status_mmr) >> index) & UV_ACT_STATUS_MASK) << 1;
+ stat |= (read_lmmr(UVH_LB_BAU_SB_ACTIVATION_STATUS_2) >> desc) & 0x1;
+
+ return stat;
+}
+
+static int uv4_wait_completion(struct bau_desc *bau_desc,
+ struct bau_control *bcp, long try)
+{
+ struct ptc_stats *stat = bcp->statp;
+ u64 descriptor_stat;
+ u64 mmr = bcp->status_mmr;
+ int index = bcp->status_index;
+ int desc = bcp->uvhub_cpu;
+
+ descriptor_stat = read_status(mmr, index, desc);
+
+ /* spin on the status MMR, waiting for it to go idle */
+ while (descriptor_stat != UV2H_DESC_IDLE) {
+ switch (descriptor_stat) {
+ case UV2H_DESC_SOURCE_TIMEOUT:
+ stat->s_stimeout++;
+ return FLUSH_GIVEUP;
+
+ case UV2H_DESC_DEST_TIMEOUT:
+ stat->s_dtimeout++;
+ bcp->conseccompletes = 0;
+ return FLUSH_RETRY_TIMEOUT;
+
+ case UV2H_DESC_DEST_STRONG_NACK:
+ stat->s_plugged++;
+ bcp->conseccompletes = 0;
+ return FLUSH_RETRY_PLUGGED;
+
+ case UV2H_DESC_DEST_PUT_ERR:
+ bcp->conseccompletes = 0;
+ return FLUSH_GIVEUP;
+
+ default:
+ /* descriptor_stat is still BUSY */
+ cpu_relax();
+ }
+ descriptor_stat = read_status(mmr, index, desc);
+ }
+ bcp->conseccompletes++;
+ return FLUSH_COMPLETE;
+}
+
+/*
* Our retries are blocked by all destination sw ack resources being
* in use, and a timeout is pending. In that case hardware immediately
* returns the ERROR that looks like a destination timeout.
@@ -2157,7 +2213,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,
+ .wait_completion = uv4_wait_completion,
};
/*
prev parent reply other threads:[~2017-03-13 13:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-09 16:42 [PATCHv3 0/6] x86/platform/uv/BAU: UV4 message completion and initialization updates Andrew Banman
2017-03-09 16:42 ` [PATCH 1/6] x86/platform/uv/BAU: Add uv_bau_version enumerated constants Andrew Banman
2017-03-13 13:39 ` [tip:x86/platform] " tip-bot for Andrew Banman
2017-03-09 16:42 ` [PATCH 2/6] x86/platform/uv/BAU: Add payload descriptor qualifier Andrew Banman
2017-03-13 13:40 ` [tip:x86/platform] " tip-bot for Andrew Banman
2017-03-09 16:42 ` [PATCH 3/6] x86/platform/uv/BAU: Cleanup bau_operations declaration and instances Andrew Banman
2017-03-13 13:40 ` [tip:x86/platform] " tip-bot for Andrew Banman
2017-03-09 16:42 ` [PATCH 4/6] x86/platform/uv/BAU: Add status mmr location fields to bau_control Andrew Banman
2017-03-13 13:41 ` [tip:x86/platform] " tip-bot for Andrew Banman
2017-03-09 16:42 ` [PATCH 5/6] x86/platform/uv/BAU: Add wait_completion to bau_operations Andrew Banman
2017-03-13 13:41 ` [tip:x86/platform] " tip-bot for Andrew Banman
2017-03-09 16:42 ` [PATCH 6/6] x86/platform/uv/BAU: Implement uv4_wait_completion with read_status Andrew Banman
2017-03-13 13:42 ` tip-bot for Andrew Banman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-2f2a033fb5819c393d65da9b6233e095f3690f15@git.kernel.org \
--to=tipbot@zytor.com \
--cc=abanman@hpe.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mike.travis@hpe.com \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox