mbox series

[net-next,v2,00/14] Add PCS core support

Message ID 20250407231746.2316518-1-sean.anderson@linux.dev (mailing list archive)
Headers show
Series Add PCS core support | expand

Message

Sean Anderson April 7, 2025, 11:17 p.m. UTC
This series adds support for creating PCSs as devices on a bus with a
driver (patch 3). As initial users,

- The Lynx PCS (and all of its users) is converted to this system (patch 5)
- The Xilinx PCS is broken out from the AXI Ethernet driver (patches 6-8)
- The Cadence MACB driver is converted to support external PCSs (namely
  the Xilinx PCS) (patches 9-10).

The last few patches add device links for pcs-handle to improve boot times,
and add compatibles for all Lynx PCSs.

This series depends on [1,2], and they have been included at the
beginning so CI will run. However, I expect them to be reviewed/applied
outside the net-next tree.

Care has been taken to ensure backwards-compatibility. The main source
of this is that many PCS devices lack compatibles and get detected as
PHYs. To address this, pcs_get_by_fwnode_compat allows drivers to edit
the devicetree to add appropriate compatibles.

There is another series [3] with the same goal by Christian Marangi. In
comparison, I believe this series

- Implements a simpler and more-robust method of PCS access.
- Provides a more-direct upgrade path for existing MAC and PCS drivers.

Due to popular demand, I have added support for #pcs-cells with this
revision.

[1] https://lore.kernel.org/all/20250407222134.2280553-1-sean.anderson@linux.dev/
[2] https://lore.kernel.org/all/20250407223714.2287202-1-sean.anderson@linux.dev/
[3] https://lore.kernel.org/netdev/20250406221423.9723-1-ansuelsmth@gmail.com/

Changes in v2:
- Add fallbacks for pcs_get* and pcs_put
- Add support for #pcs-cells
- Change base compatible to just xlnx,pcs
- Change compatible to just xlnx,pcs
- Defer devicetree updates for another series
- Drop #clock-cells description
- Drop PCS_ALTERA_TSE which was accidentally added while rebasing
- Move #clock-cells after compatible
- Move update to macb_pcs_get_state to previous patch
- Remove outdated comment
- Remove second example
- Remove unused variable
- Remove unused variable lynx_properties
- Rename pcs-modes to xlnx,pcs-modes
- Reorder pcs_handle to come before suffix props
- Reword commit message
- Rework xilinx_pcs_validate to just clear out half-duplex modes instead
  of constraining modes based on the interface.

Sean Anderson (13):
  dt-bindings: net: Add Xilinx PCS
  device property: Add optional nargs_prop for get_reference_args
  device property: Add fwnode_property_get_reference_optional_args
  scripts: kernel-doc: fix parsing function-like typedefs (again)
  net: phylink: Support setting PCS link change callbacks
  net: pcs: Add subsystem
  net: pcs: lynx: Convert to an MDIO driver
  net: phy: Export some functions
  net: pcs: Add Xilinx PCS driver
  net: axienet: Convert to use PCS subsystem
  net: macb: Move most of mac_config to mac_prepare
  net: macb: Support external PCSs
  of: property: Add device link support for PCS

