[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220214191701.4vlzqfbng4s22wlf@skbuf>
Date: Mon, 14 Feb 2022 19:17:01 +0000
From: Ioana Ciornei <ioana.ciornei@....com>
To: Radu-Andrei Bulie <radu-andrei.bulie@....com>
CC: "davem@...emloft.net" <davem@...emloft.net>,
"kuba@...nel.org" <kuba@...nel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"Y.B. Lu" <yangbo.lu@....com>
Subject: Re: [PATCH net] dpaa2-eth: Initialize mutex used in one step
timestamping path
On Mon, Feb 14, 2022 at 07:45:34PM +0200, Radu Bulie wrote:
> 1588 Single Step Timestamping code path uses a mutex to
> enforce atomicity for two events:
> - update of ptp single step register
> - transmit ptp event packet
>
> Before this patch the mutex was not initialized. This
> caused unexpected crashes in the Tx function.
>
> Fixes: c55211892f463 ("dpaa2-eth: support PTP Sync packet one-step timestamping")
> Signed-off-by: Radu Bulie <radu-andrei.bulie@....com>
Reviewed-by: Ioana Ciornei <ioana.ciornei@....com>
> ---
> drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> index dd9385d15f6b..0f90d2d5bb60 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> @@ -4338,7 +4338,7 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
> }
>
> INIT_WORK(&priv->tx_onestep_tstamp, dpaa2_eth_tx_onestep_tstamp);
> -
> + mutex_init(&priv->onestep_tstamp_lock);
> skb_queue_head_init(&priv->tx_skbs);
>
> priv->rx_copybreak = DPAA2_ETH_DEFAULT_COPYBREAK;
> --
> 2.17.1
>
Powered by blists - more mailing lists