[net-next PATCH v3 00/11] Add PCS core support

Sean Anderson posted 11 patches 8 months, 1 week ago
Only 10 patches received!
There is a newer version of this series
.../devicetree/bindings/net/xilinx,pcs.yaml   | 114 +++
Documentation/networking/index.rst            |   1 +
Documentation/networking/kapi.rst             |   4 +
Documentation/networking/pcs.rst              | 102 +++
MAINTAINERS                                   |   8 +
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           |   7 +
drivers/net/ethernet/xilinx/xilinx_axienet.h  |   4 +-
.../net/ethernet/xilinx/xilinx_axienet_main.c | 104 +--
drivers/net/pcs/Kconfig                       |  44 +-
drivers/net/pcs/Makefile                      |   4 +
drivers/net/pcs/core.c                        | 690 ++++++++++++++++++
drivers/net/pcs/pcs-lynx.c                    | 110 +--
drivers/net/pcs/pcs-xilinx.c                  | 477 ++++++++++++
drivers/net/phy/mdio_device.c                 |   1 +
drivers/net/phy/phy_device.c                  |   3 +-
drivers/net/phy/phylink.c                     |  24 +-
drivers/of/property.c                         |   2 +
include/linux/pcs-lynx.h                      |  13 +-
include/linux/pcs-xilinx.h                    |  15 +
include/linux/pcs.h                           | 193 +++++
include/linux/phy.h                           |   1 +
include/linux/phylink.h                       |  27 +-
40 files changed, 1997 insertions(+), 296 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
[net-next PATCH v3 00/11] Add PCS core support
Posted by Sean Anderson 8 months, 1 week ago
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).

