From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Sean Anderson <sean.anderson@seco.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>,
Vladimir Oltean <olteanv@gmail.com>,
linux-kernel@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Tobias Waldekranz <tobias@waldekranz.com>,
Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH net-next] net: mdio: Add netlink interface
Date: Tue, 7 Mar 2023 14:50:36 +0000 [thread overview]
Message-ID: <ZAdPPAL549lg1uFG@shell.armlinux.org.uk> (raw)
In-Reply-To: <7a02294e-bf50-4399-9e68-1235ba24a381@lunn.ch>
On Tue, Mar 07, 2023 at 03:22:46PM +0100, Andrew Lunn wrote:
> > + switch ((enum mdio_nl_op)insn->op) {
> > + case MDIO_NL_OP_READ:
> > + phy_id = __arg_ri(insn->arg0, regs);
> > + prtad = mdio_phy_id_prtad(phy_id);
> > + devad = mdio_phy_id_devad(phy_id);
> > + reg = __arg_ri(insn->arg1, regs);
> > +
> > + if (mdio_phy_id_is_c45(phy_id))
> > + ret = __mdiobus_c45_read(xfer->mdio, prtad,
> > + devad, reg);
> > + else
> > + ret = __mdiobus_read(xfer->mdio, phy_id, reg);
>
> The application should say if it want to do C22 or C45. As you said in
> the cover note, the ioctl interface is limiting when there is no PHY,
> so you are artificially adding the same restriction here. Also, you
> might want to do C45 on a C22 PHY, e.g. to access EEE registers. Plus
> you could consider adding C45 over C22 here.
Remembering of course that C45-over-C22 on a device that isn't a PHY
could end up causing havoc, but then if you are using this interface,
you already have the gun pointing at your foot... and if you go and
try C45-over-C22 to scan a MDIO bus, you'd definitely be pulling the
trigger too.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2023-03-07 15:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-06 20:45 [PATCH net-next] net: mdio: Add netlink interface Sean Anderson
2023-03-06 22:48 ` Russell King (Oracle)
2023-03-06 23:39 ` Sean Anderson
2023-03-07 13:47 ` Andrew Lunn
2023-03-07 16:41 ` Sean Anderson
2023-03-07 0:05 ` kernel test robot
2023-03-07 11:23 ` Michael Walle
2023-03-07 13:49 ` Andrew Lunn
2023-03-07 14:05 ` Vladimir Oltean
2023-03-07 14:33 ` Andrew Lunn
2023-03-07 15:00 ` Russell King (Oracle)
2023-03-07 12:26 ` Tobias Waldekranz
2023-03-07 16:30 ` Sean Anderson
2023-03-07 14:22 ` Andrew Lunn
2023-03-07 14:50 ` Russell King (Oracle) [this message]
2023-03-07 16:16 ` Sean Anderson
2023-03-07 17:23 ` Andrew Lunn
2023-03-07 17:42 ` 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=ZAdPPAL549lg1uFG@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=sean.anderson@seco.com \
--cc=tobias@waldekranz.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).