public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: "Arınç ÜNAL" <arinc.unal@arinc9.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Woojung Huh" <woojung.huh@microchip.com>,
	UNGLinuxDriver@microchip.com,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Alvin Šipraga" <alsi@bang-olufsen.dk>,
	"Daniel Golle" <daniel@makrotopia.org>,
	"Landen Chao" <Landen.Chao@mediatek.com>,
	"DENG Qingfang" <dqfext@gmail.com>,
	"Sean Wang" <sean.wang@mediatek.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	mithat.guner@xeront.com, erkin.bozoglu@xeront.com,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH 2/4] dt-bindings: net: dsa: document internal MDIO bus
Date: Fri, 15 Sep 2023 15:18:30 +0300	[thread overview]
Message-ID: <20230915121830.tmzuxthup7rzewhv@skbuf> (raw)
In-Reply-To: <ZQNL0Vy3kMbWlNFl@shell.armlinux.org.uk>

Hi Russell,

On Thu, Sep 14, 2023 at 07:07:13PM +0100, Russell King (Oracle) wrote:
> On Thu, Sep 14, 2023 at 07:06:11PM +0100, Russell King (Oracle) wrote:
> > On Wed, Sep 13, 2023 at 04:59:19PM +0100, Russell King (Oracle) wrote:
> > > On Wed, Sep 13, 2023 at 10:42:31AM +0300, Vladimir Oltean wrote:
> > > > On Wed, Sep 13, 2023 at 08:52:37AM +0300, Arınç ÜNAL wrote:
> > > > > One more thing, I don't recall phy-mode being required to be defined for
> > > > > user ports as it will default to GMII. I don't believe this is the same
> > > > > case for shared ports so phy-mode is required only for them?
> > > > 
> > > > phy-mode is not strictly required, but I think there is a strong
> > > > preference to set it. IIRC, when looking at the DSA device trees, there
> > > > was no case where phy-mode would be absent on CPU/DSA ports if the other
> > > > link properties were also present, so we required it too. There were no
> > > > complaints in 1 year since dsa_shared_port_validate_of() is there. The
> > > > requirement can be relaxed to just a warning and no error in the kernel,
> > > > and the removal of "required" in the schema, if it helps making it
> > > > common with user ports.
> > > 
> > > However, phylink pretty much requires phy-mode to be specified to be
> > > something sane for shared ports, so I wouldn't be in favour of relaxing
> > > the checkinng in dsa_shared_port_validate_of()... not unless you're
> > > now going to accept the approach I originally proposed to have DSA
> > > drivers tell the core (and thus phylink) what phy-mode and other link
> > > parameters should be used when they are missing from DT.
> > 
> > You mean the approach that I picked up using software nodes that got
> > thrown out by the software node people? That approach that I picked
> > up from you and tried to get merged?
> > 
> > No, that's not going to happen, and it's not a question of whether
> > _I_ am going to accept that approach or not. So don't throw that
> > back on me, please.
> > 
> > If this is something that we want to solve, we need to stop being so
> > devisive (your language above is so) and try to come up with a
> > solution that is acceptable to everyone... the swnode approach
> > doesn't seem to be it.
> 
> Oh dear. I must be going mad!

So first things first: I am not advocating for making phy-mode fully
optional in the sense that you say (if absent, then write non-OF code
through which DSA infers the phy-mode from drivers). I'm happy with the
current form of the code.

I was just trying to add some nuance to this bizarre aspect signalled by
Arınç - phy-mode is not required for user ports, presumably because when
it is absent, user ports will default to GMII. That isn't an intrinsic
feature of user ports, but rather of having a phydev, and so, because
DSA/CPU ports can also have a phydev, logically it means that phy-mode
can also be omitted in that particular case, with the same result.

Our missing_phy_mode check from dsa_shared_port_validate_of() is theoretically
more restrictive than it needs to be, because it artificially prohibits
that behavior, and it results in an inexplicable difference in the phylink
dt-bindings for user vs shared ports. So that's where my relaxation
proposal came from: we could make missing_phy_mode non-fatal, and that
would permit the configurations which can work to work, and the ones
which can't work will fail elsewhere. Just like for the user ports.