Vladimir Oltean (1):
  net: dsa: ocelot: suppress PHY device scanning on the internal MDIO
    bus

 .../devicetree/bindings/net/xilinx,pcs.yaml   | 115 +++
 Documentation/networking/index.rst            |   1 +
 Documentation/networking/kapi.rst             |   4 +
 Documentation/networking/pcs.rst              | 107 +++
 MAINTAINERS                                   |   8 +
 drivers/base/property.c                       |  50 +-
 drivers/base/swnode.c                         |  13 +-
 drivers/net/dsa/ocelot/Kconfig                |   4 +
 drivers/net/dsa/ocelot/felix_vsc9959.c        |  15 +-
 drivers/net/dsa/ocelot/seville_vsc9953.c      |  16 +-
 drivers/net/ethernet/altera/Kconfig           |   2 +
 drivers/net/ethernet/altera/altera_tse_main.c |   7 +-
 drivers/net/ethernet/cadence/macb.h           |   1 +
 drivers/net/ethernet/cadence/macb_main.c      | 229 +++--
 drivers/net/ethernet/freescale/dpaa/Kconfig   |   2 +-
 drivers/net/ethernet/freescale/dpaa2/Kconfig  |   3 +
 .../net/ethernet/freescale/dpaa2/dpaa2-mac.c  |  11 +-
 drivers/net/ethernet/freescale/enetc/Kconfig  |   2 +
 .../net/ethernet/freescale/enetc/enetc_pf.c   |   8 +-
 .../net/ethernet/freescale/enetc/enetc_pf.h   |   1 -
 .../freescale/enetc/enetc_pf_common.c         |   4 +-
 drivers/net/ethernet/freescale/fman/Kconfig   |   4 +-
 .../net/ethernet/freescale/fman/fman_memac.c  |  27 +-
 drivers/net/ethernet/stmicro/stmmac/Kconfig   |   3 +
 .../ethernet/stmicro/stmmac/dwmac-socfpga.c   |   6 +-
 drivers/net/ethernet/xilinx/Kconfig           |   1 +
 drivers/net/ethernet/xilinx/xilinx_axienet.h  |   4 +-
 .../net/ethernet/xilinx/xilinx_axienet_main.c | 104 +--
 drivers/net/pcs/Kconfig                       |  45 +-
 drivers/net/pcs/Makefile                      |   4 +
 drivers/net/pcs/core.c                        | 782 ++++++++++++++++++
 drivers/net/pcs/pcs-lynx.c                    | 110 +--
 drivers/net/pcs/pcs-xilinx.c                  | 479 +++++++++++
 drivers/net/phy/mdio_device.c                 |   1 +
 drivers/net/phy/phy_device.c                  |   3 +-
 drivers/net/phy/phylink.c                     |  24 +-
 drivers/of/property.c                         |  12 +-
 include/linux/fwnode.h                        |   2 +-
 include/linux/pcs-lynx.h                      |  13 +-
 include/linux/pcs-xilinx.h                    |  36 +
 include/linux/pcs.h                           | 195 +++++
 include/linux/phy.h                           |   1 +
 include/linux/phylink.h                       |  27 +-
 include/linux/property.h                      |   4 +
 scripts/kernel-doc                            |   2 +-
 45 files changed, 2181 insertions(+), 311 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/xilinx,pcs.yaml
 create mode 100644 Documentation/networking/pcs.rst
 create mode 100644 drivers/net/pcs/core.c
 create mode 100644 drivers/net/pcs/pcs-xilinx.c
 create mode 100644 include/linux/pcs-xilinx.h
 create mode 100644 include/linux/pcs.h

Comments

Jakub Kicinski April 8, 2025, 2:50 p.m. UTC | #1
On Mon,  7 Apr 2025 19:17:31 -0400 Sean Anderson wrote:
> This series depends on [1,2], and they have been included at the
> beginning so CI will run. However, I expect them to be reviewed/applied
> outside the net-next tree.

These appear to break the build:

drivers/acpi/property.c:1669:39: error: initialization of ‘int (*)(const struct fwnode_handle *, const char *, const char *, int,  unsigned int,  struct fwnode_reference_args *)’ from incompatible pointer type ‘int (*)(const struct fwnode_handle *, const char *, const char *, unsigned int,  unsigned int,  struct fwnode_reference_args *)’ [-Wincompatible-pointer-types]
 1669 |                 .get_reference_args = acpi_fwnode_get_reference_args,   \

