All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Behun <marek.behun@nic.cz>
To: Nathan Rossi <nathan@nathanrossi.com>
Cc: netdev@vger.kernel.org, Nathan Rossi <nathan.rossi@digi.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Russell King <linux@armlinux.org.uk>
Subject: Re: [PATCH] net: dsa: mv88e6xxx: prevent 2500BASEX mode override
Date: Mon, 15 Feb 2021 14:47:56 +0100	[thread overview]
Message-ID: <20210215144756.76846c9b@nic.cz> (raw)
In-Reply-To: <20210215061559.1187396-1-nathan@nathanrossi.com>

On Mon, 15 Feb 2021 06:15:59 +0000
Nathan Rossi <nathan@nathanrossi.com> wrote:

> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index 54aa942eed..5c52906b29 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -650,6 +650,13 @@ static void mv88e6xxx_validate(struct dsa_switch *ds, int port,
>  	if (chip->info->ops->phylink_validate)
>  		chip->info->ops->phylink_validate(chip, port, mask, state);
>  
> +	/* Advertise 2500BASEX only if 1000BASEX is not configured, this
> +	 * prevents phylink_helper_basex_speed from always overriding the
> +	 * 1000BASEX mode since auto negotiation is always enabled.
> +	 */
> +	if (state->interface == PHY_INTERFACE_MODE_1000BASEX)
> +		phylink_clear(mask, 2500baseX_Full);
> +

I don't quite like this. This problem should be either solved in
phylink_helper_basex_speed() or somewhere in the mv88e6xxx code, but near
the call to phylink_helper_basex_speed().

Putting a solution to the behaviour of phylink_helper_basex_speed() it
into the validate() method when phylink_helper_basex_speed() is called
from a different place will complicate debugging in the future. If
we start solving problems in this kind of way, the driver will become
totally unreadable, IMO.

Marek

  reply	other threads:[~2021-02-15 13:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-15  6:15 [PATCH] net: dsa: mv88e6xxx: prevent 2500BASEX mode override Nathan Rossi
2021-02-15 13:47 ` Marek Behun [this message]
2021-02-15 14:57   ` Russell King - ARM Linux admin
2021-02-15 15:11     ` Andrew Lunn
2021-02-15 15:16     ` Marek Behun
2021-02-15 15:29       ` Russell King - ARM Linux admin
2021-02-15 15:58         ` Marek Behun
2021-02-16  8:00           ` Nathan Rossi

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=20210215144756.76846c9b@nic.cz \
    --to=marek.behun@nic.cz \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=nathan.rossi@digi.com \
    --cc=nathan@nathanrossi.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vivien.didelot@gmail.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 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.