aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/cxl/native.c
diff options
context:
space:
mode:
authorVaibhav Jain <vaibhav@linux.vnet.ibm.com>2016-11-16 09:09:33 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2016-11-18 06:41:08 -0500
commitabf051be684be768c1ee079514f4d07de9389d54 (patch)
tree5bcd7e8bfb5fa072fee64a2bcc15c6f9631a1a79 /drivers/misc/cxl/native.c
parentbb81733de28c99e10b61dcaff1592142abe53442 (diff)
cxl: Do adapter fence check before handling afu interrupt
If an afu interrupt is in flight when an eeh error is triggered the control still reaches the function native_irq_multiplexed and the PE-Handle read from the CXL_PSL_PEHandle_An register is 0xffff. The function then erroneously assumes that the interrupt belonged to a detached context and generates a warning with full stack dump in the kernel log complaining: "Unable to demultiplex CXL PSL IRQ for PE 65535 DSISR ffffffff DAR ffffffff. (Possible AFU HW issue - was a term/remove acked with outstanding transactions" To fix this the patch adds new code to the function native_irq_multiplexed function to compares the read value of register CXL_PSL_PEHandle_An to ~0ULL. If true then logs a warning message saying that the interrupt is being ignored and returns IRQ_HANDLED from the irq handler. Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Acked-by: Ian Munsie <imunsie@au1.ibm.com> Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/misc/cxl/native.c')
-rw-r--r--drivers/misc/cxl/native.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c
index a217a74ccc98..c336350ede94 100644
--- a/drivers/misc/cxl/native.c
+++ b/drivers/misc/cxl/native.c
@@ -931,9 +931,18 @@ static irqreturn_t native_irq_multiplexed(int irq, void *data)
931 struct cxl_afu *afu = data; 931 struct cxl_afu *afu = data;
932 struct cxl_context *ctx; 932 struct cxl_context *ctx;
933 struct cxl_irq_info irq_info; 933 struct cxl_irq_info irq_info;
934 int ph = cxl_p2n_read(afu, CXL_PSL_PEHandle_An) & 0xffff; 934 u64 phreg = cxl_p2n_read(afu, CXL_PSL_PEHandle_An);
935 int ret; 935 int ph, ret;
936 936
937 /* check if eeh kicked in while the interrupt was in flight */
938 if (unlikely(phreg == ~0ULL)) {
939 dev_warn(&afu->dev,
940 "Ignoring slice interrupt(%d) due to fenced card",
941 irq);
942 return IRQ_HANDLED;
943 }
944 /* Mask the pe-handle from register value */
945 ph = phreg & 0xffff;
937 if ((ret = native_get_irq_info(afu, &irq_info))) { 946 if ((ret = native_get_irq_info(afu, &irq_info))) {
938 WARN(1, "Unable to get CXL IRQ Info: %i\n", ret); 947 WARN(1, "Unable to get CXL IRQ Info: %i\n", ret);
939 return fail_psl_irq(afu, &irq_info); 948 return fail_psl_irq(afu, &irq_info);