[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250908154426.3062861-4-niklas.soderlund+renesas@ragnatech.se>
Date: Mon, 8 Sep 2025 17:44:26 +0200
From: Niklas Söderlund <niklas.soderlund+renesas@...natech.se>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Richard Cochran <richardcochran@...il.com>,
netdev@...r.kernel.org,
linux-renesas-soc@...r.kernel.org
Cc: Niklas Söderlund <niklas.soderlund+renesas@...natech.se>
Subject: [PATCH 3/3] net: ethernet: renesas: rcar_gen4_ptp: Use lockdep to verify internal usage
Instead of a having a comment that the lock must be held when calling
the internal helper add a lockdep check to enforce it.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@...natech.se>
---
drivers/net/ethernet/renesas/rcar_gen4_ptp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
index cf13eba9b65e..d0979abd36de 100644
--- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
+++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
@@ -42,12 +42,13 @@ static int rcar_gen4_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
return 0;
}
-/* Caller must hold the lock */
static void _rcar_gen4_ptp_gettime(struct ptp_clock_info *ptp,
struct timespec64 *ts)
{
struct rcar_gen4_ptp_private *ptp_priv = ptp_to_priv(ptp);
+ lockdep_assert_held(&ptp_priv->lock);
+
ts->tv_nsec = ioread32(ptp_priv->addr + PTPGPTPTM00_REG);
ts->tv_sec = ioread32(ptp_priv->addr + PTPGPTPTM10_REG) |
((s64)ioread32(ptp_priv->addr + PTPGPTPTM20_REG) << 32);
--
2.51.0
Powered by blists - more mailing lists