diff options
author | Yangbo Lu <yangbo.lu@nxp.com> | 2020-04-20 05:46:46 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-22 01:38:33 +0300 |
commit | d2b09a8e7bcbfa47e7161b20d6387ac968834c21 (patch) | |
tree | 14ee7bfce1fec21e161af940ef1c99d0db83f6d9 /drivers/net/ethernet/mscc | |
parent | 2b49d128b3f8d8fff8972afcbc603802e5e40c6a (diff) | |
download | linux-d2b09a8e7bcbfa47e7161b20d6387ac968834c21.tar.xz |
net: mscc: ocelot: fix timestamp info if ptp clock does not work
The timestamp info should be only software timestamp capabilities
if ptp clock does not work.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mscc')
-rw-r--r-- | drivers/net/ethernet/mscc/ocelot.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c index 7c4165af9f66..a2b9b85612a4 100644 --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -1349,6 +1349,12 @@ int ocelot_get_ts_info(struct ocelot *ocelot, int port, { info->phc_index = ocelot->ptp_clock ? ptp_clock_index(ocelot->ptp_clock) : -1; + if (info->phc_index == -1) { + info->so_timestamping |= SOF_TIMESTAMPING_TX_SOFTWARE | + SOF_TIMESTAMPING_RX_SOFTWARE | + SOF_TIMESTAMPING_SOFTWARE; + return 0; + } info->so_timestamping |= SOF_TIMESTAMPING_TX_SOFTWARE | SOF_TIMESTAMPING_RX_SOFTWARE | SOF_TIMESTAMPING_SOFTWARE | |