netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] dpaa2-eth: Initialize mutex used in one step timestamping path
@ 2022-02-14 17:45 Radu Bulie
  2022-02-14 19:17 ` Ioana Ciornei
  2022-02-15 14:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Radu Bulie @ 2022-02-14 17:45 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, ioana.ciornei, yangbo.lu, Radu Bulie

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@nxp.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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] dpaa2-eth: Initialize mutex used in one step timestamping path
  2022-02-14 17:45 [PATCH net] dpaa2-eth: Initialize mutex used in one step timestamping path Radu Bulie
@ 2022-02-14 19:17 ` Ioana Ciornei
  2022-02-15 14:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Ioana Ciornei @ 2022-02-14 19:17 UTC (permalink / raw)
  To: Radu-Andrei Bulie
  Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org,
	Y.B. Lu

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@nxp.com>

Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.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
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] dpaa2-eth: Initialize mutex used in one step timestamping path
  2022-02-14 17:45 [PATCH net] dpaa2-eth: Initialize mutex used in one step timestamping path Radu Bulie
  2022-02-14 19:17 ` Ioana Ciornei
@ 2022-02-15 14:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-02-15 14:40 UTC (permalink / raw)
  To: Radu Bulie; +Cc: davem, kuba, netdev, ioana.ciornei, yangbo.lu

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Mon, 14 Feb 2022 19:45:34 +0200 you 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.
> 
> [...]

Here is the summary with links:
  - [net] dpaa2-eth: Initialize mutex used in one step timestamping path
    https://git.kernel.org/netdev/net/c/07dd44852be8

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-15 14:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-14 17:45 [PATCH net] dpaa2-eth: Initialize mutex used in one step timestamping path Radu Bulie
2022-02-14 19:17 ` Ioana Ciornei
2022-02-15 14:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).