LKML Archive on
help / color / mirror / Atom feed
From: "Russell King (Oracle)" <>
To: Horatiu Vultur <>
Subject: Re: [PATCH net-next v4 3/6] net: lan966x: add port module support
Date: Fri, 26 Nov 2021 11:04:25 +0000	[thread overview]
Message-ID: <YaC/> (raw)
In-Reply-To: <>

On Fri, Nov 26, 2021 at 10:05:37AM +0100, Horatiu Vultur wrote:
> This patch adds support for netdev and phylink in the switch. The
> injection + extraction is register based. This will be replaced with DMA
> accees.
> Signed-off-by: Horatiu Vultur <>

This looks mostly good now, thanks. There's one remaining issue:

> +int lan966x_port_pcs_set(struct lan966x_port *port,
> +			 struct lan966x_port_config *config)
> +{
> +	struct lan966x *lan966x = port->lan966x;
> +	bool inband_aneg = false;
> +	bool outband;
> +	int err;
> +
> +	lan966x_port_link_down(port);

This looks like something the MAC layer should be doing. Phylink won't
change the interface mode by just calling the PCS - it will do this
sequence, known as a major reconfiguration:

mac_link_down() (if the link was previously up)
if (pcs_config() > 0)

pcs_config() will also be called thusly:

if (pcs_config() > 0)

to change the ethtool advertising mask which changes the inband advert
or the Autoneg bit, which has an effect only on your DEV_PCS1G_ANEG_CFG()
register, and this may be called with the link up or down.

Also, pcs_config() is supposed to return 0 if the inband advert has not
changed, or positive if it has (so pcs_an_restart() is called to cause
in-band negotiation to be restarted.)

Note also that pcs_an_restart() may  also be called when ethtool
requests negotiation restart when we're operating in 802.3z modes.

So, my question is - do you need to be so heavy weight with the call to
lan966x_port_link_down() to take everything down when pcs_config() is
called, and is it really in the right place through the sequence for
a major reconfiguration?


RMK's Patch system:
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2021-11-26 11:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-26  9:05 [PATCH net-next v4 0/6] net: lan966x: Add lan966x switch driver Horatiu Vultur
2021-11-26  9:05 ` [PATCH net-next v4 1/6] dt-bindings: net: lan966x: Add lan966x-switch bindings Horatiu Vultur
2021-11-28 23:40   ` Rob Herring
2021-11-29 10:55     ` Horatiu Vultur
2021-11-26  9:05 ` [PATCH net-next v4 2/6] net: lan966x: add the basic lan966x driver Horatiu Vultur
2021-11-26 10:19   ` Philipp Zabel
2021-11-26  9:05 ` [PATCH net-next v4 3/6] net: lan966x: add port module support Horatiu Vultur
2021-11-26 11:04   ` Russell King (Oracle) [this message]
2021-11-29 11:08     ` Horatiu Vultur
2021-11-26 18:12   ` Jakub Kicinski
2021-11-29 10:59     ` Horatiu Vultur
2021-11-26  9:05 ` [PATCH net-next v4 4/6] net: lan966x: add mactable support Horatiu Vultur
2021-11-26  9:05 ` [PATCH net-next v4 5/6] net: lan966x: add ethtool configuration and statistics Horatiu Vultur
2021-11-26  9:05 ` [PATCH net-next v4 6/6] net: lan966x: Update MAINTAINERS to include lan966x driver Horatiu Vultur

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YaC/ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH net-next v4 3/6] net: lan966x: add port module support' \

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