netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Sean Anderson <sean.anderson@linux.dev>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
	netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Lei Wei <quic_leiwei@quicinc.com>,
	Christian Marangi <ansuelsmth@gmail.com>,
	Kory Maincent <kory.maincent@bootlin.com>,
	Simon Horman <horms@kernel.org>,
	Daniel Golle <daniel@makrotopia.org>,
	Vineeth Karumanchi <vineeth.karumanchi@amd.com>,
	linux-kernel@vger.kernel.org,
	Ioana Ciornei <ioana.ciornei@nxp.com>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	imx@lists.linux.dev, linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [net-next PATCH v5 05/10] net: pcs: lynx: Convert to an MDIO driver
Date: Sat, 24 May 2025 01:05:53 +0100	[thread overview]
Message-ID: <aDENYfL7Hstsswml@shell.armlinux.org.uk> (raw)
In-Reply-To: <e0bd575b-a01b-418f-9d89-b59398e87a48@linux.dev>

On Fri, May 23, 2025 at 06:07:16PM -0400, Sean Anderson wrote:
> On 5/23/25 17:39, Sean Anderson wrote:
> > On 5/23/25 17:33, Heiner Kallweit wrote:
> >> On 23.05.2025 22:33, Sean Anderson wrote:
> >>> This converts the lynx PCS driver to a proper MDIO driver.
> >>> This allows using a more conventional driver lifecycle (e.g. with a
> >>> probe and remove). It will also make it easier to add interrupt support.
> >>> 
> >>> The existing helpers are converted to bind the MDIO driver instead of
> >>> creating the PCS directly. As lynx_pcs_create_mdiodev creates the PCS
> >>> device, we can just set the modalias. For lynx_pcs_create_fwnode, we try
> >>> to get the PCS the usual way, and if that fails we edit the devicetree
> >>> to add a compatible and reprobe the device.
> >>> 
> >>> To ensure my contributions remain free software, remove the BSD option
> >>> from the license. This is permitted because the SPDX uses "OR".
> >>> 
> >>> Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
> >>> ---
> >>> 
> >>> Changes in v5:
> >>> - Use MDIO_BUS instead of MDIO_DEVICE
> >>> 
> >>> Changes in v4:
> >>> - Add a note about the license
> >>> - Convert to dev-less pcs_put
> >>> 
> >>> Changes in v3:
> >>> - Call devm_pcs_register instead of devm_pcs_register_provider
> >>> 
> >>> Changes in v2:
> >>> - Add support for #pcs-cells
> >>> - Remove unused variable lynx_properties
> >>> 
> >>>  drivers/net/dsa/ocelot/Kconfig                |   4 +
> >>>  drivers/net/dsa/ocelot/felix_vsc9959.c        |  11 +-
> >>>  drivers/net/dsa/ocelot/seville_vsc9953.c      |  11 +-
> >>>  drivers/net/ethernet/altera/Kconfig           |   2 +
> >>>  drivers/net/ethernet/altera/altera_tse_main.c |   7 +-
> >>>  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  |  25 ++--
> >>>  drivers/net/ethernet/stmicro/stmmac/Kconfig   |   3 +
> >>>  .../ethernet/stmicro/stmmac/dwmac-socfpga.c   |   6 +-
> >>>  drivers/net/pcs/Kconfig                       |  11 +-
> >>>  drivers/net/pcs/pcs-lynx.c                    | 110 ++++++++++--------
> >>>  include/linux/pcs-lynx.h                      |  13 ++-
> >>>  19 files changed, 128 insertions(+), 110 deletions(-)
> >>> 
> >>> diff --git a/drivers/net/dsa/ocelot/Kconfig b/drivers/net/dsa/ocelot/Kconfig
> >>> index 081e7a88ea02..907c29d61c14 100644
> >>> --- a/drivers/net/dsa/ocelot/Kconfig
> >>> +++ b/drivers/net/dsa/ocelot/Kconfig
> >>> @@ -42,7 +42,9 @@ config NET_DSA_MSCC_FELIX
> >>>  	select NET_DSA_TAG_OCELOT_8021Q
> >>>  	select NET_DSA_TAG_OCELOT
> >>>  	select FSL_ENETC_MDIO
> >>> +	select PCS
> >>>  	select PCS_LYNX
> >>> +	select MDIO_BUS
> >> 
> >> This shouldn't be needed. NET_DSA selects PHYLINK, which selects PHYLIB,
> >> which selects MDIO_BUS. There are more places in this series where the
> >> same comment applies.
> > 
> > select does not transitively enable dependencies. See the note in
> > Documentation/kbuild/kconfig-language.rst for details. Therefore we must
> > select the dependencies of things we select in order to ensure we do not
> > trip sym_warn_unmet_dep.
> 
> OK, I see what you mean here. But of course NET_DSA is missing selects for
> PHYLIB and MDIO_BUS. And PHYLINK is also missing a select for MDIO_BUS. Actually,
> this bug is really endemic. Maybe we should just get rid of PHYLIB as a config
> and just make everything depend on ETHERNET instead.

