linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: "Andrew Lunn" <andrew@lunn.ch>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Alvin __ipraga" <alsi@bang-olufsen.dk>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Claudiu Manoil" <claudiu.manoil@nxp.com>,
	"Daniel Scally" <djrscally@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"DENG Qingfang" <dqfext@gmail.com>,
	"Eric Dumazet" <edumazet@google.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"George McCollister" <george.mccollister@gmail.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Hauke Mehrtens" <hauke@hauke-m.de>,
	"Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Kurt Kanzenbach" <kurt@linutronix.de>,
	"Landen Chao" <Landen.Chao@mediatek.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	netdev@vger.kernel.org, "Paolo Abeni" <pabeni@redhat.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Sean Wang" <sean.wang@mediatek.com>,
	UNGLinuxDriver@microchip.com,
	"Vivien Didelot" <vivien.didelot@gmail.com>,
	"Woojung Huh" <woojung.huh@microchip.com>,
	"Marek Behún" <kabel@kernel.org>
Subject: Re: [PATCH net-next 3/6] net: dsa: add support for retrieving the interface mode
Date: Fri, 15 Jul 2022 22:31:17 +0100	[thread overview]
Message-ID: <YtHcpf4otJQS9hTO@shell.armlinux.org.uk> (raw)
In-Reply-To: <20220715172444.yins4kb2b6b35aql@skbuf>

On Fri, Jul 15, 2022 at 08:24:44PM +0300, Vladimir Oltean wrote:
> On Fri, Jul 15, 2022 at 05:01:37PM +0100, Russell King (Oracle) wrote:
> > DSA port bindings allow for an optional phy interface mode. When an
> > interface mode is not specified, DSA uses the NA interface mode type.
> > 
> > However, phylink needs to know the parameters of the link, and this
> > will become especially important when using phylink for ports that
> > are devoid of all properties except the required "reg" property, so
> > that phylink can select the maximum supported link settings. Without
> > knowing the interface mode, phylink can't truely know the maximum
> > link speed.
> > 
> > Update the prototype for the phylink_get_caps method to allow drivers
> > to report this information back to DSA, and update all DSA
> > implementations function declarations to cater for this change. No
> > code is added to the implementations.
> > 
> > Reviewed-by: Marek Behún <kabel@kernel.org>
> > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> > ---
> (...)
> > diff --git a/include/net/dsa.h b/include/net/dsa.h
> > index b902b31bebce..7c6870d2c607 100644
> > --- a/include/net/dsa.h
> > +++ b/include/net/dsa.h
> > @@ -852,7 +852,8 @@ struct dsa_switch_ops {
> >  	 * PHYLINK integration
> >  	 */
> >  	void	(*phylink_get_caps)(struct dsa_switch *ds, int port,
> > -				    struct phylink_config *config);
> > +				    struct phylink_config *config,
> > +				    phy_interface_t *default_interface);
> 
> I would prefer having a dedicated void (*port_max_speed_interface),
> because the post-phylink DSA drivers (which are not few) will generally
> not need to concern themselves with implementing this, and I don't want
> driver writers to think they need to populate every parameter they see
> in phylink_get_caps. So the new function needs to be documented
> appropriately (specify who needs and who does not need to implement it,
> on which ports it will be called, etc).
> 
> In addition, if we have a dedicated ds->ops->port_max_speed_interface(),
> we can do a better job of avoiding breakage with this patch set, since
> if DSA cannot find a valid phylink fwnode, AND there is no
> port_max_speed_interface() callback for this driver, DSA can still
> preserve the current logic of not putting the port down, and not
> registering it with phylink. That can be accompanied by a dev_warn() to
> state that the CPU/DSA port isn't registered with phylink, please
> implement port_max_speed_interface() to address that.

To continue my previous email...

This is a great illustration why posting RFC series is a waste of time.
This patch was posted as RFC on:

24th June
29th June
5th July
13th July

Only when it's been posted today has there been a concern raised about
the approach. So, what's the use of asking for comments if comments only
come when patches are posted for merging. None what so ever. So, we've
lost the last three weeks because I decided to "be kind" and post RFC.
Total waste of effort.

Now, on your point... the series posted on the 24th June was using
the mv88e6xxx port_max_speed_interface() but discussion off the mailing
list:

20:19 < rmk> kabel: hmm, is mv88e6393x_port_max_speed_mode() correct?
20:20 < rmk> it seems to be suggesting to use PHY_INTERFACE_MODE_10GBASER for
             port 9
09:50 < kabel> rmk: yes, 10gbase-r is correct for 6393x. But we need to add
               exception for 6191x, as is done in chip.c function
               mv88e6393x_phylink_get_caps()
09:51 < kabel> rmk: on 6191x only port 10 supports >1g speeds
11:51 < rmk> kabel: moving it into the get_caps function makes it easier to set
             the default_interfaces for 6193x
14:20 < kabel> rmk: yes, get_caps doing it would be better

The problem is this - we call get_caps(), and we have to read registers
to work out what the port supports. If we have a separate callback, then
we need to re-read those registers to get the same information to report
what the default interface should be.

