linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Ian Munsie" <imunsie@au1.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>, mikey <mikey@neuling.org>,
	linuxppc-dev@lists.ozlabs.org,
	Frederic Barrat <frederic.barrat@fr.ibm.com>,
	Huy Nguyen <huyn@mellanox.com>
Cc: Ian Munsie <imunsie@au1.ibm.com>
Subject: [PATCH 2/2] cxl: Workaround XSL bug that does not clear the RA bit after a reset
Date: Thu, 30 Jun 2016 04:51:26 +1000	[thread overview]
Message-ID: <1467226286-28547-2-git-send-email-imunsie@au.ibm.com> (raw)
In-Reply-To: <1467226286-28547-1-git-send-email-imunsie@au.ibm.com>

From: Ian Munsie <imunsie@au1.ibm.com>

An issue was noted in our debug logs where the XSL would leave the RA
bit asserted after an AFU reset operation, which would effectively
prevent further AFU reset operations from working.

Workaround the issue by clearing the RA bit with an MMIO write if it is
still asserted after any AFU control operation.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
---
 drivers/misc/cxl/native.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c
index 9479bfc..bc79be8 100644
--- a/drivers/misc/cxl/native.c
+++ b/drivers/misc/cxl/native.c
@@ -55,6 +55,16 @@ static int afu_control(struct cxl_afu *afu, u64 command, u64 clear,
 		cpu_relax();
 		AFU_Cntl = cxl_p2n_read(afu, CXL_AFU_Cntl_An);
 	};
+
+	if (AFU_Cntl & CXL_AFU_Cntl_An_RA) {
+		/*
+		 * Workaround for a bug in the XSL used in the Mellanox CX4
+		 * that fails to clear the RA bit after an AFU reset,
+		 * preventing subsequent AFU resets from working.
+		 */
+		cxl_p2n_write(afu, CXL_AFU_Cntl_An, AFU_Cntl & ~CXL_AFU_Cntl_An_RA);
+	}
+
 	pr_devel("AFU command complete: %llx\n", command);
 	afu->enabled = enabled;
 out:
-- 
2.8.1

  reply	other threads:[~2016-06-29 18:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-29 18:51 [PATCH 1/2] cxl: Fix bug where AFU disable operation had no effect Ian Munsie
2016-06-29 18:51 ` Ian Munsie [this message]
2016-06-30 11:05   ` [PATCH 2/2] cxl: Workaround XSL bug that does not clear the RA bit after a reset Frederic Barrat
2016-07-11 10:19   ` [2/2] " Michael Ellerman
2016-06-30 14:19 ` [PATCH 1/2] cxl: Fix bug where AFU disable operation had no effect Frederic Barrat
2016-06-30 15:32   ` Ian Munsie
2016-06-30 15:50     ` Frederic Barrat
2016-06-30 16:45       ` Ian Munsie
2016-06-30 16:50 ` [PATCH v2] " Ian Munsie
2016-07-01  8:09   ` Frederic Barrat
2016-07-11 10:19   ` [v2] " Michael Ellerman

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=1467226286-28547-2-git-send-email-imunsie@au.ibm.com \
    --to=imunsie@au1.ibm.com \
    --cc=frederic.barrat@fr.ibm.com \
    --cc=huyn@mellanox.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=mpe@ellerman.id.au \
    /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;
as well as URLs for NNTP newsgroup(s).