public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolai Buchwitz <nb@tipi-net.de>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: netdev@vger.kernel.org, Phil Elwell <phil@raspberrypi.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] net: phy: microchip: enable downshift by default on LAN88xx
Date: Tue, 31 Mar 2026 14:41:01 +0200	[thread overview]
Message-ID: <bb3d008fc1c9142f27344c74b13f22c0@tipi-net.de> (raw)
In-Reply-To: <acu3jgGklIfDVp-m@shell.armlinux.org.uk>

On 31.3.2026 14:01, Russell King (Oracle) wrote:
> On Tue, Mar 31, 2026 at 01:58:55PM +0200, Nicolai Buchwitz wrote:
>> On 31.3.2026 13:32, Russell King (Oracle) wrote:
>> > On Tue, Mar 31, 2026 at 12:46:27AM +0200, Nicolai Buchwitz wrote:
>> > > Enable auto-downshift from 1000BASE-T to 100BASE-TX after 2 failed
>> > > auto-negotiation attempts by default. This ensures that links with
>> > > faulty or missing cable pairs (C and D) fall back to 100Mbps without
>> > > requiring userspace configuration.
>> > >
>> > > Users can override or disable downshift at runtime:
>> > >
>> > >   ethtool --set-phy-tunable eth0 downshift off
>> > >
>> > > Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
>> > > Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>> >
>> > I'm slightly concerned by this commit. ->config_init() is called when
>> > the netdev attaches the PHY, and also during the resume path - and it's
>> > the second one which I believe is a problem here.
>> >
>> > If the user has configured the downshift, it is reasonable for the user
>> > to expect the setting to be preserved over a suspend/resume. However,
>> > by placing this code in ->config_init(), you will overwrite the user's
>> > setting when the system resumes.
>> 
>> You have a valid point. Looking at other drivers, Marvell has the
>> same issue: m88e1112_config_init() unconditionally sets downshift to 3
>> on every config_init call.
>> 
>> I see two options:
>> 
>> 1. Save the user's setting in the driver's priv struct and restore it
>> in config_init instead of blindly applying the default.
>> 
>> 2. Handle it generically in the PHY core, saving/restoring tunable
>> state across suspend/resume for all drivers.
>> 
>> I'd lean towards (1) to keep this series simple. (2) could be a
>> follow-up that fixes Marvell and others too. What do you think?
> 
> Or (3) configure the default it in the probe function?

Unfortunately the driver has .soft_reset = genphy_soft_reset which
runs before config_init on resume and would clear the setting? So
config_init still needs to set it.

Nicolai

      reply	other threads:[~2026-03-31 12:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30 22:46 [PATCH net-next v2 0/2] net: phy: microchip: add downshift support for LAN88xx Nicolai Buchwitz
2026-03-30 22:46 ` [PATCH v2 1/2] net: phy: microchip: add downshift tunable " Nicolai Buchwitz
2026-03-31  1:02   ` Andrew Lunn
2026-03-31 11:29   ` Russell King (Oracle)
2026-03-31 11:40     ` Nicolai Buchwitz
2026-03-30 22:46 ` [PATCH v2 2/2] net: phy: microchip: enable downshift by default on LAN88xx Nicolai Buchwitz
2026-03-31 11:32   ` Russell King (Oracle)
2026-03-31 11:58     ` Nicolai Buchwitz
2026-03-31 12:01       ` Russell King (Oracle)
2026-03-31 12:41         ` Nicolai Buchwitz [this message]

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=bb3d008fc1c9142f27344c74b13f22c0@tipi-net.de \
    --to=nb@tipi-net.de \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=phil@raspberrypi.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