]> Git Repo - linux.git/commit
bnxt_en: Improve the delay logic for firmware response.
authorMichael Chan <[email protected]>
Sun, 15 May 2016 07:04:47 +0000 (03:04 -0400)
committerDavid S. Miller <[email protected]>
Sun, 15 May 2016 17:35:48 +0000 (13:35 -0400)
commita11fa2be6d1564375dc57530680268ad569c2632
tree7804963efefe6d270c5d285726a228dac8f15416
parentd0a42d6fc8eaf1b64f62b0bbc3b829b756eacf57
bnxt_en: Improve the delay logic for firmware response.

The current code has 2 problems:

1. The maximum wait time is not long enough.  It is about 60% of the
duration specified by the firmware.  It is calling usleep_range(600, 800)
for every 1 msec we are supposed to wait.

2. The granularity of the delay is too coarse.  Many simple firmware
commands finish in 25 usec or less.

We fix these 2 issues by multiplying the original 1 msec loop counter by
40 and calling usleep_range(25, 40) for each iteration.

There is also a second delay loop to wait for the last DMA word to
complete.  This delay loop should be a very short 5 usec wait.

This change results in much faster bring-up/down time:

Before the patch:

time ip link set p4p1 up

real    0m0.120s
user    0m0.001s
sys     0m0.009s

After the patch:

time ip link set p4p1 up

real    0m0.030s
user    0m0.000s
sys     0m0.010s

Signed-off-by: Michael Chan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
This page took 0.053369 seconds and 4 git commands to generate.