public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix•de>
To: "Russell King (Oracle)" <linux@armlinux•org.uk>
Cc: Andrew Lunn <andrew@lunn•ch>, netdev <netdev@vger•kernel.org>,
	Florian Fainelli <f.fainelli@gmail•com>,
	Vladimir Oltean <vladimir.oltean@nxp•com>,
	Sean Wang <sean.wang@mediatek•com>,
	Landen Chao <Landen.Chao@mediatek•com>,
	DENG Qingfang <dqfext@gmail•com>,
	Matthias Brugger <matthias.bgg@gmail•com>,
	AngeloGioacchino Del Regno 
	<angelogioacchino.delregno@collabora•com>,
	Doug Berger <opendmb@gmail•com>,
	Broadcom internal kernel review list 
	<bcm-kernel-feedback-list@broadcom•com>,
	Wei Fang <wei.fang@nxp•com>, Shenwei Wang <shenwei.wang@nxp•com>,
	Clark Wang <xiaoning.wang@nxp•com>,
	NXP Linux Team <linux-imx@nxp•com>,
	UNGLinuxDriver@microchip•com, Byungho An <bh74.an@samsung•com>,
	Giuseppe Cavallaro <peppe.cavallaro@st•com>,
	Alexandre Torgue <alexandre.torgue@foss•st.com>,
	Jose Abreu <joabreu@synopsys•com>,
	Maxime Coquelin <mcoquelin.stm32@gmail•com>,
	Heiner Kallweit <hkallweit1@gmail•com>,
	Woojung Huh <woojung.huh@microchip•com>,
	Oleksij Rempel <linux@rempel-privat•de>
Subject: Re: [PATCH RFC 00/18] Rework MAC drivers EEE support
Date: Sat, 18 Feb 2023 13:25:29 +0100	[thread overview]
Message-ID: <20230218122529.GC9065@pengutronix.de> (raw)
In-Reply-To: <Y++OdVY3S8D7uopq@shell.armlinux.org.uk>

On Fri, Feb 17, 2023 at 02:25:57PM +0000, Russell King (Oracle) wrote:
> On Fri, Feb 17, 2023 at 04:42:12AM +0100, Andrew Lunn wrote:
> > phy_init_eee() is supposed to be called once auto-neg has been
> > completed to determine if EEE should be used with the current link
> > mode. The MAC hardware should then be configured to either enable or
> > disable EEE. Many drivers get this wrong, calling phy_init_eee() once,
> > or only in the ethtool set_eee callback.
> 
> Looking at some of the recent EEE changes (not related to this patch
> set) I've come across:
> 
> commit 9b01c885be364526d8c05794f8358b3e563b7ff8
> Author: Oleksij Rempel <linux@rempel-privat•de>
> Date:   Sat Feb 11 08:41:10 2023 +0100
> 
>     net: phy: c22: migrate to genphy_c45_write_eee_adv()
> 
> This part of the patch is wrong:
> 
> __genphy_config_aneg():
> -       if (genphy_config_eee_advert(phydev))
> +       err = genphy_c45_write_eee_adv(phydev, phydev->supported_eee);
> 
> The problem here is that these are not equivalent.
> 
> genphy_config_eee_advert() only clears the broken EEE modes in the
> advertisement, it doesn't actually set the advertisement to anything
> in particular.
> 
> The replacement code _configures_ the advertisement to whatever the
> second argument is, which means each time the advertisement is
> changed (and thus __genphy_config_aneg() is called) the EEE
> advertisement will ignore whatever the user configured via the
> set_eee() APIs, and be restored to the full EEE capabilities in the
> supported mask.
> 
> This is an obvious regression that needs fixing, especially as the
> merge window is potentially due to open this weekend.

