From: Ian Munsie <imun...@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 <imun...@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

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to