switchtec: Fix unintended mask of MRPC event
authorWesley Sheng <wesley.sheng@microchip.com>
Mon, 15 Apr 2019 14:41:42 +0000 (22:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Jun 2019 09:54:07 +0000 (11:54 +0200)
commit31aa2a7a8566fac337d976d9da62d12cfafa8611
tree600c27ca609c38609d941107be7d3a28175d0e82
parent4b19a45eed4d32ca9ec50da0ebc4ea582032e331
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>
drivers/pci/switch/switchtec.c