Skip to content

Commit e2f9baa

Browse files
author
Kelvin Cao
committed
Remove immediate status check after submit a MRPC command
After submit a Firmware Download (Download sub-command) MRPC command, switchtec firmware refuses to response any management EP's BAR access until current flash programming finished. During this time, a READ TLP to the gas area in the BAR of the management EP will complete with significant delay like more than 10ms. It's a switchtec firmware limitation that READ requests cannot get prompt service during firmware download. The delayed completion of READ TLP would be a problem on some system which is sensitive to READ timeout. Current driver check status immediately after submit a MRPC command, which triggers READ TLP to the gas area in the BAR of the management EP. Also, other processes or functions, like NTB, would also trigger READ TLP by accessing the GAS. To avoid this, the immediate check of status is removed in this patch, and driver delays the status check to the occurrence of MSIx or MRPC timeout. In the meanwhile, user must not initiate any gas access during a firmware download. Also, any process that issues MRPC command will be affected by the delay in this patch. However, this is only a software workaround to the READ issue in firmware download. A complete fix of this should happen in firmware. Note: For NTB function, the memory window access is handled by switchtec hardware. So it's not affected by this firmware limitation. But the GAS accesses, like for doorbell registers, in the NTB function are affected by this firmware limitation.
1 parent 1d8f62d commit e2f9baa

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

switchtec.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,6 @@ static void mrpc_cmd_submit(struct switchtec_dev *stdev)
142142
stuser->data, stuser->data_len);
143143
iowrite32(stuser->cmd, &stdev->mmio_mrpc->cmd);
144144

145-
stuser->status = ioread32(&stdev->mmio_mrpc->status);
146-
if (stuser->status != SWITCHTEC_MRPC_STATUS_INPROGRESS)
147-
mrpc_complete_cmd(stdev);
148-
149145
schedule_delayed_work(&stdev->mrpc_timeout,
150146
msecs_to_jiffies(500));
151147
}

0 commit comments

Comments
 (0)