diff options
author | Jonathan Corbet <corbet@lwn.net> | 2016-12-27 12:53:44 -0700 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2016-12-27 12:53:44 -0700 |
commit | 54ab6db0909061ab7ee07233d3cab86d29f86e6c (patch) | |
tree | a7650ab5c0fa3a6a3841de8e8693041b3e009054 /drivers/misc/cxl/native.c | |
parent | 217e2bfab22e740227df09f22165e834cddd8a3b (diff) | |
parent | 7ce7d89f48834cefece7804d38fc5d85382edf77 (diff) |
Merge tag 'v4.10-rc1' into docs-next
Linux 4.10-rc1
Diffstat (limited to 'drivers/misc/cxl/native.c')
-rw-r--r-- | drivers/misc/cxl/native.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c index a217a74ccc98..09505f432eda 100644 --- a/drivers/misc/cxl/native.c +++ b/drivers/misc/cxl/native.c @@ -10,7 +10,6 @@ #include <linux/spinlock.h> #include <linux/sched.h> #include <linux/slab.h> -#include <linux/sched.h> #include <linux/mutex.h> #include <linux/mm.h> #include <linux/uaccess.h> @@ -54,7 +53,7 @@ static int afu_control(struct cxl_afu *afu, u64 command, u64 clear, AFU_Cntl | command); cpu_relax(); AFU_Cntl = cxl_p2n_read(afu, CXL_AFU_Cntl_An); - }; + } if (AFU_Cntl & CXL_AFU_Cntl_An_RA) { /* @@ -167,7 +166,7 @@ int cxl_psl_purge(struct cxl_afu *afu) cpu_relax(); } PSL_CNTL = cxl_p1n_read(afu, CXL_PSL_SCNTL_An); - }; + } end = local_clock(); pr_devel("PSL purged in %lld ns\n", end - start); @@ -931,9 +930,18 @@ static irqreturn_t native_irq_multiplexed(int irq, void *data) struct cxl_afu *afu = data; struct cxl_context *ctx; struct cxl_irq_info irq_info; - int ph = cxl_p2n_read(afu, CXL_PSL_PEHandle_An) & 0xffff; - int ret; - + u64 phreg = cxl_p2n_read(afu, CXL_PSL_PEHandle_An); + int ph, ret; + + /* check if eeh kicked in while the interrupt was in flight */ + if (unlikely(phreg == ~0ULL)) { + dev_warn(&afu->dev, + "Ignoring slice interrupt(%d) due to fenced card", + irq); + return IRQ_HANDLED; + } + /* Mask the pe-handle from register value */ + ph = phreg & 0xffff; if ((ret = native_get_irq_info(afu, &irq_info))) { WARN(1, "Unable to get CXL IRQ Info: %i\n", ret); return fail_psl_irq(afu, &irq_info); |