Skip to content

Commit 719d64c

Browse files
committed
switchtec: Fix unintended mask of MRPC event
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]>
1 parent 6f2fbfa commit 719d64c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

switchtec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,8 @@ static int mask_event(struct switchtec_dev *stdev, int eid, int idx)
11841184
if (!(hdr & SWITCHTEC_EVENT_OCCURRED && hdr & SWITCHTEC_EVENT_EN_IRQ))
11851185
return 0;
11861186

1187-
if (eid == SWITCHTEC_IOCTL_EVENT_LINK_STATE)
1187+
if (eid == SWITCHTEC_IOCTL_EVENT_LINK_STATE ||
1188+
eid == SWITCHTEC_IOCTL_EVENT_MRPC_COMP)
11881189
return 0;
11891190

11901191
dev_dbg(&stdev->dev, "%s: %d %d %x\n", __func__, eid, idx, hdr);

0 commit comments

Comments
 (0)