]> git.baikalelectronics.ru Git - kernel.git/commit
fec: Restart PPS after link state change
authorCsókás Bence <csokas.bence@prolan.hu>
Mon, 22 Aug 2022 08:10:52 +0000 (10:10 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Aug 2022 08:53:23 +0000 (09:53 +0100)
commitd5ac4b096fd36a6c59aba7505b52abc4a44231ab
tree78b7f0a580e019138316ca0cad88a4d10369a254
parenteea330edf3adff6142bee1caf06d9f4978f00019
fec: Restart PPS after link state change

On link state change, the controller gets reset,
causing PPS to drop out and the PHC to lose its
time and calibration. So we restart it if needed,
restoring calibration and time registers.

Changes since v2:
* Add `fec_ptp_save_state()`/`fec_ptp_restore_state()`
* Use `ktime_get_real_ns()`
* Use `BIT()` macro
Changes since v1:
* More ECR #define's
* Stop PPS in `fec_ptp_stop()`

Signed-off-by: Csókás Bence <csokas.bence@prolan.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec.h
drivers/net/ethernet/freescale/fec_main.c
drivers/net/ethernet/freescale/fec_ptp.c