From patchwork Fri Feb 17 03:42:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 13144284 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 8FE09C6379F for ; Fri, 17 Feb 2023 03:43:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230393AbjBQDnQ (ORCPT ); Thu, 16 Feb 2023 22:43:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbjBQDm6 (ORCPT ); Thu, 16 Feb 2023 22:42:58 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 675D7F749 for ; Thu, 16 Feb 2023 19:42:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: Cc:To:From:From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Content-Disposition:In-Reply-To:References; bh=mU57SgDP99U39alqvJ8nwLpAMY9z01MoAOs/4JVdreY=; b=J2rLk1jOpfnOMqqMOslEDnvaWn zvzoND+LcscjMWbI/PG3zStodqWE1bxVL/nxMUOkG1Jvf2Tdrg+mnN+mzeuMOvz7QQ3jLO/E0/dUf EZ4hFmtRl5Zp8dtyzALV4ObT+IqI3fSsznaiXU3VLY8E5jqJOuTRtG0GyReQCXrFNJls=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pSrdz-005F60-TL; Fri, 17 Feb 2023 04:42:43 +0100 From: Andrew Lunn To: netdev Cc: 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 , Russell King , Woojung Huh , Oleksij Rempel , Andrew Lunn Subject: [PATCH RFC 00/18] Rework MAC drivers EEE support Date: Fri, 17 Feb 2023 04:42:12 +0100 Message-Id: <20230217034230.1249661-1-andrew@lunn.ch> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-State: RFC 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. This patchset changes the API, such that EEE becomes the same as other parameters which are determined by auto-neg. As will speed and duplex, active EEE is now indicated in the phydev structure, and the adjust_link callbacks have been modified to act upon its value. eee_set and eee_get have been simplified, given that the phylib functions act upon most of the data in eee_set, and fill in most of the information needed for eee_set. Andrew Lunn (18): net: phy: Add phydev->eee_active to simplify adjust link callbacks net: phy: Add helper to set EEE Clock stop enable bit net: marvell: mvneta: Simplify EEE configuration net: stmmac: Drop usage of phy_init_eee() net: stmmac: Simplify ethtool get eee net: lan743x: Fixup EEE net: fec: Move fec_enet_eee_mode_set() and helper earlier net: FEC: Fixup EEE net: genet: Fixup EEE net: sxgdb: Fixup EEE net: dsa: mt7530: Swap to using phydev->eee_active net: dsa: mt7530: Call phylib for set_eee and get_eee net: dsa: b53: Swap to using phydev->eee_active net: dsa: b53: Call phylib for set_eee and get_eee net: phylink: Remove unused phylink_init_eee() net: phylink: Update comment about configuring EEE in mac_link_up() net: phy: remove unused phy_init_eee() net: usb: lan78xx: Fixup EEE drivers/net/dsa/b53/b53_common.c | 11 ++- drivers/net/dsa/mt7530.c | 8 +- .../net/ethernet/broadcom/genet/bcmgenet.c | 31 +++---- .../net/ethernet/broadcom/genet/bcmgenet.h | 1 + drivers/net/ethernet/broadcom/genet/bcmmii.c | 1 + drivers/net/ethernet/freescale/fec_main.c | 84 ++++++++----------- drivers/net/ethernet/marvell/mvneta.c | 12 +-- .../net/ethernet/microchip/lan743x_ethtool.c | 20 ----- drivers/net/ethernet/microchip/lan743x_main.c | 7 ++ .../net/ethernet/samsung/sxgbe/sxgbe_common.h | 4 +- .../ethernet/samsung/sxgbe/sxgbe_ethtool.c | 23 +---- .../net/ethernet/samsung/sxgbe/sxgbe_main.c | 37 +++----- .../ethernet/stmicro/stmmac/stmmac_ethtool.c | 2 - .../net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +- drivers/net/phy/phy.c | 36 +++----- drivers/net/phy/phylink.c | 18 ---- drivers/net/usb/lan78xx.c | 36 ++++---- include/linux/phy.h | 4 +- include/linux/phylink.h | 7 +- 19 files changed, 121 insertions(+), 226 deletions(-)