Skip to content

Commit

Permalink
dpaa2-eth: Initialize mutex used in one step timestamping path
Browse files Browse the repository at this point in the history
commit 07dd448 upstream.

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: c552118 ("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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Radu Bulie authored and gregkh committed Feb 23, 2022
1 parent 50f3b00 commit 016e3ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
Expand Up @@ -4225,7 +4225,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);

/* Obtain a MC portal */
Expand Down

0 comments on commit 016e3ca

Please sign in to comment.