OSDN Git Service

net: stmmac: fix ptp timestamping on Rx on gmac4
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Tue, 5 Feb 2019 12:15:20 +0000 (14:15 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Feb 2019 01:28:15 +0000 (17:28 -0800)
commit7d8e249f393a1aca30bde876e932401d2c78bc9f
tree3db680fc9b758ddc9a7883b74fceeceb88432062
parentbcd3d9d9246f35c62c5d652d20569a76dbdf4bd1
net: stmmac: fix ptp timestamping on Rx on gmac4

The current driver only enables Pdelay_Req and Pdelay_Resp when
HWTSTAMP_FILTER_PTP_V2_EVENT, HWTSTAMP_FILTER_PTP_V1_L4_EVENT or
HWTSTAMP_FILTER_PTP_V2_L4_EVENT is requested. This results in ptp sync on
slave mode to report 'received SYNC without timestamp' when using ptp4l.

Although the hardware can support Sync, Pdelay_Req and Pdelay_resp by
setting bit14 annd bits 17/16 to 01 this leaves Delay_Req timestamps out.

Fix this by enabling all event and general messages timestamps.
This includes SYNC, Follow_Up, Delay_Req, Delay_Resp, Pdelay_Req,
Pdelay_Resp and Pdelay_Resp_Follow_Up messages.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Jose Abreu <joabreu@synopsys.com>
Tested-by: Alexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h