You are right :(

I'll be able to come with a fix this Monday.

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

      reply	other threads:[~2023-02-18 12:25 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17  3:42 [PATCH RFC 00/18] Rework MAC drivers EEE support Andrew Lunn
2023-02-17  3:42 ` [PATCH RFC 01/18] net: phy: Add phydev->eee_active to simplify adjust link callbacks Andrew Lunn
2023-02-17  9:09   ` Oleksij Rempel
2023-02-17 13:35     ` Andrew Lunn
2023-02-17 11:36   ` Russell King (Oracle)
2023-02-17 13:37     ` Andrew Lunn
2023-02-17  3:42 ` [PATCH RFC 02/18] net: phy: Add helper to set EEE Clock stop enable bit Andrew Lunn
2023-02-17 13:33   ` Andrew Lunn
2023-02-17  3:42 ` [PATCH RFC 03/18] net: marvell: mvneta: Simplify EEE configuration Andrew Lunn
2023-02-17 11:35   ` Russell King (Oracle)
2023-02-17 11:59   ` Russell King (Oracle)
2023-02-17 13:13     ` Russell King (Oracle)
2023-02-17 13:45     ` Andrew Lunn
2023-02-17  3:42 ` [PATCH RFC 04/18] net: stmmac: Drop usage of phy_init_eee() Andrew Lunn
2023-02-17  3:42 ` [PATCH RFC 05/18] net: stmmac: Simplify ethtool get eee Andrew Lunn
2023-02-17  3:42 ` [PATCH RFC 06/18] net: lan743x: Fixup EEE Andrew Lunn
2023-02-17  3:42 ` [PATCH RFC 07/18] net: fec: Move fec_enet_eee_mode_set() and helper earlier Andrew Lunn
2023-02-17  3:42 ` [PATCH RFC 08/18] net: FEC: Fixup EEE Andrew Lunn
2023-02-17  8:19   ` Oleksij Rempel
2023-02-17 12:32     ` Russell King (Oracle)
2023-02-17 13:58     ` Andrew Lunn
2023-02-18  2:00     ` Andrew Lunn
2023-02-17  3:42 ` [PATCH RFC 09/18] net: genet: " Andrew Lunn
2023-02-17  3:48   ` Florian Fainelli
2023-02-17 14:00     ` Andrew Lunn
2023-02-17  3:42 ` [PATCH RFC 10/18] net: sxgdb: " Andrew Lunn
2023-02-17  3:42 ` [PATCH RFC 11/18] net: dsa: mt7530: Swap to using phydev->eee_active Andrew Lunn
2023-02-17  3:42 ` [PATCH RFC 12/18] net: dsa: mt7530: Call phylib for set_eee and get_eee Andrew Lunn
2023-02-17 11:48   ` Russell King (Oracle)
2023-02-17 14:10     ` Andrew Lunn
2023-02-18  2:10     ` Andrew Lunn
2023-02-17  3:42 ` [PATCH RFC 13/18] net: dsa: b53: Swap to using phydev->eee_active Andrew Lunn
2023-02-17  3:42 ` [PATCH RFC 14/18] net: dsa: b53: Call phylib for set_eee and get_eee Andrew Lunn
2023-02-17  3:42 ` [PATCH RFC 15/18] net: phylink: Remove unused phylink_init_eee() Andrew Lunn
2023-02-17 11:42   ` Russell King (Oracle)
2023-02-17  3:42 ` [PATCH RFC 16/18] net: phylink: Update comment about configuring EEE in mac_link_up() Andrew Lunn
2023-02-17 11:43   ` Russell King (Oracle)
2023-02-17  3:42 ` [PATCH RFC 17/18] net: phy: remove unused phy_init_eee() Andrew Lunn
2023-02-17  3:42 ` [PATCH RFC 18/18] net: usb: lan78xx: Fixup EEE Andrew Lunn
2023-02-17 11:42 ` [PATCH RFC 00/18] Rework MAC drivers EEE support Russell King (Oracle)
2023-02-17 14:17   ` Andrew Lunn
2023-02-17 14:25 ` Russell King (Oracle)
2023-02-18 12:25   ` Oleksij Rempel [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=20230218122529.GC9065@pengutronix.de \
    --to=o.rempel@pengutronix$(echo .)de \
    --cc=Landen.Chao@mediatek$(echo .)com \
    --cc=UNGLinuxDriver@microchip$(echo .)com \
    --cc=alexandre.torgue@foss$(echo .)st.com \
    --cc=andrew@lunn$(echo .)ch \
    --cc=angelogioacchino.delregno@collabora$(echo .)com \
    --cc=bcm-kernel-feedback-list@broadcom$(echo .)com \
    --cc=bh74.an@samsung$(echo .)com \
    --cc=dqfext@gmail$(echo .)com \
    --cc=f.fainelli@gmail$(echo .)com \
    --cc=hkallweit1@gmail$(echo .)com \
    --cc=joabreu@synopsys$(echo .)com \
    --cc=linux-imx@nxp$(echo .)com \
    --cc=linux@armlinux$(echo .)org.uk \
    --cc=linux@rempel-privat$(echo .)de \
    --cc=matthias.bgg@gmail$(echo .)com \
    --cc=mcoquelin.stm32@gmail$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=opendmb@gmail$(echo .)com \
    --cc=peppe.cavallaro@st$(echo .)com \
    --cc=sean.wang@mediatek$(echo .)com \
    --cc=shenwei.wang@nxp$(echo .)com \
    --cc=vladimir.oltean@nxp$(echo .)com \
    --cc=wei.fang@nxp$(echo .)com \
    --cc=woojung.huh@microchip$(echo .)com \
    --cc=xiaoning.wang@nxp$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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