]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
cxl: Disable AFU debug flag
authorIan Munsie <imunsie@au1.ibm.com>
Mon, 8 Dec 2014 08:17:59 +0000 (19:17 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 29 Dec 2014 04:45:43 +0000 (15:45 +1100)
Upon inspection of the implementation specific registers, it was
discovered that the high bit of the implementation specific RXCTL
register was enabled, which enables the DEADB00F debug feature.

The debug feature causes MMIO reads to a disabled AFU to respond with
0xDEADB00F instead of all Fs. In general this should not be visible as
the kernel will only allow MMIO access to enabled AFUs, but there may be
some circumstances where an AFU may become disabled while it is use.
One such case would be an AFU designed to only be used in the dedicated
process mode and to disable itself after it has completed it's work
(however even in that case the effects of this debug flag would be
limited as the userspace application must have completed any required
MMIO accesses before the AFU disables itself with or without the flag).

This patch removes the debug flag and replaces the magic value
programmed into this register with a preprocessor define so it is
clearer what the rest of this initialisation does.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/misc/cxl/cxl.h
drivers/misc/cxl/pci.c

index 28078f8894a5bee9270542d9c7d1c20992ff711a..0df04380bfd63b9c76e54fd2c230f84812e296b8 100644 (file)
@@ -287,6 +287,13 @@ static const cxl_p2n_reg_t CXL_PSL_WED_An     = {0x0A0};
 #define CXL_PE_SOFTWARE_STATE_S (1ul << (31 - 30)) /* Suspend */
 #define CXL_PE_SOFTWARE_STATE_T (1ul << (31 - 31)) /* Terminate */
 
+/****** CXL_PSL_RXCTL_An (Implementation Specific) **************************
+ * Controls AFU Hang Pulse, which sets the timeout for the AFU to respond to
+ * the PSL for any response (except MMIO). Timeouts will occur between 1x to 2x
+ * of the hang pulse frequency.
+ */
+#define CXL_PSL_RXCTL_AFUHP_4S      0x7000000000000000ULL
+
 /* SPA->sw_command_status */
 #define CXL_SPA_SW_CMD_MASK         0xffff000000000000ULL
 #define CXL_SPA_SW_CMD_TERMINATE    0x0001000000000000ULL
index 0f2cc9f8b4dbcd456bbccfab21bf3124f660e6be..2ccd0a91d486e1aa1f9078fe7dc97e33ac8de22c 100644 (file)
@@ -348,7 +348,7 @@ static int init_implementation_afu_regs(struct cxl_afu *afu)
        cxl_p1n_write(afu, CXL_PSL_COALLOC_A, 0xFF000000FEFEFEFEULL);
        /* for debugging with trace arrays */
        cxl_p1n_write(afu, CXL_PSL_SLICE_TRACE, 0x0000FFFF00000000ULL);
-       cxl_p1n_write(afu, CXL_PSL_RXCTL_A, 0xF000000000000000ULL);
+       cxl_p1n_write(afu, CXL_PSL_RXCTL_A, CXL_PSL_RXCTL_AFUHP_4S);
 
        return 0;
 }