Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp770914rdb; Thu, 22 Feb 2024 21:48:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVEV2TdpqPvMTj8pW8CrrWWIFj27wjKe0KDqVfI8j4KAaXzqDfZa/YsZnSyE5Cvoj18urKcBkaiu+yGsb4vXhuG2991moNKyOGf+y9pQA== X-Google-Smtp-Source: AGHT+IGHDuuXdgFCO+jr276EgnMA4CBaQdULBBPbFUAsu3ckd9m++aYTQyuhgLh5KNz4ZuXWi6tY X-Received: by 2002:a19:7714:0:b0:512:ceae:93d9 with SMTP id s20-20020a197714000000b00512ceae93d9mr536193lfc.28.1708667292561; Thu, 22 Feb 2024 21:48:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708667292; cv=pass; d=google.com; s=arc-20160816; b=GvvN/USm2VHU4R7jM0K3YH8XAo3YayjGpUKe2YeYEw+t9nV/NcZtOolvy22aGVu4Om lQnuUfLo/+ghyOcRvlZEZrh80LeEBM+h3MnEoYVhGueNUHajgtLX4/U8eiWGITY53fN1 DI6V+EZKzKHwBN9k633FYRwq5HHENhNvE1TCH3qXfRdsSMrNPT77ExjRIQEv8Rfh/tYW X1OHKLyUQXF18HrBCMMCxUiGRv1gif6ORp1hDjjmDiWbnwTdbe/aExqMNa+R4pprpfSe /m1kdobuNBUM1TTpfjgyJgqWWp16ivjGd4229GQPvy69WBaUuoulNVa/O0He1ytlPkb0 70Bw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=wwJHcEXJBnD2/CByJIg7f4jcU1aHBQq4WUmLdblBqU4=; fh=nSGnxiCkGHvSwdZzBWr8Vfb7nqrzKJPpGvKRznqghQo=; b=mIKNKk3HVJ5misjw8DaRDa4siVMBow+qISVAyTsar7Of8l3buMzPOY2pcLtYagYrFO ZpowbH3YYf7k7SdHCz6zfacx0gU6koC69Q+7tWaWQzRcd/hb4bLZ6Y4bbwpmrIxyzYOc WTINvLCLOKBQazRnk0jFWnSWTueryFdmjibOmzH3pTeeWgrH/8MdT4pWHPOd2AtRlTF5 EZbfwqys9nbLl+iEFvMVuwvDdaEiuoEv73Lx8C+TozZ2CX+m0DYQlmHiKL3mgQaAafh0 M0PFUdIb9fdUXyZW5I7u+LuDz/E8btOrm7qsSik+x5+2MWzXsRRLpxIjg8jWklMg+wjz nCaw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-77803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77803-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gh4-20020a170906e08400b00a3d2b261366si5646274ejb.664.2024.02.22.21.48.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 21:48:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-77803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77803-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 44CAC1F25450 for ; Fri, 23 Feb 2024 05:48:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13B7E12B82; Fri, 23 Feb 2024 05:48:05 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B9C212B6B for ; Fri, 23 Feb 2024 05:48:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708667284; cv=none; b=WUOcJ9gVEDZpmS5K1Rn93stXlP1aJWfTmpn0In8+rapN8L07zkdVnh/kN5v5AxDv8Am/jnt6+UFiRN7h/ap3rw2MxBbNWmPjQV01jDU66rDBXV4U2dE+giuL8zXQfK3xRMkh2ccwTAA/Qef0H6AjbkBoHS7OCje1vvgGT89p+TE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708667284; c=relaxed/simple; bh=3lgspPdovin39r1dgbggC/l2D36BlmeTw4hkWatherg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WFP+074VBQCWwTBM1GUXI8nYQymdlQXo7ofp44463OqOCV3lPD0cHjCG3ausyEmjzjgvlwOmi4h5dnulMZQSyZlaIwg2Wjc5VGFuLd7Jn1Zrx2U6htpZD39yBsVrBMC+qK45gcOhL20Nz90GoLggvcVFZazELqMBHF1zmNl0BFI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rdOPX-0001VK-U7; Fri, 23 Feb 2024 06:47:51 +0100 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rdOPV-002Mi2-CC; Fri, 23 Feb 2024 06:47:49 +0100 Received: from ore by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rdOPV-004Aqu-0s; Fri, 23 Feb 2024 06:47:49 +0100 Date: Fri, 23 Feb 2024 06:47:49 +0100 From: Oleksij Rempel To: Florian Fainelli Cc: Wei Fang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Heiner Kallweit , Russell King , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Shenwei Wang , Clark Wang , NXP Linux Team Subject: Re: [PATCH net-next v5 6/8] net: phy: Add phy_support_eee() indicating MAC support EEE Message-ID: References: <20240221062107.778661-1-o.rempel@pengutronix.de> <20240221062107.778661-7-o.rempel@pengutronix.de> <9e37a9e9-7722-407c-a2a5-b8c04b68f594@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <9e37a9e9-7722-407c-a2a5-b8c04b68f594@gmail.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On Thu, Feb 22, 2024 at 08:52:25PM -0800, Florian Fainelli wrote: > > > On 2/20/2024 10:21 PM, Oleksij Rempel wrote: > > From: Andrew Lunn > > > > In order for EEE to operate, both the MAC and the PHY need to support > > it, similar to how pause works. > > Kinda, a number of PHYs have added support for SmartEEE or AutoGrEEEn in > order to provide some EEE-like power savings with non-EEE capable MACs. Will reword it. > Oleksij did not you have a patch series at some point that introduced a > smarteee field in the phy_device structure to reflect that? I thought that > had been accepted, but maybe not. Ack. They are pending at the end of EEE refactoring queue :) > > Copy the pause concept and add the > > call phy_support_eee() which the MAC makes after connecting the PHY to > > indicate it supports EEE. phylib will then advertise EEE when auto-neg > > is performed. > > > > Signed-off-by: Andrew Lunn > > Signed-off-by: Oleksij Rempel > > --- > > drivers/net/phy/phy_device.c | 18 ++++++++++++++++++ > > include/linux/phy.h | 3 ++- > > 2 files changed, 20 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c > > index 2eefee970851..269d3c7f0849 100644 > > --- a/drivers/net/phy/phy_device.c > > +++ b/drivers/net/phy/phy_device.c > > @@ -2910,6 +2910,24 @@ void phy_advertise_eee_all(struct phy_device *phydev) > > } > > EXPORT_SYMBOL_GPL(phy_advertise_eee_all); > > +/** > > + * phy_support_eee - Enable support of EEE > > + * @phydev: target phy_device struct > > + * > > + * Description: Called by the MAC to indicate is supports Energy > > + * Efficient Ethernet. This should be called before phy_start() in > > + * order that EEE is negotiated when the link comes up as part of > > + * phy_start(). EEE is enabled by default when the hardware supports > > + * it. > > That comment is a bit confusing without mentioning how the hardware default > state wrt. EEE is being factored in, can we have some details here? If I see it correctly, this function set initial EEE policy for the PHY. It should be called only once at PHY registration by the MAC and/or by the PHY in case of SmartEEE or AutoGrEEEn PHY. The advertisement configuration will be based on already filtered set of supported modes. -- 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 |