linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Prasanna Vengateshan <prasanna.vengateshan@microchip.com>,
	netdev@vger.kernel.org, robh+dt@kernel.org,
	UNGLinuxDriver@microchip.com, Woojung.Huh@microchip.com,
	hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net,
	kuba@kernel.org, linux-kernel@vger.kernel.org,
	vivien.didelot@gmail.com, f.fainelli@gmail.com,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v3 net-next 05/10] net: dsa: microchip: add DSA support for microchip lan937x
Date: Tue, 3 Aug 2021 16:43:12 +0200	[thread overview]
Message-ID: <YQlWAHSTQ4K3/zet@lunn.ch> (raw)
In-Reply-To: <20210802213353.qu5j3gn4753xlj43@skbuf>

On Tue, Aug 03, 2021 at 12:33:53AM +0300, Vladimir Oltean wrote:
> On Sun, Aug 01, 2021 at 12:05:16AM +0200, Andrew Lunn wrote:
> > > So you support both the cases where an internal PHY is described using
> > > OF bindings, and where the internal PHY is implicitly accessed using the
> > > slave_mii_bus of the switch, at a PHY address equal to the port number,
> > > and with no phy-handle or fixed-link device tree property for that port?
> > > 
> > > Do you need both alternatives? The first is already more flexible than
> > > the second.
> > 
> > The first is also much more verbose in DT, and the second generally
> > just works without any DT. What can be tricky with the second is
> > getting PHY interrupts to work, but it is possible, the mv88e6xxx does
> > it.
> 
> - The explicit phy-handle is more verbose as far as the DT description
>   goes for one particular use case of indirect internal PHY access, but
>   it also leads to less complex code (more uniform with other usage
>   patterns in the kernel). What is tricky with an implicit phy-handle is
>   trivial without it. This makes a difference with DM_DSA in U-Boot,
>   where I would really like to avoid bloating the code and just support
>   2 options for a DSA switch port: either a phy-handle or a fixed-link.
>   These two are already "Turing-complete" (they can describe any system)
>   so I only see the implicit phy-handle as a helping hand for a few lazy
>   DT writers. Since I have been pushing back that we shouldn't bloat
>   U-Boot with implicit phy-handle logic when it doesn't give a concrete
>   benefit, and have gotten a push back in return that Linux does allow
>   it and it would be desirable for one DT binding to cover all, I now
>   need to promote the more generic approach for Linux going forward too.
> 
> - If the switch has the ability for its internal PHYs to be accessed
>   directly over MDIO pins instead of using indirect SPI transfers, using
>   a phy-handle is a generic way to handle both cases, while the implicit
>   phy-handle does not give you that option.
> 
> - If there is complex pinmuxing in the SoC and one port can either be
>   connected to an internal 100base-T1 or to a 100base-TX PHY, and this
>   is not detectable by software, this cannot be dealt with using an
>   implicit phy-handle if the 100base-T1 and 100base-TX PHYs are not at
>   the same address.
> 
> - In general, if the internal PHYs are not at an MDIO address equal to
>   the port number, this cannot be dealt with using the implicit
>   phy-handle method.

There are good reasons to use an explicit phy-handle, and i would
never block such code. However, implicit is historically how it was
done. There are many DT blobs which assume it works. So implicit is
not going away.

If you want to only support explicit in U-Boot, that is fine. I would
suggest making this clear in the U-Boot documentation.

	Andrew

  reply	other threads:[~2021-08-03 14:43 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 17:30 [PATCH v3 net-next 00/10] net: dsa: microchip: DSA driver support for LAN937x switch Prasanna Vengateshan
2021-07-23 17:30 ` [PATCH v3 net-next 01/10] dt-bindings: net: dsa: dt bindings for microchip lan937x Prasanna Vengateshan
2021-07-26 22:49   ` Rob Herring
2021-07-23 17:31 ` [PATCH v3 net-next 02/10] net: dsa: move mib->cnt_ptr reset code to ksz_common.c Prasanna Vengateshan
2021-07-23 18:53   ` Vladimir Oltean
2021-07-23 17:31 ` [PATCH v3 net-next 03/10] net: phy: Add support for LAN937x T1 phy driver Prasanna Vengateshan
2021-08-11 17:52   ` Prasanna Vengateshan
2021-07-23 17:31 ` [PATCH v3 net-next 04/10] net: dsa: tag_ksz: add tag handling for Microchip LAN937x Prasanna Vengateshan
2021-07-23 19:23   ` Vladimir Oltean
2021-07-23 17:31 ` [PATCH v3 net-next 05/10] net: dsa: microchip: add DSA support for microchip lan937x Prasanna Vengateshan
2021-07-31 15:04   ` Vladimir Oltean
2021-07-31 22:05     ` Andrew Lunn
2021-08-02 21:33       ` Vladimir Oltean
2021-08-03 14:43         ` Andrew Lunn [this message]
2021-08-03 15:05           ` Vladimir Oltean
2021-08-02 10:45     ` Prasanna Vengateshan
2021-08-02 12:15       ` Vladimir Oltean
2021-08-02 13:13         ` Andrew Lunn
2021-08-02 13:59           ` Vladimir Oltean
2021-08-02 20:47             ` Andrew Lunn
2021-08-03 16:54             ` Prasanna Vengateshan
2021-08-03 23:54               ` Vladimir Oltean
2021-08-04  9:59                 ` Russell King (Oracle)
2021-08-04 10:46                   ` Vladimir Oltean
2021-08-04 14:28                     ` Prasanna Vengateshan
2021-08-04 14:51                       ` Vladimir Oltean
2021-08-07 15:40                     ` Andrew Lunn
2021-08-07 17:00                       ` Vladimir Oltean
2021-08-11 17:44                       ` Prasanna Vengateshan
2021-08-11 18:23                         ` Andrew Lunn
2021-08-11 20:14                           ` Russell King (Oracle)
2021-08-11 20:20                             ` Vladimir Oltean
2021-08-11 20:22                               ` Andrew Lunn
2021-07-23 17:31 ` [PATCH v3 net-next 06/10] net: dsa: microchip: add support for phylink management Prasanna Vengateshan
2021-07-31 15:27   ` Vladimir Oltean
2021-08-03 17:04     ` Prasanna Vengateshan
2021-07-23 17:31 ` [PATCH v3 net-next 07/10] net: dsa: microchip: add support for ethtool port counters Prasanna Vengateshan
2021-07-23 17:31 ` [PATCH v3 net-next 08/10] net: dsa: microchip: add support for port mirror operations Prasanna Vengateshan
2021-07-31 15:24   ` Vladimir Oltean
2021-07-23 17:31 ` [PATCH v3 net-next 09/10] net: dsa: microchip: add support for fdb and mdb management Prasanna Vengateshan
2021-07-31 15:19   ` Vladimir Oltean
2021-07-23 17:31 ` [PATCH v3 net-next 10/10] net: dsa: microchip: add support for vlan operations Prasanna Vengateshan
2021-07-31 15:08   ` Vladimir Oltean
2021-08-02 10:48     ` Prasanna Vengateshan

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=YQlWAHSTQ4K3/zet@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.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=prasanna.vengateshan@microchip.com \
    --cc=robh+dt@kernel.org \
    --cc=vivien.didelot@gmail.com \
    --subject='Re: [PATCH v3 net-next 05/10] net: dsa: microchip: add DSA support for microchip lan937x' \
    /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

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).