To build documentation without errors, this series requires commit
de258fa8ca8d ("scripts: kernel-doc: fix parsing function-like typedefs
(again)"), currently applied to docs-next [1].

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 [2] 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.

[1] https://lore.kernel.org/all/e0abb103c73a96d76602d909f60ab8fd6e2fd0bd.1744106242.git.mchehab+huawei@kernel.org/
[2] https://lore.kernel.org/netdev/20250406221423.9723-1-ansuelsmth@gmail.com/

Changes in v3:
- Add '>' modifier for paragraph to description
- Adjust axienet_xilinx_pcs_get for changes to pcs_find_fwnode API
- Drop patches destined for other trees, as they have either already
  been applied or are no longer necessary.
- Edit description to reference clocks instead of resets
- Remove support for #pcs-cells. Upon further investigation, the
  requested functionality can be accomplished by specifying the PCS's
  fwnode manually.
- Select PCS_XILINX unconditionally

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 (10):
  dt-bindings: net: Add Xilinx PCS
  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   | 114 +++
 Documentation/networking/index.rst            |   1 +
 Documentation/networking/kapi.rst             |   4 +
 Documentation/networking/pcs.rst              | 102 +++
 MAINTAINERS                                   |   8 +
 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           |   7 +
 drivers/net/ethernet/xilinx/xilinx_axienet.h  |   4 +-
 .../net/ethernet/xilinx/xilinx_axienet_main.c | 104 +--
 drivers/net/pcs/Kconfig                       |  44 +-
 drivers/net/pcs/Makefile                      |   4 +
 drivers/net/pcs/core.c                        | 690 ++++++++++++++++++
 drivers/net/pcs/pcs-lynx.c                    | 110 +--
 drivers/net/pcs/pcs-xilinx.c                  | 477 ++++++++++++
 drivers/net/phy/mdio_device.c                 |   1 +
 drivers/net/phy/phy_device.c                  |   3 +-
 drivers/net/phy/phylink.c                     |  24 +-
 drivers/of/property.c                         |   2 +
 include/linux/pcs-lynx.h                      |  13 +-
 include/linux/pcs-xilinx.h                    |  15 +
 include/linux/pcs.h                           | 193 +++++
 include/linux/phy.h                           |   1 +
 include/linux/phylink.h                       |  27 +-
 40 files changed, 1997 insertions(+), 296 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

-- 
2.35.1.1320.gc452695387.dirty
Re: [net-next PATCH v3 00/11] Add PCS core support
Posted by Russell King (Oracle) 8 months ago
On Tue, Apr 15, 2025 at 03:33:12PM -0400, Sean Anderson wrote:
> This series adds support for creating PCSs as devices on a bus with a
> driver (patch 3). As initial users,

As per previous, unless I respond (this response not included) then I
haven't had time to look at it - and today is total ratshit so, not
today.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Re: [net-next PATCH v3 00/11] Add PCS core support
Posted by Sean Anderson 8 months ago
Hi Russell,

On 4/17/25 08:25, Russell King (Oracle) wrote:
> On Tue, Apr 15, 2025 at 03:33:12PM -0400, Sean Anderson wrote:
>> This series adds support for creating PCSs as devices on a bus with a
>> driver (patch 3). As initial users,
> 
> As per previous, unless I respond (this response not included) then I
> haven't had time to look at it - and today is total ratshit so, not
> today.

Sorry if I resent this too soon. I had another look at the request for
#pcs-cells [1], and determined that a simpler approach would be
possible. So I wanted to resend with that change since it would let me
drop the fwnode_property_get_reference_optional_args patches.

--Sean

[1] https://lore.kernel.org/netdev/e7720741-93c5-450b-99a0-3434a5d535f5@linux.dev/
Re: [net-next PATCH v3 00/11] Add PCS core support
Posted by Russell King (Oracle) 8 months ago
On Thu, Apr 17, 2025 at 10:22:09AM -0400, Sean Anderson wrote:
> Hi Russell,
> 
> On 4/17/25 08:25, Russell King (Oracle) wrote:
> > On Tue, Apr 15, 2025 at 03:33:12PM -0400, Sean Anderson wrote:
> >> This series adds support for creating PCSs as devices on a bus with a
> >> driver (patch 3). As initial users,
> > 
> > As per previous, unless I respond (this response not included) then I
> > haven't had time to look at it - and today is total ratshit so, not
> > today.
> 
> Sorry if I resent this too soon. I had another look at the request for
> #pcs-cells [1], and determined that a simpler approach would be
> possible. So I wanted to resend with that change since it would let me
> drop the fwnode_property_get_reference_optional_args patches.

Please can you send them as RFC so I don't feel the pressure to say
something before they get merged (remember, non-RFC patches to netdev
get queued up in patchwork for merging.)

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Re: [net-next PATCH v3 00/11] Add PCS core support
Posted by Sean Anderson 8 months ago
On 4/17/25 11:24, Russell King (Oracle) wrote:
> On Thu, Apr 17, 2025 at 10:22:09AM -0400, Sean Anderson wrote:
>> Hi Russell,
>> 
>> On 4/17/25 08:25, Russell King (Oracle) wrote:
>> > On Tue, Apr 15, 2025 at 03:33:12PM -0400, Sean Anderson wrote:
>> >> This series adds support for creating PCSs as devices on a bus with a
>> >> driver (patch 3). As initial users,
>> > 
>> > As per previous, unless I respond (this response not included) then I
>> > haven't had time to look at it - and today is total ratshit so, not
>> > today.
>> 
>> Sorry if I resent this too soon. I had another look at the request for
>> #pcs-cells [1], and determined that a simpler approach would be
>> possible. So I wanted to resend with that change since it would let me
>> drop the fwnode_property_get_reference_optional_args patches.
> 
> Please can you send them as RFC so I don't feel the pressure to say
> something before they get merged (remember, non-RFC patches to netdev
> get queued up in patchwork for merging.)

This series is marked "changes requested" in patchwork, so I don't think
it should get merged automatically. I won't send a v4 until you've had a
chance to review it.

--Sean
Re: [net-next PATCH v3 00/11] Add PCS core support
Posted by Sean Anderson 7 months, 2 weeks ago
Hi Russell,

On 4/17/25 11:29, Sean Anderson wrote:
> On 4/17/25 11:24, Russell King (Oracle) wrote:
>> On Thu, Apr 17, 2025 at 10:22:09AM -0400, Sean Anderson wrote:
>>> Hi Russell,
>>> 
>>> On 4/17/25 08:25, Russell King (Oracle) wrote:
>>> > On Tue, Apr 15, 2025 at 03:33:12PM -0400, Sean Anderson wrote:
>>> >> This series adds support for creating PCSs as devices on a bus with a
>>> >> driver (patch 3). As initial users,
>>> > 
>>> > As per previous, unless I respond (this response not included) then I
>>> > haven't had time to look at it - and today is total ratshit so, not
>>> > today.
>>> 
>>> Sorry if I resent this too soon. I had another look at the request for
>>> #pcs-cells [1], and determined that a simpler approach would be
>>> possible. So I wanted to resend with that change since it would let me
>>> drop the fwnode_property_get_reference_optional_args patches.
>> 
>> Please can you send them as RFC so I don't feel the pressure to say
>> something before they get merged (remember, non-RFC patches to netdev
>> get queued up in patchwork for merging.)
> 
> This series is marked "changes requested" in patchwork, so I don't think
> it should get merged automatically. I won't send a v4 until you've had a
> chance to review it.

Any chance you could review this series in the next week or so? I would
like to send v4 in time to be reviewed before net-next closes later this
month.

--Sean