]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethernet: mediatek: ppe: fix busy wait loop
authorIlya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Fri, 16 Apr 2021 00:37:48 +0000 (17:37 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Apr 2021 22:24:18 +0000 (15:24 -0700)
commit31b12fb18eaa428f2d25e92969095ff1d0a51cec
treeef9f543739775393232be5240f90fd18f9b57db6
parent94f886db2cb4592cb65ecf1962e53c764f04aec8
net: ethernet: mediatek: ppe: fix busy wait loop

The intention is for the loop to timeout if the body does not succeed.
The current logic calls time_is_before_jiffies(timeout) which is false
until after the timeout, so the loop body never executes.

Fix by using readl_poll_timeout as a more standard and less error-prone
solution.

Fixes: 3c678fdfc9d3 ("net: ethernet: mtk_eth_soc: add support for initializing the PPE")
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Cc: Felix Fietkau <nbd@nbd.name>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mediatek/mtk_ppe.c
drivers/net/ethernet/mediatek/mtk_ppe.h