Skip to content

ptp: convert remaining users of .adjfreq

Jacob Keller netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 3 repliesIn review 8 of 9 applied

Patches in v1 8 of 9 applied

#Subject and filesSizeRepliesApplied
1/9ptp_phc: convert .adjfreq to .adjfinedrivers/ptp/ptp_pch.c+4 -150 repliesApplied
2/9ptp_ixp46x: convert .adjfreq to .adjfinedrivers/net/ethernet/xscale/ptp_ixp46x.c+4 -151 replyApplied
3/9ptp: tg3: convert .adjfreq to .adjfinedrivers/net/ethernet/broadcom/tg3.c+7 -151 replyApplied
4/9ptp: hclge: convert .adjfreq to .adjfinedrivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c+5 -170 repliesApplied
5/9ptp: stmac: convert .adjfreq to .adjfinedrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c+7 -160 replies
6/9ptp: cpts: convert .adjfreq to .adjfinedrivers/net/ethernet/ti/cpts.c+4 -160 repliesApplied
7/9ptp: bnxt: convert .adjfreq to .adjfinedrivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c+6 -161 replyApplied
8/9ptp: convert remaining drivers to adjfine interfacedrivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c drivers/net/ethernet/cavium/liquidio/lio_main.c drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c +6 more+50 -330 repliesApplied
9/9ptp: remove the .adjfreq interface functiondrivers/ptp/ptp_clock.c include/linux/ptp_clock_kernel.h+1 -110 repliesApplied

Reviews trailers per patch

3 of 9 patches have a Reviewed-by or Acked-by.

PatchPavan ChebbiLinus Walleij
1/9
2/9R-b
3/9R-b
4/9
5/9
6/9
7/9R-b
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 0/9] ptp: convert remaining users of .adjfreq

A handful of drivers remain which still use the .adjfreq interface instead of the newer .adjfine interface. The new interface is preferred as it has a more precise adjustment using scaled parts per million.

A handful of the remaining drivers are implemented with a common pattern that can be refactored to use the adjust_by_scaled_ppm and diff_by_scaled_ppm helper functions. These include the ptp_phc, ptp_ixp64x, tg3, hclge, stmac, cpts and bnxt drivers. These are each refactored in a separate change.

The remaining drivers, bnx2x, liquidio, cxgb4, fec, and qede implement .adjfreq in a way different from the normal pattern expected by adjust_by_scaled_ppm. Fixing these drivers to properly use .adjfine requires specific knowledge of the hardware implementation. Instead I simply refactor them to use .adjfine and convert scaled_ppm into ppb using the scaled_ppm_to_ppb function.

Finally, the .adjfreq implementation interface is removed entirely. This simplifies the interface and ensures that new drivers must implement the new interface as they no longer have an alternative.

This still leaves parts per billion used as part of the max_adj interface, and the core PTP stack still converts scaled_ppm to ppb to check this. I plan to investigate fixing this in the future.

Jacob Keller (9):
ptp_phc: convert .adjfreq to .adjfine
ptp_ixp46x: convert .adjfreq to .adjfine
ptp: tg3: convert .adjfreq to .adjfine
ptp: hclge: convert .adjfreq to .adjfine
ptp: stmac: convert .adjfreq to .adjfine
ptp: cpts: convert .adjfreq to .adjfine
ptp: bnxt: convert .adjfreq to .adjfine
ptp: convert remaining drivers to adjfine interface
ptp: remove the .adjfreq interface function

 .../net/ethernet/broadcom/bnx2x/bnx2x_main.c  |  9 ++++----
 drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 22 +++++-------------
 drivers/net/ethernet/broadcom/tg3.c           | 22 ++++++------------
 .../net/ethernet/cavium/liquidio/lio_main.c   | 11 +++++----
 .../net/ethernet/chelsio/cxgb4/cxgb4_ptp.c    | 13 +++++++----
 drivers/net/ethernet/freescale/fec_ptp.c      | 13 +++++++----
 .../hisilicon/hns3/hns3pf/hclge_ptp.c         | 22 ++++--------------
 drivers/net/ethernet/qlogic/qede/qede_ptp.c   | 13 +++++++----
 drivers/net/ethernet/sfc/ptp.c                |  7 +++---
 drivers/net/ethernet/sfc/siena/ptp.c          |  7 +++---
 .../net/ethernet/stmicro/stmmac/stmmac_ptp.c  | 23 ++++++-------------
 drivers/net/ethernet/ti/am65-cpts.c           |  5 ++--
 drivers/net/ethernet/ti/cpts.c                | 20 ++++------------
 drivers/net/ethernet/xscale/ptp_ixp46x.c      | 19 ++++-----------
 drivers/ptp/ptp_clock.c                       |  5 +---
 drivers/ptp/ptp_dte.c                         |  5 ++--
 drivers/ptp/ptp_pch.c                         | 19 ++++-----------
 include/linux/ptp_clock_kernel.h              |  7 ------
 18 files changed, 88 insertions(+), 154 deletions(-)

base-commit: 154ba79c9f160e652a2c9c46435b928b3bfae11f

Signature · 1 line
2.38.0.83.gd420dda05763