diff options
author | Pavel Skripkin <paskripkin@gmail.com> | 2022-07-06 16:28:45 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-07-07 18:05:36 -0700 |
commit | f46fd3d7c3bd5d7bd5bb664135cf32ca9e97190b (patch) | |
tree | 64d8562125d0d478f85ef4eab65e8f28ce8678cd /kernel/sysctl.c | |
parent | fe5235aef8558573c1d225199be3aaa7bcd22943 (diff) | |
download | linux-f46fd3d7c3bd5d7bd5bb664135cf32ca9e97190b.tar.gz |
net: ocelot: fix wrong time_after usage
Accidentally noticed, that this driver is the only user of
while (time_after(jiffies...)).
It looks like typo, because likely this while loop will finish after 1st
iteration, because time_after() returns true when 1st argument _is after_
2nd one.
There is one possible problem with this poll loop: the scheduler could put
the thread to sleep, and it does not get woken up for
OCELOT_FDMA_CH_SAFE_TIMEOUT_US. During that time, the hardware has done
its thing, but you exit the while loop and return -ETIMEDOUT.
Fix it by using sane poll API that avoids all problems described above
Fixes: 753a026cfec1 ("net: ocelot: add FDMA support")
Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20220706132845.27968-1-paskripkin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'kernel/sysctl.c')
0 files changed, 0 insertions, 0 deletions