summaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/sja1105/sja1105_main.c
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2021-12-10 01:34:43 +0200
committerDavid S. Miller <davem@davemloft.net>2021-12-12 12:51:33 +0000
commit22ee9f8e4011fb8a6d75dc2f9a43360d4f400235 (patch)
tree6ac48e901ccbccf6791ca9c78d6ae306f4f2e437 /drivers/net/dsa/sja1105/sja1105_main.c
parentbfcf1425222008e7390c0784b0f3bb7b497fccaa (diff)
downloadlinux-stable-22ee9f8e4011fb8a6d75dc2f9a43360d4f400235.tar.gz
linux-stable-22ee9f8e4011fb8a6d75dc2f9a43360d4f400235.tar.bz2
linux-stable-22ee9f8e4011fb8a6d75dc2f9a43360d4f400235.zip
net: dsa: sja1105: move ts_id from sja1105_tagger_data
The TX timestamp ID is incremented by the SJA1110 PTP timestamping callback (->port_tx_timestamp) for every packet, when cloning it. It isn't used by the tagger at all, even though it sits inside the struct sja1105_tagger_data. Also, serialization to this structure is currently done through tagger_data->meta_lock, which is a cheap hack because the meta_lock isn't used for anything else on SJA1110 (sja1105_rcv_meta_state_machine isn't called). This change moves ts_id from sja1105_tagger_data to sja1105_private and introduces a dedicated spinlock for it, also in sja1105_private. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/sja1105/sja1105_main.c')
-rw-r--r--drivers/net/dsa/sja1105/sja1105_main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c
index e7a6cc7f681c..880f28ea184f 100644
--- a/drivers/net/dsa/sja1105/sja1105_main.c
+++ b/drivers/net/dsa/sja1105/sja1105_main.c
@@ -3348,6 +3348,7 @@ static int sja1105_probe(struct spi_device *spi)
mutex_init(&priv->ptp_data.lock);
mutex_init(&priv->dynamic_config_lock);
mutex_init(&priv->mgmt_lock);
+ spin_lock_init(&priv->ts_id_lock);
rc = sja1105_parse_dt(priv);
if (rc < 0) {