[PATCH net-next 14/14] net: ethernet: mtk_eth_soc: use iopoll.h macro for DMA init

Andrew Lunn andrew at lunn.ch
Thu Apr 22 13:20:48 BST 2021


On Wed, Apr 21, 2021 at 09:09:14PM -0700, Ilya Lipnitskiy wrote:
> Replace a tight busy-wait loop without a pause with a standard
> readx_poll_timeout_atomic routine with a 5 us poll period.
> 
> Tested by booting a MT7621 device to ensure the driver initializes
> properly.
> 
> Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy at gmail.com>
> ---
>  drivers/net/ethernet/mediatek/mtk_eth_soc.c | 29 +++++++++------------
>  drivers/net/ethernet/mediatek/mtk_eth_soc.h |  2 +-
>  2 files changed, 14 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> index 8c863322587e..720d73d0c007 100644
> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> @@ -2037,25 +2037,22 @@ static int mtk_set_features(struct net_device *dev, netdev_features_t features)
>  /* wait for DMA to finish whatever it is doing before we start using it again */
>  static int mtk_dma_busy_wait(struct mtk_eth *eth)
>  {
> -	unsigned long t_start = jiffies;
> +	u32 val;
> +	int ret;
> +	unsigned int reg;

Nit:

Reverse christmass tree.

Reviewed-by: Andrew Lunn <andrew at lunn.ch>

    Andrew



More information about the linux-arm-kernel mailing list