Since almost all of the Marvell implementations the values for both the
list of supported interfaces and the default interface both require
reading a register and translating it to a phy_interface_t, and then
setting the support mask, it seems logical to combine these two
functioalities into one function.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-07-15 21:32 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15 16:00 [PATCH net-next 0/6] net: dsa: always use phylink Russell King (Oracle)
2022-07-15 16:01 ` [PATCH net-next 1/6] net: phylink: split out and export interface to caps translation Russell King (Oracle)
2022-07-15 16:01 ` [PATCH net-next 2/6] software node: allow named software node to be created Russell King
2022-07-15 19:57   ` Andy Shevchenko
2022-07-15 20:17     ` Vladimir Oltean
2022-07-15 20:33       ` Andy Shevchenko
2022-07-15 20:48         ` Vladimir Oltean
2022-07-18 12:29           ` Andy Shevchenko
2022-07-18 13:27             ` Russell King (Oracle)
2022-07-18 18:43               ` Andy Shevchenko
2022-07-18 18:53                 ` Andy Shevchenko
2022-07-18 19:14                   ` Russell King (Oracle)
2022-07-18 19:24                     ` Andy Shevchenko
2022-07-18 20:39                       ` Marek Behún
2022-07-18 20:48                         ` Andy Shevchenko
2022-07-19  7:18                           ` Marek Behún
2022-07-29 12:08                             ` Andy Shevchenko
2022-07-18 19:11                 ` Russell King (Oracle)
2022-07-18 20:07                   ` Andy Shevchenko
2022-07-18 20:38                     ` Russell King (Oracle)
2022-07-19  8:50                       ` Sakari Ailus
2022-07-20 22:56                         ` Vladimir Oltean
2022-07-22  6:21                           ` Sakari Ailus
2022-07-18 20:42                   ` Andrew Lunn
2022-07-15 16:01 ` [PATCH net-next 3/6] net: dsa: add support for retrieving the interface mode Russell King (Oracle)
2022-07-15 17:24   ` Vladimir Oltean
2022-07-15 21:31     ` Russell King (Oracle) [this message]
2022-07-15 22:23       ` Vladimir Oltean
2022-07-15 22:57         ` Russell King (Oracle)
2022-07-16 10:57           ` Vladimir Oltean
2022-07-16 11:13             ` Russell King (Oracle)
2022-07-16 12:36               ` Vladimir Oltean
2022-07-18  8:48                 ` Russell King (Oracle)
2022-07-20 22:44                   ` Vladimir Oltean
2022-07-21 13:46                     ` Vladimir Oltean
2022-07-21 14:46                       ` Andrew Lunn
2022-07-21 14:54                       ` Russell King (Oracle)
2022-07-21 15:15                         ` Vladimir Oltean
2022-07-21 17:21                           ` Marek Behún
2022-07-21 18:15                             ` Russell King (Oracle)
2022-07-21 18:22                             ` Vladimir Oltean
2022-07-21 21:14                               ` Russell King (Oracle)
2022-07-21 21:36                                 ` Vladimir Oltean
2022-07-22  8:28                                   ` Russell King (Oracle)
2022-07-22 10:52                                     ` Vladimir Oltean
2022-07-22 11:44                                       ` Russell King (Oracle)
2022-07-22 12:14                                         ` Russell King (Oracle)
2022-07-22 12:46                                         ` Vladimir Oltean
2022-07-22 13:16                                           ` Russell King (Oracle)
2022-07-22 16:56                                             ` Vladimir Oltean
2022-07-22 21:20                                               ` Russell King (Oracle)
2022-07-22 21:53                                                 ` Andrew Lunn
2022-07-22 22:35                                                 ` Andrew Lunn
2022-07-22 22:39                                                 ` Vladimir Oltean
2022-07-23  7:12                                                   ` Russell King (Oracle)
2022-07-23 13:44                                                     ` Vladimir Oltean
2022-07-25 10:11                                                       ` Russell King (Oracle)
2022-07-23 17:26                                                   ` Marek Behún
2022-07-24 17:39                                                     ` Vladimir Oltean
2022-07-22 13:20                                         ` Andrew Lunn
2022-07-22 12:59                               ` Marek Behún
2022-07-22 13:23                                 ` Russell King (Oracle)
2022-07-22 14:19                                   ` Marek Behún
2022-07-15 16:01 ` [PATCH net-next 4/6] net: dsa: mv88e6xxx: report the default interface mode for the port Russell King (Oracle)
2022-07-15 16:01 ` [PATCH net-next 5/6] net: dsa: use swnode fixed-link if using default params Russell King (Oracle)
2022-07-15 20:11   ` Andy Shevchenko
2022-07-15 21:36     ` Russell King (Oracle)
2022-07-18 18:59       ` Andy Shevchenko
2022-07-18 19:13         ` Russell King (Oracle)
2022-07-18 20:08           ` Andy Shevchenko
2022-07-15 16:01 ` [PATCH net-next 6/6] net: dsa: mv88e6xxx: remove handling for DSA and CPU ports Russell King (Oracle)
2022-07-15 17:17 ` [PATCH net-next 0/6] net: dsa: always use phylink Vladimir Oltean
2022-07-15 20:59   ` Russell King (Oracle)
2022-07-15 23:03     ` Jakub Kicinski
2022-07-16 11:15       ` Vladimir Oltean
2022-07-16 11:43         ` Russell King (Oracle)
2022-07-16 13:13           ` Vladimir Oltean
2022-07-18  8:53             ` Russell King (Oracle)
2022-07-18 12:45               ` Vladimir Oltean
2022-07-18 13:02                 ` Russell King (Oracle)
2022-07-18 14:25                   ` Vladimir Oltean
2022-07-16 23:44         ` Jakub Kicinski
2022-07-27  9:00 ` Marek Behún
2022-07-27 13:38   ` 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=YtHcpf4otJQS9hTO@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=Landen.Chao@mediatek.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alsi@bang-olufsen.dk \
    --cc=andrew@lunn.ch \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=djrscally@gmail.com \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=george.mccollister@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hauke@hauke-m.de \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=hkallweit1@gmail.com \
    --cc=kabel@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=rafael@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sean.wang@mediatek.com \
    --cc=vivien.didelot@gmail.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;
as well as URLs for NNTP newsgroup(s).