Skip to content

Commit 4902d32

Browse files
committed
qed: allow the callee of qed_mcp_nvm_read() to sleep
jira LE-2177 Rebuild_History Non-Buildable kernel-5.14.0-503.19.1.el9_5 commit-author Michal Schmidt <[email protected]> commit cf54ae6 qed_mcp_nvm_read has a loop where it calls qed_mcp_nvm_rd_cmd with the argument b_can_sleep=false. And it sleeps once every 0x1000 bytes read. Simplify this by letting qed_mcp_nvm_rd_cmd itself sleep (b_can_sleep=true). It will have slept at least once when successful (in the "Wait for the MFW response" loop). So the extra sleep once every 0x1000 bytes becomes superfluous. Delete it. On my test system with voluntary preemption, this lowers the latency caused by 'ethtool -d' from 53 ms to 10 ms. Signed-off-by: Michal Schmidt <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> (cherry picked from commit cf54ae6) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 1886a66 commit 4902d32

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

drivers/net/ethernet/qlogic/qed/qed_mcp.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3079,20 +3079,13 @@ int qed_mcp_nvm_read(struct qed_dev *cdev, u32 addr, u8 *p_buf, u32 len)
30793079
DRV_MB_PARAM_NVM_LEN_OFFSET),
30803080
&resp, &resp_param,
30813081
&read_len,
3082-
(u32 *)(p_buf + offset), false);
3082+
(u32 *)(p_buf + offset), true);
30833083

30843084
if (rc || (resp != FW_MSG_CODE_NVM_OK)) {
30853085
DP_NOTICE(cdev, "MCP command rc = %d\n", rc);
30863086
break;
30873087
}
30883088

3089-
/* This can be a lengthy process, and it's possible scheduler
3090-
* isn't preemptible. Sleep a bit to prevent CPU hogging.
3091-
*/
3092-
if (bytes_left % 0x1000 <
3093-
(bytes_left - read_len) % 0x1000)
3094-
usleep_range(1000, 2000);
3095-
30963089
offset += read_len;
30973090
bytes_left -= read_len;
30983091
}

0 commit comments

Comments
 (0)