Skip to content

Commit 779a13c

Browse files
committed
qed: put cond_resched() in qed_dmae_operation_wait()
jira LE-2177 Rebuild_History Non-Buildable kernel-5.14.0-503.19.1.el9_5 commit-author Michal Schmidt <[email protected]> commit 2efeaf1 It is OK to sleep in qed_dmae_operation_wait, because it is called only in process context, while holding p_hwfn->dmae_info.mutex from one of the qed_dmae_{host,grc}2{host,grc} functions. The udelay(DMAE_MIN_WAIT_TIME=2) in the function is too short to replace with usleep_range, but at least it's a suitable point for checking if we should give up the CPU with cond_resched(). This lowers the latency caused by 'ethtool -d' from 10 ms to less than 2 ms on my test system with voluntary preemption. 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 2efeaf1) Signed-off-by: Jonathan Maple <[email protected]>
1 parent aa2940a commit 779a13c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,7 @@ static int qed_dmae_operation_wait(struct qed_hwfn *p_hwfn)
578578
barrier();
579579
while (*p_hwfn->dmae_info.p_completion_word != DMAE_COMPLETION_VAL) {
580580
udelay(DMAE_MIN_WAIT_TIME);
581+
cond_resched();
581582
if (++wait_cnt > wait_cnt_limit) {
582583
DP_NOTICE(p_hwfn->cdev,
583584
"Timed-out waiting for operation to complete. Completion word is 0x%08x expected 0x%08x.\n",

0 commit comments

Comments
 (0)