summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mscc/ocelot.c
diff options
context:
space:
mode:
authorYangbo Lu <yangbo.lu@nxp.com>2020-04-20 10:46:46 +0800
committerDavid S. Miller <davem@davemloft.net>2020-04-21 15:38:33 -0700
commitd2b09a8e7bcbfa47e7161b20d6387ac968834c21 (patch)
tree14ee7bfce1fec21e161af940ef1c99d0db83f6d9 /drivers/net/ethernet/mscc/ocelot.c
parent2b49d128b3f8d8fff8972afcbc603802e5e40c6a (diff)
downloadlinux-d2b09a8e7bcbfa47e7161b20d6387ac968834c21.tar.bz2
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/ocelot.c')
-rw-r--r--drivers/net/ethernet/mscc/ocelot.c6
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 |