Where I wasn't absolutely clear is that I don't want Arınç to change any
of that. Right now, on DSA shared ports, phy-mode is required and on user
ports it isn't. The difference is a bit strange (arbitrary considering
the example above) and should maybe be settled at some point in the
future, but for now, the dt-bindings should document it like that.

  reply	other threads:[~2023-09-15 12:19 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-12  9:17 [PATCH net-next 0/4] Document internal MDIO bus of DSA switch and support it on MT7530 Arınç ÜNAL
2023-08-12  9:17 ` [PATCH 1/4] dt-bindings: net: dsa: microchip,lan937x: add missing ethernet on example Arınç ÜNAL
2023-08-13 11:07   ` Vladimir Oltean
2023-08-13 11:23     ` Arınç ÜNAL
2023-08-14 14:54   ` Vladimir Oltean
2023-08-16 16:29   ` Florian Fainelli
2023-08-21 17:36   ` Rob Herring
2023-08-12  9:17 ` [PATCH 2/4] dt-bindings: net: dsa: document internal MDIO bus Arınç ÜNAL
2023-08-12 16:28   ` Arınç ÜNAL
2023-08-12 19:20     ` Arınç ÜNAL
2023-08-13 11:53       ` Vladimir Oltean
2023-08-13 12:59         ` Arınç ÜNAL
2023-08-13 14:58           ` Arınç ÜNAL
2023-08-13 19:02             ` Vladimir Oltean
2023-08-14 10:06               ` Arınç ÜNAL
2023-08-14 10:39                 ` Vladimir Oltean
2023-08-13 19:01           ` Vladimir Oltean
2023-08-14 10:06             ` Arınç ÜNAL
2023-08-14 13:09               ` Andrew Lunn
2023-08-27  8:38                 ` Arınç ÜNAL
2023-09-09  6:23                 ` Arınç ÜNAL
2023-09-13  1:21                   ` Andrew Lunn
2023-09-13 12:44                     ` Arınç ÜNAL
2023-08-14 14:36               ` Vladimir Oltean
2023-08-27  8:33                 ` Arınç ÜNAL
2023-08-27 12:12                   ` Vladimir Oltean
2023-09-04 11:33                     ` Arınç ÜNAL
2023-09-05  2:42                       ` Luiz Angelo Daros de Luca
2023-09-05 11:00                         ` Arınç ÜNAL
2023-09-05 11:05                         ` Vladimir Oltean
2023-09-05 11:11                         ` Vladimir Oltean
2023-09-05 12:13                           ` Andrew Lunn
2023-09-09  8:53                       ` Arınç ÜNAL
2023-09-09 14:35                         ` Arınç ÜNAL
2023-09-09 19:53                         ` Arınç ÜNAL
2023-09-09 21:16                         ` Andrew Lunn
2023-09-12 18:09                           ` Arınç ÜNAL
2023-09-11 22:51                         ` Vladimir Oltean
2023-09-12 19:23                           ` Arınç ÜNAL
2023-09-12 19:34                             ` Vladimir Oltean
2023-09-13  5:52                               ` Arınç ÜNAL
2023-09-13  7:42                                 ` Vladimir Oltean
2023-09-13 10:59                                   ` Arınç ÜNAL
2023-09-13 11:04                                     ` Vladimir Oltean
2023-09-13 11:35                                       ` Arınç ÜNAL
2023-09-13 13:00                                         ` Vladimir Oltean
2023-09-13 14:36                                           ` Arınç ÜNAL
2023-09-13 15:59                                   ` Russell King (Oracle)
2023-09-14 16:12                                     ` Vladimir Oltean
2023-09-14 18:06                                     ` Russell King (Oracle)
2023-09-14 18:07                                       ` Russell King (Oracle)
2023-09-15 12:18                                         ` Vladimir Oltean [this message]
2023-08-14 14:57           ` Vladimir Oltean
2023-08-21 17:44       ` Rob Herring
2023-08-27  8:42         ` Arınç ÜNAL
2023-08-13 11:15   ` Vladimir Oltean
2023-08-13 12:58     ` Arınç ÜNAL
2023-08-12  9:17 ` [PATCH 3/4] dt-bindings: net: dsa: realtek: require compatible property under mdio node Arınç ÜNAL
2023-08-12 16:31   ` Arınç ÜNAL
2023-08-14 14:53   ` Vladimir Oltean
2023-08-14 18:23   ` Linus Walleij
2023-08-16 16:28   ` Florian Fainelli
2023-08-12  9:17 ` [PATCH 4/4] net: dsa: mt7530: register OF node for internal MDIO bus Arınç ÜNAL

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=20230915121830.tmzuxthup7rzewhv@skbuf \
    --to=olteanv@gmail.com \
    --cc=Landen.Chao@mediatek.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alsi@bang-olufsen.dk \
    --cc=andrew@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=arinc.unal@arinc9.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --cc=erkin.bozoglu@xeront.com \
    --cc=f.fainelli@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=matthias.bgg@gmail.com \
    --cc=mithat.guner@xeront.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=sean.wang@mediatek.com \
    --cc=woojung.huh@microchip.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