From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17A39C61DA4 for ; Sat, 18 Feb 2023 12:25:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229557AbjBRMZn (ORCPT ); Sat, 18 Feb 2023 07:25:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbjBRMZm (ORCPT ); Sat, 18 Feb 2023 07:25:42 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51797144A0 for ; Sat, 18 Feb 2023 04:25:41 -0800 (PST) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pTMHZ-0000av-QX; Sat, 18 Feb 2023 13:25:37 +0100 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1pTMHR-0002KZ-74; Sat, 18 Feb 2023 13:25:29 +0100 Date: Sat, 18 Feb 2023 13:25:29 +0100 From: Oleksij Rempel To: "Russell King (Oracle)" Cc: Andrew Lunn , netdev , Florian Fainelli , Vladimir Oltean , Sean Wang , Landen Chao , DENG Qingfang , Matthias Brugger , AngeloGioacchino Del Regno , Doug Berger , Broadcom internal kernel review list , Wei Fang , Shenwei Wang , Clark Wang , NXP Linux Team , UNGLinuxDriver@microchip.com, Byungho An , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Heiner Kallweit , Woojung Huh , Oleksij Rempel Subject: Re: [PATCH RFC 00/18] Rework MAC drivers EEE support Message-ID: <20230218122529.GC9065@pengutronix.de> References: <20230217034230.1249661-1-andrew@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: netdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 > 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 |