All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: Vladimir Oltean <olteanv@gmail.com>,
	Gerhard Engleder <gerhard@engleder-embedded.com>,
	netdev <netdev@vger.kernel.org>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Russell King <linux@armlinux.org.uk>,
	Jakub Kicinski <kuba@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH net] Revert "net: phy: Uniform PHY driver access"
Date: Tue, 14 Sep 2021 16:33:25 +0200	[thread overview]
Message-ID: <YUCytc0+ChhcdOo+@lunn.ch> (raw)
In-Reply-To: <20210914120617.iaqaukal3riridew@skbuf>

On Tue, Sep 14, 2021 at 12:06:18PM +0000, Vladimir Oltean wrote:
> On Mon, Sep 13, 2021 at 08:49:19PM +0200, Andrew Lunn wrote:
> > > I am not sure why "to_phy_driver" needs cleanup. Au contraire, I think
> > > the PHY library's usage of struct phy_device :: drv is what is strange
> > > and potentially buggy, it is the only subsystem I know of that keeps its
> > > own driver pointer rather than looking at struct device :: driver.
> > 
> > There is one odd driver in the mix. Take a look at xilinx_gmii2rgmii.c.
> > 
> > It probably could be done a better way, but that is what we have.
> 
> Interesting, to say the least. Also, is there any connection between
> that and the revert I'm proposing?

If i remember correctly, Gerhard Engleder is actually using this, and
ran into a problem because the wrong driver structure was used.

> So compared to other vendors, where the RGMII gasket is part of the MAC
> device, with Xilinx Zynq it is accessible via MDIO?

Yes. Its control plane sits on the MDIO bus. Unfortunately, it does
not have any ID registers, so it does not directly appear as a PHY. So
it does interesting things it put itself in the control path to the
real PHY.

> It looks like it is said that this GMII2RGMII converter can be placed in
> front of any GMII MAC. Nice that there are zero in-tree users of
> "xlnx,gmii-to-rgmii-1.0" so that I could figure out exactly how that
> plays out in practice.

If you look back at the thread for that patch, i think Gerhard posted
a DT fragment he is using. Hopefully it will get submitted as a full
board description at some point.

> Note that the usage of priv->phy_dev, priv->phy_drv, priv->conv_phy_drv
> beats me. Why is "phy_dev" kept inside "priv" even though it is accessed
> only inside xgmiitorgmii_probe? Why does xgmiitorgmii_configure() need to
> be called from xgmiitorgmii_read_status() which in turn hooks into the
> attached PHY driver's phy_read_status()? Why does xgmiitorgmii_configure
> not get exported and called from an .adjust_link method or the phylink
> equivalent, like any other MAC-side hardware linked with the PHY library
> in the kernel?

I was never happy with this driver. It got submitted before i went on
vacation, i had a few rounds trying to get the submitter to refactor
it and was mostly ignored. I left on vacation with lots of open review
points, and when i got back it had been merged. And the original
submitters never responded to my requests for improvements.

	Andrew

  reply	other threads:[~2021-09-14 14:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-12 19:28 [RFC PATCH net] Revert "net: phy: Uniform PHY driver access" Vladimir Oltean
2021-09-12 20:49 ` Gerhard Engleder
2021-09-12 21:38   ` Vladimir Oltean
2021-09-13 18:49     ` Andrew Lunn
2021-09-14 12:06       ` Vladimir Oltean
2021-09-14 14:33         ` Andrew Lunn [this message]
2021-09-14 15:15           ` Vladimir Oltean
2021-09-14 16:17             ` Gerhard Engleder
2021-09-14 16:29               ` Andrew Lunn
2021-09-14 17:14                 ` Gerhard Engleder
2021-09-14 17:44                   ` Vladimir Oltean

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=YUCytc0+ChhcdOo+@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=gerhard@engleder-embedded.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.