From patchwork Mon Mar 27 14:21:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 7261 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1562941vqo; Mon, 27 Mar 2023 07:42:31 -0700 (PDT) X-Google-Smtp-Source: AK7set9bxHim+5K4psECMi2FOOg4uESREXUKCKw8AX/OJG0QZnveX51IqM54ttxvWQFe7dsF+wL0 X-Received: by 2002:a05:6a20:4e29:b0:d9:ab8b:9f48 with SMTP id gk41-20020a056a204e2900b000d9ab8b9f48mr10797397pzb.20.1679928150790; Mon, 27 Mar 2023 07:42:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679928150; cv=none; d=google.com; s=arc-20160816; b=US8rCKPO36yc+xtsGSp4ko4O9PtP1rZWZmRxHHMf9iz6rNDdBMW0LFFe8uEcDduocV NWAUvDts9wyEU1GVBpHCbEvxjhmCRxsDsIm7r9wOYmJQf6zLuzk8+7b7vwC6ZHzwF6cX BnMN7FdlMSUlx0n9qGP0/9zYKVoQsv4oW1ij/xkvGVC4bNpgRyqLgVKPKx1No6EtiYTn YoVnstUDIleLrxnyjK0zEZLn1txZQr1HE/ng4IeDi6VddiMVmQhrZF59hbuCbiLOr9nH 77OvmdT4Iur/20WbvTZxzyuNJvAfB/oLeCvCZF2SwWO3lNL5qYiJ9xdGKqDSBY+3EVYD RipQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=IySX1gi0tUkMqH2QcafaLDta3jXspSq74nLJ8BYsetA=; b=vMwHdAtyhUg6Bm8Tlv78/u0qQGxOdVvHBIk/9RAwdc8nrx7XAPmxUIORvZF8unF4sv 5K3lJuSEc2HTZm8vO8nNbo4RsPonw+GyRaP1SZ3Ikostb0aTo/pMTLBxJ9Wg6P0w9iZM PID50wNwJbLSDFWsLJzCT4PS3Pz3wGEr+QI/yBiQiFyfLGBYP8ywhFWT2rab79V24fFi NbeCZNZecys0Z9sZJQceEdhG1yk2acLhS4I8SGaViXNBPmz8YA9cwQ+rhdI0FuxaRMgt tKduck/GLuVwXhGigSNlxwYQ7GGUkQm4L7yfmg7NDLF8jTH6vjV72nm/wLjtD2a/+eDZ HATQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b139-20020a621b91000000b0062a4722bb2asi10594273pfb.278.2023.03.27.07.42.06; Mon, 27 Mar 2023 07:42:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233113AbjC0OY3 (ORCPT + 99 others); Mon, 27 Mar 2023 10:24:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230089AbjC0OXt (ORCPT ); Mon, 27 Mar 2023 10:23:49 -0400 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 160197AA1 for ; Mon, 27 Mar 2023 07:22:16 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgnja-0008Hn-Kr; Mon, 27 Mar 2023 16:22:06 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pgnjY-0076IW-Q5; Mon, 27 Mar 2023 16:22:04 +0200 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pgnjW-00Fkib-OJ; Mon, 27 Mar 2023 16:22:02 +0200 From: Oleksij Rempel To: Wei Fang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Heiner Kallweit , Russell King Cc: Oleksij Rempel , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Shenwei Wang , Clark Wang , NXP Linux Team , Amit Cohen , Gal Pressman , Alexandru Tachici , Piergiorgio Beruto , Willem de Bruijn , Vladimir Oltean Subject: [PATCH net-next v2 0/8] Make SmartEEE support controllable Date: Mon, 27 Mar 2023 16:21:54 +0200 Message-Id: <20230327142202.3754446-1-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 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: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761532340376009039?= X-GMAIL-MSGID: =?utf-8?q?1761532340376009039?= changes v2: - handle lack of eee_get/set directly by the ethtool framework. This will avoid the need to patch all ethernet controller drivers. - add mac_supports_eee and is_smart_eee_phy flags to indicate support of different levels. - reword commit logs. - add FEC patch to indicated EEE support for some SoCs Some PHYs, such as the AR8035, provide so-called SmartEEE support, which enables the use of EEE with MACs that lack native EEE capabilities, particularly the LPI support. Since this functionality is usually enabled by default, it may have a negative impact on certain use cases (e.g., PTP) or even prevent the use of all link modes without PHY driver assistance (e.g., a full range of half-duplex modes). To address at least some of these issues, this patch series aims to pass EEE ethtool access to PHY drivers, enabling them to control SmartEEE support more effectively. The series consists of several patches that improve EEE handling for specific PHYs and MACs, making it possible to enable or disable SmartEEE functionality as needed, depending on the specific use case and requirements. As a result, users will gain more control and flexibility over energy-saving features and compatibility in their networking setups. Oleksij Rempel (8): net: phy: Add driver-specific get/set_eee support for non-standard PHYs net: phy: add is_smart_eee_phy variable for SmartEEE support net: phy: Add mac_supports_eee variable for EEE support and LPI handling ethtool: eee: Rework get/set handler for SmartEEE-capable PHYs with non-EEE MACs net: phy: at803x: Indicate SmartEEE support for AR8035 and AR8031 PHYs net: phy: at803x: Make SmartEEE support optional and configurable via ethtool net: phy: at803x: Fix SmartEEE support for some link configurations net: fec: Indicate EEE (LPI) support for some FEC Ethernet controllers drivers/net/ethernet/freescale/fec_main.c | 2 + drivers/net/phy/at803x.c | 158 +++++++++++++++++++++- drivers/net/phy/phy.c | 10 +- include/linux/phy.h | 9 ++ net/ethtool/common.c | 38 ++++++ net/ethtool/common.h | 2 + net/ethtool/eee.c | 17 ++- 7 files changed, 221 insertions(+), 15 deletions(-)