All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Yangfl <mmyangfl@gmail.com>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
	Vladimir Oltean <olteanv@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@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Simon Horman <horms@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [net-next v5 3/3] net: dsa: yt921x: Add support for Motorcomm YT921x
Date: Thu, 21 Aug 2025 11:00:35 +0100	[thread overview]
Message-ID: <aKbuQ7MCbq1JL9sw@shell.armlinux.org.uk> (raw)
In-Reply-To: <CAAXyoMMGCRZTuhYG0zxTgKdDdgB1brU7BAUiCVR_MheFK-n5Yw@mail.gmail.com>

On Thu, Aug 21, 2025 at 05:25:46PM +0800, Yangfl wrote:
> On Thu, Aug 21, 2025 at 4:30 PM Russell King (Oracle)
> <linux@armlinux.org.uk> wrote:
> >
> > On Wed, Aug 20, 2025 at 03:54:16PM +0800, David Yang wrote:
> > > +static int
> > > +yt921x_port_config(struct yt921x_priv *priv, int port, unsigned int mode,
> > > +                const struct phylink_link_state *state)
> > > +{
> > > +     const struct yt921x_info *info = priv->info;
> > > +     struct device *dev = to_device(priv);
> > > +     enum yt921x_fixed fixed;
> > > +     bool duplex_full;
> > > +     u32 mask;
> > > +     u32 ctrl;
> > > +     int res;
> > > +
> > > +     if (state->interface != PHY_INTERFACE_MODE_INTERNAL &&
> > > +         !yt921x_info_port_is_external(info, port)) {
> > > +             dev_err(dev, "Wrong mode %d on port %d\n",
> > > +                     state->interface, port);
> > > +             return -EINVAL;
> > > +     }
> > > +
> > > +     fixed = YT921X_FIXED_NOTFIXED;
> > > +     ctrl = YT921X_PORT_LINK;
> > > +     if (mode == MLO_AN_FIXED)
> > > +             switch (state->speed) {
> >
> > Someone clearly doesn't believe in reading the documentation before
> > writing code. This also hasn't been tested in any way. Sorry, but
> > I'm going to put as much effort into this review as you have into
> > understanding the phylink API, and thus my review ends here.
> >
> > NAK.
> >
> > --
> > RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> > FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
> 
> Sorry I'm quite new here. I don't understand very clearly why a
> different set of calls is involved in dsa_switch_ops, so I referred to
> other dsa drivers and made a working driver (at least tested on my
> device), but I would appreciate it much if you could point it out in
> an earlier version of series.

This isn't dsa_switch_ops, but phylink_mac_ops, which are well
documented in include/linux/phylink.h. Please read the documentation
found in that header file detailing the phylink_mac_ops methods.
You'll find a brief overview before the struct, and then in the #if 0
section, detailed per-method documentation.

Thanks.

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

  reply	other threads:[~2025-08-21 10:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20  7:54 [net-next v5 0/3] net: dsa: yt921x: Add support for Motorcomm YT921x David Yang
2025-08-20  7:54 ` [net-next v5 1/3] dt-bindings: net: dsa: yt921x: Add Motorcomm YT921x switch support David Yang
2025-08-21  7:22   ` Krzysztof Kozlowski
2025-08-21 12:20   ` Andrew Lunn
2025-08-21 12:50     ` Yangfl
2025-08-21 13:42       ` Andrew Lunn
2025-08-20  7:54 ` [net-next v5 2/3] net: dsa: tag_yt921x: add support for Motorcomm YT921x tags David Yang
2025-08-21 12:23   ` Andrew Lunn
2025-08-20  7:54 ` [net-next v5 3/3] net: dsa: yt921x: Add support for Motorcomm YT921x David Yang
2025-08-21  8:30   ` Russell King (Oracle)
2025-08-21  9:25     ` Yangfl
2025-08-21 10:00       ` Russell King (Oracle) [this message]
2025-08-21 10:14         ` Russell King (Oracle)
2025-08-21 12:19           ` Yangfl
2025-08-21 12:41   ` Andrew Lunn

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=aKbuQ7MCbq1JL9sw@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmyangfl@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    /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.