dmaengine: idxd: fix interrupt completion after unmasking
authorDave Jiang <dave.jiang@intel.com>
Fri, 1 May 2020 15:21:18 +0000 (08:21 -0700)
committerVinod Koul <vkoul@kernel.org>
Mon, 4 May 2020 08:55:37 +0000 (14:25 +0530)
commit4f302642b70c1348773fe7e3ded9fc315fa92990
tree0df10b16fad5f35b8b1fe3a0c94102966aafc7d5
parentf8f482deb078389b42768b2193e050a81aae137d
dmaengine: idxd: fix interrupt completion after unmasking

The current implementation may miss completions after we unmask the
interrupt. In order to make sure we process all competions, we need to:
1. Do an MMIO read from the device as a barrier to ensure that all PCI
   writes for completions have arrived.
2. Check for any additional completions that we missed.

Fixes: 8f47d1a5e545 ("dmaengine: idxd: connect idxd to dmaengine subsystem")

Reported-by: Sanjay Kumar <sanjay.k.kumar@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/158834641769.35613.1341160109892008587.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/idxd/device.c
drivers/dma/idxd/irq.c