2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/drivers/net/ethernet/renesas
Jacob Keller d9f3e9ecc4 net: ptp: introduce .supported_perout_flags to ptp_clock_info
The PTP_PEROUT_REQUEST2 ioctl has gained support for flags specifying
specific output behavior including PTP_PEROUT_ONE_SHOT,
PTP_PEROUT_DUTY_CYCLE, PTP_PEROUT_PHASE.

Driver authors are notorious for not checking the flags of the request.
This results in misinterpreting the request, generating an output signal
that does not match the requested value. It is anticipated that even more
flags will be added in the future, resulting in even more broken requests.

Expecting these issues to be caught during review or playing whack-a-mole
after the fact is not a great solution.

Instead, introduce the supported_perout_flags field in the ptp_clock_info
structure. Update the core character device logic to explicitly reject any
request which has a flag not on this list.

This ensures that drivers must 'opt in' to the flags they support. Drivers
which don't set the .supported_perout_flags field will not need to check
that unsupported flags aren't passed, as the core takes care of this.

Update the drivers which do support flags to set this new field.

Note the following driver files set n_per_out to a non-zero value but did
not check the flags at all:

 • drivers/ptp/ptp_clockmatrix.c
 • drivers/ptp/ptp_idt82p33.c
 • drivers/ptp/ptp_fc3.c
 • drivers/net/ethernet/ti/am65-cpts.c
 • drivers/net/ethernet/aquantia/atlantic/aq_ptp.c
 • drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
 • drivers/net/dsa/sja1105/sja1105_ptp.c
 • drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c
 • drivers/net/ethernet/mscc/ocelot_vsc7514.c
 • drivers/net/ethernet/intel/i40e/i40e_ptp.c

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20250414-jk-supported-perout-flags-v2-2-f6b17d15475c@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-04-15 20:20:58 -07:00
..
Kconfig net: ethernet: rtsn: Add support for Renesas Ethernet-TSN 2024-06-21 12:24:54 +01:00
Makefile net: ethernet: rtsn: Add support for Renesas Ethernet-TSN 2024-06-21 12:24:54 +01:00
ravb_main.c net: ravb: Fix missing rtnl lock in suspend/resume path 2025-01-30 11:23:01 +01:00
ravb_ptp.c net: ptp: introduce .supported_perout_flags to ptp_clock_info 2025-04-15 20:20:58 -07:00
ravb.h net: ravb: Add VLAN checksum support 2024-10-17 21:24:25 -05:00
rcar_gen4_ptp.c net: ethernet: renesas: rcar_gen4_ptp: Remove bool conversion 2025-02-24 17:50:16 -08:00
rcar_gen4_ptp.h net: ethernet: renesas: rcar_gen4_ptp: Get clock increment from clock rate 2023-11-23 12:02:49 +01:00
rswitch.c net: renesas: rswitch: Convert to for_each_available_child_of_node() 2025-02-07 11:58:32 -08:00
rswitch.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-12-19 11:35:07 -08:00
rtsn.c net: ethernet: rtsn: fix potential memory leak in rtsn_start_xmit() 2024-10-15 10:59:29 -07:00
rtsn.h net: ethernet: rtsn: Add support for Renesas Ethernet-TSN 2024-06-21 12:24:54 +01:00
sh_eth.c net: sh_eth: Fix missing rtnl lock in suspend/resume path 2025-01-30 11:23:01 +01:00
sh_eth.h Revert "sh_eth: remove open coded netif_running()" 2023-03-28 19:23:32 -07:00