public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, Frank Wunderlich <frankwu@gmx.de>,
	Chad Monroe <chad@monroe.io>,
	Cezary Wilmanski <cezary.wilmanski@adtran.com>,
	Avinash Jayaraman <ajayaraman@maxlinear.com>,
	Bing tao Xu <bxu@maxlinear.com>, Liang Xu <lxu@maxlinear.com>,
	Juraj Povazanec <jpovazanec@maxlinear.com>,
	"Fanni (Fang-Yi) Chan" <fchan@maxlinear.com>,
	"Benny (Ying-Tsan) Weng" <yweng@maxlinear.com>,
	"Livia M. Rosu" <lrosu@maxlinear.com>,
	John Crispin <john@phrozen.org>
Subject: Re: [PATCH v12 4/4] net: dsa: add basic initial driver for MxL862xx switches
Date: Mon, 2 Feb 2026 18:09:17 +0000	[thread overview]
Message-ID: <aYDoTSySNt7vXazL@makrotopia.org> (raw)
In-Reply-To: <20260202102326.vz5qhg6wzzje553v@skbuf>

On Mon, Feb 02, 2026 at 12:23:26PM +0200, Vladimir Oltean wrote:
> On Sun, Feb 01, 2026 at 02:25:13AM +0000, Daniel Golle wrote:
> > +static int mxl862xx_setup_mdio(struct dsa_switch *ds)
> > +{
> > +	struct mxl862xx_priv *priv = ds->priv;
> > +	struct device *dev = ds->dev;
> > +	struct device_node *mdio_np;
> > +	struct mii_bus *bus;
> > +	int ret;
> > +
> > +	bus = devm_mdiobus_alloc(dev);
> > +	if (!bus)
> > +		return -ENOMEM;
> > +
> > +	bus->priv = priv;
> > +	ds->user_mii_bus = bus;
> > +	bus->name = KBUILD_MODNAME "-mii";
> > +	snprintf(bus->id, MII_BUS_ID_SIZE, "%s-mii", dev_name(dev));
> > +	bus->read_c45 = mxl862xx_phy_read_c45_mii_bus;
> > +	bus->write_c45 = mxl862xx_phy_write_c45_mii_bus;
> > +	bus->read = mxl862xx_phy_read_mii_bus;
> > +	bus->write = mxl862xx_phy_write_mii_bus;
> > +	bus->parent = dev;
> > +	bus->phy_mask = ~ds->phys_mii_mask;
> > +
> > +	mdio_np = of_get_child_by_name(dev->of_node, "mdio");
> > +	if (!mdio_np)
> > +		return -ENODEV;
> 
> As per the dt-bindings patch, the "mdio" child node is not required.
> But here it is.

Now that ports are counted from 0, and 0 being the microcontroller, the
port number no longer matches the PHY ID, so I suppose I got to change
the dt-bindigns as that kinda makes the mdio node mandatory for anything
to work.

> 
> All user ports are given a valid non-NULL dp->cpu_dp pointer. I strongly
> oppose introducing FUD in the code. If there are valid reasons behind
> this I'm all ears, but there aren't.
> 

Looking at other drivers I thought that, and regret not having challenged the
AI commenting on this...

      reply	other threads:[~2026-02-02 18:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-01  2:24 [PATCH v12 0/4] net: dsa: initial support for MaxLinear MxL862xx switches Daniel Golle
2026-02-01  2:24 ` [PATCH v12 1/4] dt-bindings: net: dsa: add MaxLinear MxL862xx Daniel Golle
2026-02-01  2:24 ` [PATCH v12 2/4] net: dsa: add tag format for MxL862xx switches Daniel Golle
2026-02-01  2:25 ` [PATCH v12 3/4] net: mdio: add unlocked mdiodev C45 bus accessors Daniel Golle
2026-02-02 11:08   ` Russell King (Oracle)
2026-02-01  2:25 ` [PATCH v12 4/4] net: dsa: add basic initial driver for MxL862xx switches Daniel Golle
2026-02-02 10:23   ` Vladimir Oltean
2026-02-02 18:09     ` Daniel Golle [this message]

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=aYDoTSySNt7vXazL@makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=ajayaraman@maxlinear.com \
    --cc=andrew@lunn.ch \
    --cc=bxu@maxlinear.com \
    --cc=cezary.wilmanski@adtran.com \
    --cc=chad@monroe.io \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=fchan@maxlinear.com \
    --cc=frankwu@gmx.de \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=john@phrozen.org \
    --cc=jpovazanec@maxlinear.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lrosu@maxlinear.com \
    --cc=lxu@maxlinear.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=yweng@maxlinear.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