You're reading the documentation wrongly.

Take this example:

config A
	select B

config B
	select C
	depends on E

config C
	select D

config D

config E

Enabling A leads to B, C and D all being enabled, but it does *not*
lead to E being enabled - kconfig will issue a warning if E is not
already enabled.

E is a dependency of B. There are no other dependencies, but there
are reverse dependencies, and reverse dependencies are propagated.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

  parent reply	other threads:[~2025-05-24  0:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-23 20:33 [net-next PATCH v5 00/10] Add PCS core support Sean Anderson
2025-05-23 20:33 ` [net-next PATCH v5 01/10] dt-bindings: net: Add Xilinx PCS Sean Anderson
2025-05-23 20:33 ` [net-next PATCH v5 02/10] net: phylink: Support setting PCS link change callbacks Sean Anderson
2025-05-23 20:33 ` [net-next PATCH v5 03/10] net: pcs: Add subsystem Sean Anderson
2025-05-23 20:33 ` [net-next PATCH v5 04/10] net: dsa: ocelot: suppress PHY device scanning on the internal MDIO bus Sean Anderson
2025-05-23 20:33 ` [net-next PATCH v5 05/10] net: pcs: lynx: Convert to an MDIO driver Sean Anderson
2025-05-23 21:33   ` Heiner Kallweit
2025-05-23 21:39     ` Sean Anderson
2025-05-23 22:07       ` Sean Anderson
2025-05-23 22:47         ` Sean Anderson
2025-05-24  0:05         ` Russell King (Oracle) [this message]
2025-05-24  8:21   ` kernel test robot
2025-05-24  8:42   ` kernel test robot
2025-05-24 10:27   ` kernel test robot
2025-05-24 13:34   ` kernel test robot
2025-05-23 20:33 ` [net-next PATCH v5 06/10] net: pcs: Add Xilinx PCS driver Sean Anderson
2025-05-24  9:25   ` kernel test robot
2025-05-23 20:33 ` [net-next PATCH v5 07/10] net: axienet: Convert to use PCS subsystem Sean Anderson
2025-05-23 20:33 ` [net-next PATCH v5 08/10] net: macb: Move most of mac_config to mac_prepare Sean Anderson
2025-05-23 20:33 ` [net-next PATCH v5 09/10] net: macb: Support external PCSs Sean Anderson
2025-05-23 20:33 ` [net-next PATCH v5 10/10] of: property: Add device link support for PCS Sean Anderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aDENYfL7Hstsswml@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew+netdev@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=ioana.ciornei@nxp.com \
    --cc=kory.maincent@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=quic_leiwei@quicinc.com \
    --cc=sean.anderson@linux.dev \
    --cc=vineeth.karumanchi@amd.com \
    --cc=vladimir.oltean@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).