summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWesley Sheng <wesley.sheng@microchip.com>2019-04-15 22:41:42 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-15 11:54:07 +0200
commit31aa2a7a8566fac337d976d9da62d12cfafa8611 (patch)
tree600c27ca609c38609d941107be7d3a28175d0e82
parent4b19a45eed4d32ca9ec50da0ebc4ea582032e331 (diff)
downloadlinux-stable-31aa2a7a8566fac337d976d9da62d12cfafa8611.tar.gz
linux-stable-31aa2a7a8566fac337d976d9da62d12cfafa8611.tar.bz2
linux-stable-31aa2a7a8566fac337d976d9da62d12cfafa8611.zip
switchtec: Fix unintended mask of MRPC event
[ Upstream commit 083c1b5e50b701899dc32445efa8b153685260d5 ] When running application tool switchtec-user's `firmware update` and `event wait` commands concurrently, sometimes the firmware update speed reduced significantly. It is because when the MRPC event happened after MRPC event occurrence check but before the event mask loop reaches its header register in event ISR, the MRPC event would be masked unintentionally. Since there's no chance to enable it again except for a module reload, all the following MRPC execution completion checks time out. Fix this bug by skipping the mask operation for MRPC event in event ISR, same as what we already do for LINK event. Fixes: 52eabba5bcdb ("switchtec: Add IOCTLs to the Switchtec driver") Signed-off-by: Wesley Sheng <wesley.sheng@microchip.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/pci/switch/switchtec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
index 37d0c15c9eeb..72db2e0ebced 100644
--- a/drivers/pci/switch/switchtec.c
+++ b/drivers/pci/switch/switchtec.c
@@ -1116,7 +1116,8 @@ static int mask_event(struct switchtec_dev *stdev, int eid, int idx)
if (!(hdr & SWITCHTEC_EVENT_OCCURRED && hdr & SWITCHTEC_EVENT_EN_IRQ))
return 0;
- if (eid == SWITCHTEC_IOCTL_EVENT_LINK_STATE)
+ if (eid == SWITCHTEC_IOCTL_EVENT_LINK_STATE ||
+ eid == SWITCHTEC_IOCTL_EVENT_MRPC_COMP)
return 0;
dev_dbg(&stdev->dev, "%s: %d %d %x\n", __func__, eid, idx, hdr);