mirror of
https://github.com/torvalds/linux.git
synced 2026-10-24 16:55:02 +02:00
net: sparx5: start the TOD counters on non-PTP lan969x variants
Currently the base non-PTP-capable lan969x variants don't forward any
Ethernet frames:
$ ip link set eth10 up
$ ip addr add 10.0.0.54/24 dev eth10
$ ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1): 56 data bytes
--- 10.0.0.1 ping statistics ---
7 packets transmitted, 0 packets received, 100% packet loss
$ cat /proc/interrupts | grep fdma
20: 0 GIC-0 120 Level sparx5-fdma
$ ip -s link show dev eth10
RX: bytes packets errors dropped missed mcast
20828 102 0 0 0 72
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
Testing showed that starting the domain 0 TOD counter gets networking
working again, but start all three for consistency with the PTP variants.
Fixes: 207966787b ("net: sparx5: add feature support")
Suggested-by: Daniel Machon <daniel.machon@microchip.com>
Signed-off-by: Quentin Freimanis <quentin@q-lab.dev>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Link: https://patch.msgid.link/20261005052826.14251-1-quentin@q-lab.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
588003f740
commit
ca5012757b
|
|
@ -622,18 +622,9 @@ int sparx5_ptp_init(struct sparx5 *sparx5)
|
|||
sparx5->ptp = 1;
|
||||
}
|
||||
|
||||
if (!sparx5->ptp)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < SPARX5_PHC_COUNT; ++i) {
|
||||
err = sparx5_ptp_phc_init(sparx5, i, &sparx5_ptp_clock_info);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
spin_lock_init(&sparx5->ptp_clock_lock);
|
||||
spin_lock_init(&sparx5->ptp_ts_id_lock);
|
||||
mutex_init(&sparx5->ptp_lock);
|
||||
/* The base, non-PTP-capable lan969x variants need the
|
||||
* first TOD counter running to forward frames.
|
||||
*/
|
||||
|
||||
/* Disable master counters */
|
||||
spx5_wr(PTP_PTP_DOM_CFG_PTP_ENA_SET(0), sparx5, PTP_PTP_DOM_CFG);
|
||||
|
|
@ -657,6 +648,19 @@ int sparx5_ptp_init(struct sparx5 *sparx5)
|
|||
/* Enable master counters */
|
||||
spx5_wr(PTP_PTP_DOM_CFG_PTP_ENA_SET(0x7), sparx5, PTP_PTP_DOM_CFG);
|
||||
|
||||
if (!sparx5->ptp)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < SPARX5_PHC_COUNT; ++i) {
|
||||
err = sparx5_ptp_phc_init(sparx5, i, &sparx5_ptp_clock_info);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
spin_lock_init(&sparx5->ptp_clock_lock);
|
||||
spin_lock_init(&sparx5->ptp_ts_id_lock);
|
||||
mutex_init(&sparx5->ptp_lock);
|
||||
|
||||
for (i = 0; i < sparx5->data->consts->n_ports; i++) {
|
||||
port = sparx5->ports[i];
|
||||
if (!port)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user