Skip to content

Commit

Permalink
switchtec: Fix unintended mask of MRPC event
Browse files Browse the repository at this point in the history
There exists a corner case: MRPC completion event happened
immediately after other non-MRPC event, moreover exactly right
after MRPC event occurrence check but before the mask event loop
reach to its header register in event ISR, the MRPC event would
be masked unintentionally. Since there's no chance to enable it
again except module remove and install, all the following MRPC
execution completion check will be defer to timeout.

Fix this bug by bypass the mask operation same as to LINK event
in event ISR.

This corner case was exposed by concurrently running fw-update
and event-wait commands of switchtec-user. When it happened,
firmware update speed reduce evidently.

Signed-off-by: Wesley Sheng <[email protected]>
  • Loading branch information
wesleywesley committed Jan 8, 2019
1 parent 6f2fbfa commit 719d64c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion switchtec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,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);
Expand Down

0 comments on commit 719d64c

Please sign in to comment.