Message ID | 1467226286-28547-2-git-send-email-imunsie@au.ibm.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Le 29/06/2016 20:51, Ian Munsie a écrit : > 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> OK, should be safe and valid even on non-xsl hardware. Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Fred
On Wed, 2016-29-06 at 18:51:26 UTC, Ian Munsie wrote: > 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> > Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/2a4f667aadb2d61c289a52a0d6 cheers
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: