Searched hist:f46fd3d7c3bd5d7bd5bb664135cf32ca9e97190b (Results 1 – 1 of 1) sorted by relevance
/linux/drivers/net/ethernet/mscc/ |
H A D | ocelot_fdma.c | diff f46fd3d7c3bd5d7bd5bb664135cf32ca9e97190b Wed Jul 06 15:28:45 CEST 2022 Pavel Skripkin <paskripkin@gmail.com> 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>
|