Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp587196lqg; Fri, 1 Mar 2024 14:39:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU1+4ZZaad94k0iEFaWqmLVz5O/6UoSFX9l5+koAgJKJeVC54S4ujlGGWIJdSyYl/X5hC3/mOkjvfsugodGRIFPW5a93OFwU4COk+2lNA== X-Google-Smtp-Source: AGHT+IE/V/mjb1CTZOjUZUfhCUiPyLxUmILNHfUq24ZP8id3cVxTTmS+4sZcLpALHnUS9NFP0Y9P X-Received: by 2002:a05:6a00:181e:b0:6e4:5ff9:f037 with SMTP id y30-20020a056a00181e00b006e45ff9f037mr3900227pfa.12.1709332746174; Fri, 01 Mar 2024 14:39:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709332746; cv=pass; d=google.com; s=arc-20160816; b=jnygJG9BTAr2WkL+G7NSBKN/USwaQr3gZKu3Yzh0keFWeMwEzQYZ7z643wr/MCtXhg fWJ5+ABwOIEIpGSdBKWxhz/7363HE0rBoY6CCjIDgTtey4jRLpTztEt1glNcNNoidWuW JQPsSYru9R+BfbsVIPCoQwo3kD/2Enop9Lyn3f+RPq+zIZ7KhyA2NqPihigtILVWzUam eifMcmc099LqZsYFHCRrUS0/Lt03z8E5nbgAI0jb3EP6EijMtpT6o1kMxHeAVJsMnSxE kfcHLE6lx0tYu5ytQ0aa8gqeVONlHW7yhAwuMlCbljeBxJhaliRfUqqdWzPWYgrx3h4D mpUQ== 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:dkim-signature; bh=aMBepLHt9KOhTSKMxp2ZxKrSNDdYzAaav19hviKd2ZM=; fh=Xh+dPONH6+X+5W/zlZ2XAgbsebYzs8/Lz9NwJlt8Fr8=; b=UoyBt5XOSE0xPrtloH70OsBxY/R4aNXWEIP/FBdJN/1H6SOCIqVtpmA1gVPrEFwEap bHcSG+2LMgfEevzH5Acvf8aCNMrh7XFsIsVYrohJyAsmopFEfT8DWjHOGLebGNg3br2j UfGoVA8XGJ8cvrmMeUbz3//4KNJezxz4m/neN7i+xaX9kRefuDY7cfOCLavzKJabZ9Dp fHfgYUvG9lfPoz3XHLnAtyu7wxKvA8rQ+yDiLHUrvKHeqb/bDlpc4+C0+K88bYfWqpGG V3aBl3bqWhMNnS5eezVe+2kupngWsG4uFkiQgol6KLqvaqjRI/wWJX68GTDTRGyxPj8r NeNg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=5hnCEe7J; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-89204-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89204-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id a13-20020a056a001d0d00b006e59c9120eesi3783196pfx.1.2024.03.01.14.39.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 14:39:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89204-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=5hnCEe7J; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-89204-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89204-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E7F3DB2260C for ; Fri, 1 Mar 2024 22:39:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2977F5EE6F; Fri, 1 Mar 2024 22:38:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="5hnCEe7J" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (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 6F4FE58AA2; Fri, 1 Mar 2024 22:38:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709332725; cv=none; b=u00/ACCAWAI1ux9QIwttASM/pnuqq+FqDKGeVRdoOgmHPR18jC7J11doudQw6mR+X2YftmoajJlrZ6pnseJW3XZPfhWVzhVagRAOHhHFiB+pQrfhuloI6drEFUXO+549w+Dq6Qtcth/pjN7qx7Uiz9poIBsJhtPP7nBT0D2NaTE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709332725; c=relaxed/simple; bh=C9fObou1QGzt4uneeySbp7ggNXccPusKJQusLbBhhqQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GO6ius2D6Oj0EkvHyIEkeqj1a3GEORJUgv9Jq51xuqMGBRCVwhzehEXmmiXmMZmTL+ZyKZplKCpumzsCoGPY10UuNH9Tfion4ukqMa4HOhSQmhrXBF0zrOIM/5H8WNlInOWPqywQ7SwKYjg5c+ew2d822V8FkzQm6yoed6zdSmo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=5hnCEe7J; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date: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=aMBepLHt9KOhTSKMxp2ZxKrSNDdYzAaav19hviKd2ZM=; b=5hnCEe7Jji8OQXYRKU/4Ea439+ Di/8AOpweoRL8bL/alOpkLjpeyzVmkiqmWCgpjKZpvYiZVvcuTgnvtS1R5EK/EagR76WHJa1KLIon RpNh5NKPO3r6fDeAB79pbCLYL2qvWOZLq06SAWacPCdYsmA23u3tm+xh+INa5n2PExjA=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rgBWm-009B3c-Ip; Fri, 01 Mar 2024 23:38:52 +0100 Date: Fri, 1 Mar 2024 23:38:52 +0100 From: Andrew Lunn To: Oleksij Rempel Cc: Wei Fang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Heiner Kallweit , Russell King , Florian Fainelli , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Shenwei Wang , Clark Wang , NXP Linux Team Subject: Re: [PATCH net-next v8 5/8] net: phy: Immediately call adjust_link if only tx_lpi_enabled changes Message-ID: <8cafe975-e898-4f6a-9389-0a655d6dae22@lunn.ch> References: <20240301100153.927743-1-o.rempel@pengutronix.de> <20240301100153.927743-6-o.rempel@pengutronix.de> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240301100153.927743-6-o.rempel@pengutronix.de> On Fri, Mar 01, 2024 at 11:01:50AM +0100, Oleksij Rempel wrote: > From: Andrew Lunn > > The MAC driver changes its EEE hardware configuration in its > adjust_link callback. This is called when auto-neg > completes. Disabling EEE via eee_enabled false will trigger an > autoneg, and as a result the adjust_link callback will be called with > phydev->enable_tx_lpi set to false. Similarly, eee_enabled set to true > and with a change of advertised link modes will result in a new > autoneg, and a call the adjust_link call. > > If set_eee is called with only a change to tx_lpi_enabled which does > not trigger an auto-neg, it is necessary to call the adjust_link > callback so that the MAC is reconfigured to take this change into > account. > > When setting phydev->enable_tx_lpi, take both eee_enabled and > tx_lpi_enabled into account, so the MAC drivers just needs to act on > phydev->enable_tx_lpi and not the whole EEE configuration. > The same check should be done for tx_lpi_timer too. > > Signed-off-by: Andrew Lunn > Reviewed-by: Florian Fainelli > Signed-off-by: Oleksij Rempel > +static void phy_ethtool_set_eee_noneg(struct phy_device *phydev, > + struct ethtool_keee *data) > +{ > + if (phydev->eee_cfg.tx_lpi_enabled != data->tx_lpi_enabled || > + phydev->eee_cfg.tx_lpi_timer != data->tx_lpi_timer) { > + eee_to_eeecfg(data, &phydev->eee_cfg); > + phydev->enable_tx_lpi = eeecfg_mac_can_tx_lpi(&phydev->eee_cfg); > + if (phydev->link) { > + phydev->link = false; > + phy_link_down(phydev); > + phydev->link = true; > + phy_link_up(phydev); > + } > + } > +} > + Thanks Reviewed-by: Andrew Lunn Andrew