Could you post as RFC until we can actually merge this? I'm worried 
some sleep deprived maintainer may miss the note in the cover letter
and just apply it all to net-next..
Sean Anderson April 8, 2025, 3:30 p.m. UTC | #2
On 4/8/25 10:50, Jakub Kicinski wrote:
> On Mon,  7 Apr 2025 19:17:31 -0400 Sean Anderson wrote:
>> This series depends on [1,2], and they have been included at the
>> beginning so CI will run. However, I expect them to be reviewed/applied
>> outside the net-next tree.
> 
> These appear to break the build:
> 
> drivers/acpi/property.c:1669:39: error: initialization of ‘int (*)(const struct fwnode_handle *, const char *, const char *, int,  unsigned int,  struct fwnode_reference_args *)’ from incompatible pointer type ‘int (*)(const struct fwnode_handle *, const char *, const char *, unsigned int,  unsigned int,  struct fwnode_reference_args *)’ [-Wincompatible-pointer-types]
>  1669 |                 .get_reference_args = acpi_fwnode_get_reference_args,   \
> 
> Could you post as RFC until we can actually merge this? I'm worried 
> some sleep deprived maintainer may miss the note in the cover letter
> and just apply it all to net-next..

I would really like to keep RFC off the titles since some reviewers don't
pay attention to RFC series.

Would [DO NOT MERGE] in the subject be OK?

--Sean
Jakub Kicinski April 8, 2025, 3:33 p.m. UTC | #3
On Tue, 8 Apr 2025 11:30:43 -0400 Sean Anderson wrote:
> > These appear to break the build:
> > 
> > drivers/acpi/property.c:1669:39: error: initialization of ‘int (*)(const struct fwnode_handle *, const char *, const char *, int,  unsigned int,  struct fwnode_reference_args *)’ from incompatible pointer type ‘int (*)(const struct fwnode_handle *, const char *, const char *, unsigned int,  unsigned int,  struct fwnode_reference_args *)’ [-Wincompatible-pointer-types]
> >  1669 |                 .get_reference_args = acpi_fwnode_get_reference_args,   \
> > 
> > Could you post as RFC until we can actually merge this? I'm worried 
> > some sleep deprived maintainer may miss the note in the cover letter
> > and just apply it all to net-next..  
> 
> I would really like to keep RFC off the titles since some reviewers don't
> pay attention to RFC series.
> 
> Would [DO NOT MERGE] in the subject be OK?

That works too.
Russell King (Oracle) April 8, 2025, 5:27 p.m. UTC | #4
On Tue, Apr 08, 2025 at 11:30:43AM -0400, Sean Anderson wrote:
> On 4/8/25 10:50, Jakub Kicinski wrote:
> > On Mon,  7 Apr 2025 19:17:31 -0400 Sean Anderson wrote:
> >> This series depends on [1,2], and they have been included at the
> >> beginning so CI will run. However, I expect them to be reviewed/applied
> >> outside the net-next tree.
> > 
> > These appear to break the build:
> > 
> > drivers/acpi/property.c:1669:39: error: initialization of ‘int (*)(const struct fwnode_handle *, const char *, const char *, int,  unsigned int,  struct fwnode_reference_args *)’ from incompatible pointer type ‘int (*)(const struct fwnode_handle *, const char *, const char *, unsigned int,  unsigned int,  struct fwnode_reference_args *)’ [-Wincompatible-pointer-types]
> >  1669 |                 .get_reference_args = acpi_fwnode_get_reference_args,   \
> > 
> > Could you post as RFC until we can actually merge this? I'm worried 
> > some sleep deprived maintainer may miss the note in the cover letter
> > and just apply it all to net-next..
> 
> I would really like to keep RFC off the titles since some reviewers don't
> pay attention to RFC series.
> 
> Would [DO NOT MERGE] in the subject be OK?

I'd bet that those who have decided "RFC means the patch series is not
ready" will take such a notice to also mean the same, and ignore it.

I think there needs to be some kind of push-back against these
maintainers who explicitly state that they ignore RFC series - making
it basically anti-social behaviour in the kernel community.