diff options
author | Thomas Petazzoni <[email protected]> | 2017-02-21 11:28:04 +0100 |
---|---|---|
committer | David S. Miller <[email protected]> | 2017-02-21 13:16:14 -0500 |
commit | ab42676af052e6d3502b31c2dc6b07af08ff126f (patch) | |
tree | 6581425291a2e1102bb18fbc9964c3192c33ad11 /scripts/gdb/linux/modules.py | |
parent | f8b0d5f8cc10f43642f97db6b37d60d765cff34a (diff) |
net: mvpp2: handle too large value in mvpp2_rx_time_coal_set()
When configuring the MVPP2_ISR_RX_THRESHOLD_REG with the RX coalescing
time threshold, we do not check for the maximum allowed value supported
by the driver, which means we might overflow and use a bogus value. This
commit adds a check for this situation, and if a value higher than what
is supported by the hardware is provided, then we use the maximum value
supported by the hardware.
In order to achieve this in a way that avoids overflow and rounding
errors, we introduce two utility functions mvpp2_usec_to_cycles() and
cycles_to_usec(). Many thanks to Russell King for suggesting this
implementation.
Signed-off-by: Thomas Petazzoni <[email protected]>
Acked-by: Russell King <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/modules.py')
0 files changed, 0 insertions, 0 deletions