Message ID | 20211220120859.140453-3-radu-nicolae.pirea@oss.nxp.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [1/3] ptp: add PTP_PEROUT_REVERSE_POLARITY flag | expand |
On Mon, Dec 20, 2021 at 02:08:59PM +0200, Radu Pirea (NXP OSS) wrote: > The tx timestamps are read from only one place in interrupt or polling > mode. Locking the mutex is useless. You cannot take a mutex in an interrupt handler. So your description is probably not accurate. Is it safe for other ptp operations to be performed in parallel with reading the TX timestamp? _nxp_c45_ptp_settime64()? Andrew
On Mon, 2021-12-20 at 16:10 +0100, Andrew Lunn wrote: > On Mon, Dec 20, 2021 at 02:08:59PM +0200, Radu Pirea (NXP OSS) wrote: > > The tx timestamps are read from only one place in interrupt or > > polling > > mode. Locking the mutex is useless. > > You cannot take a mutex in an interrupt handler. So your description > is probably not accurate. Actually this is the second issue. I will improve the description. > > Is it safe for other ptp operations to be performed in parallel with > reading the TX timestamp? _nxp_c45_ptp_settime64()? Yes, it's safe. The purpose of the mutex is to protect the access to LTC(PTP counter). > > Andrew
diff --git a/drivers/net/phy/nxp-c45-tja11xx.c b/drivers/net/phy/nxp-c45-tja11xx.c index 74de66c90f24..5bd8c166d726 100644 --- a/drivers/net/phy/nxp-c45-tja11xx.c +++ b/drivers/net/phy/nxp-c45-tja11xx.c @@ -381,7 +381,6 @@ static bool nxp_c45_get_hwtxts(struct nxp_c45_phy *priv, bool valid; u16 reg; - mutex_lock(&priv->ptp_lock); phy_write_mmd(priv->phydev, MDIO_MMD_VEND1, VEND1_EGR_RING_CTRL, RING_DONE); reg = phy_read_mmd(priv->phydev, MDIO_MMD_VEND1, VEND1_EGR_RING_DATA_0); @@ -401,8 +400,6 @@ static bool nxp_c45_get_hwtxts(struct nxp_c45_phy *priv, hwts->sec |= (reg & RING_DATA_3_SEC_1_0) >> 14; nxp_c45_get_hwtxts_out: - mutex_unlock(&priv->ptp_lock); - return valid; }
The tx timestamps are read from only one place in interrupt or polling mode. Locking the mutex is useless. Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com> --- drivers/net/phy/nxp-c45-tja11xx.c | 3 --- 1 file changed, 3 deletions(-)