]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bnxt_en: Improve the delay logic for firmware response.
authorMichael Chan <michael.chan@broadcom.com>
Sun, 15 May 2016 07:04:47 +0000 (03:04 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 7 Jul 2016 00:37:22 +0000 (17:37 -0700)
commitb03bdb6107301adc1c5982f740fb213732adcfe6
tree7680b6bbf3d11a4bbadedd79151376710ec0d701
parent1cb39dd18379920d8fec7f939a46c9a08b9bbcd6
bnxt_en: Improve the delay logic for firmware response.

Orabug: 23221795

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 <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit a11fa2be6d1564375dc57530680268ad569c2632)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c