]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: sja1105: Restore PTP time after switch reset
authorVladimir Oltean <olteanv@gmail.com>
Sat, 9 Nov 2019 11:32:23 +0000 (13:32 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Nov 2019 20:45:30 +0000 (12:45 -0800)
commit41291773002ad104fa35f95f8613d06ed36d2a48
treef843ae1f84bfa4d33f3c79ed543d4088491c4bfd
parentc1d8691f9ffc1e7f9b8923e2606cfe7aaacf545a
net: dsa: sja1105: Restore PTP time after switch reset

The PTP time of the switch is not preserved when uploading a new static
configuration. Work around this hardware oddity by reading its PTP time
before a static config upload, and restoring it afterwards.

Static config changes are expected to occur at runtime even in scenarios
directly related to PTP, i.e. the Time-Aware Scheduler of the switch is
programmed in this way.

Perhaps the larger implication of this patch is that the PTP .gettimex64
and .settime functions need to be exposed to sja1105_main.c, where the
PTP lock needs to be held during this entire process. So their core
implementation needs to move to some common functions which get exposed
in sja1105_ptp.h.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105_main.c
drivers/net/dsa/sja1105/sja1105_ptp.c
drivers/net/dsa/sja1105/sja1105_ptp.h
drivers/net/dsa/sja1105/sja1105_spi.c