Skip to content

Commit 73fa459

Browse files
TropicaoPaolo Abeni
authored andcommitted
net: stmmac: fix dwmac1000 ptp timestamp status offset
When a PTP interrupt occurs, the driver accesses the wrong offset to learn about the number of available snapshots in the FIFO for dwmac1000: it should be accessing bits 29..25, while it is currently reading bits 19..16 (those are bits about the auxiliary triggers which have generated the timestamps). As a consequence, it does not compute correctly the number of available snapshots, and so possibly do not generate the corresponding clock events if the bogus value ends up being 0. Fix clock events generation by reading the correct bits in the timestamp register for dwmac1000. Fixes: 477c3e1 ("net: stmmac: Introduce dwmac1000 timestamping operations") Signed-off-by: Alexis Lothoré <[email protected]> Reviewed-by: Maxime Chevallier <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 607b310 commit 73fa459

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac1000.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ enum rtc_control {
320320

321321
/* PTP and timestamping registers */
322322

323-
#define GMAC3_X_ATSNS GENMASK(19, 16)
324-
#define GMAC3_X_ATSNS_SHIFT 16
323+
#define GMAC3_X_ATSNS GENMASK(29, 25)
324+
#define GMAC3_X_ATSNS_SHIFT 25
325325

326326
#define GMAC_PTP_TCR_ATSFC BIT(24)
327327
#define GMAC_PTP_TCR_ATSEN0 BIT(25)

0 commit comments

Comments
 (0)