]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipa: fix HOLB timer calculation
authorAlex Elder <elder@linaro.org>
Fri, 3 Jul 2020 21:23:35 +0000 (16:23 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Jul 2020 21:37:33 +0000 (14:37 -0700)
commit710761de0f215522acce3ac80f41e9adb8732068
treec286faac4ddf9238379a865e60c312bdf8e03284
parent257af3344014c0dd5ca6e2f8745e6d2e563ff5d8
net: ipa: fix HOLB timer calculation

For IPA v4.2, the exact interpretation of the register that defines
the timeout for avoiding head-of-line blocking was a little unclear.
We're only assigning a 0 timeout to it right now, so that wasn't
very important.  But now that I know how it's supposed to work, I'm
fixing it.

The register represents a tick counter, where each tick is equal to
128 IPA core clock cycles.  For IPA v3.5.1, the register contains
a simple counter value.  But for IPA v4.2, the register contains two
fields, base and scale, which approximate the tick counter as:
    ticks = base << scale
The base and scale values to use for a given tick count are computed
using clever bit operations, and measures are taken to make the
resulting time period as close as possible to that requested.

There's no need for ipa_endpoint_init_hol_block_timer() to return
an error, so change its return type to void.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/ipa_endpoint.c