Received: by 2002:ab2:3b09:0:b0:1ed:14ea:9113 with SMTP id b9csp167379lqc; Thu, 29 Feb 2024 13:35:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV70LGbo34uphIzgSv9o4Z1YnJW3ISHAK6IzvCsJsCEE1Bzbg8j5uE6ARWyTervrTevCOFbWTgk5ybgr/hvj2KqUgEyM4cG/yqOUHC1oQ== X-Google-Smtp-Source: AGHT+IEcU/5FOknU6ECJ+jDg/qBHC/F9ovaDd43Vvr6awsLbVAJKc3IXgnJohQ0RojF90uvEFO2Z X-Received: by 2002:a17:903:1211:b0:1db:f372:a93c with SMTP id l17-20020a170903121100b001dbf372a93cmr3864384plh.43.1709242556124; Thu, 29 Feb 2024 13:35:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709242556; cv=pass; d=google.com; s=arc-20160816; b=ANyExVUXOHCzSnWpGjRp9lct9P+V5Un83B6Kw9vnPodguSiAgGbok9snnoh23NDU3/ G0SHk0laqiDvf5JvkNv5SiGoptCm6W9dqHSj6u2IoDMExO7ZprH38LUkEPiy58RAdBVx r6qKV/v8NQkN3bFlQTkL8WzVHJ4YIl+YuZecrmsj1pu7vzRGZLjNghMQ4kk3tUN4nSWG /Q6Yj5cDwki1tcoG825w/8caDEt/H7XdPPMIZlAn5j3q5uBjlv+OISr1Wag1+8KT/K5B eLJaAheEXNXI9nNEIWi9x7jKMwwnmWtrS2KIlZuy3pAAtCNp8FJxqvZMLjEMitJinjGO MNxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender: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=Kpe+BD9QqvU8mxo+1QWrY9BtJ/AXIEAAzW2g70pFWD0=; fh=h+u1NWlZSZdxB6zdg/vVFE62W1ussezizzT8mHzgow4=; b=Hy7dtPElx7L3uIMAwBHAUBGZG/SV+t1LaHT3k3yfQYgYqJFRCmuvhgUMF6UJyIfpM2 BxBf33PLC0CEKTnMmoPYexTwRArN/0/3n+gVfPvO+hYZ0bzjPf4131a9bv01onslLNvf D8cmjKCIrcSdNvUoC1ZWsXpa9KJAgqMusDDK+682ccmXNKs+gWStPajlTlnfUuNpDVbx 6ri5vAYUcpbY88pIiqXWcx3x5h9bBFplJo59bca2hoFhwCsd0DeckgGZMla3uQvk3NBY iqc25gcFEHAB+v+3N5X9LAAZxxg2EI1IG7Zb7Phwug7vydpCm4frMPQizQ1AR8b0GdD9 hSQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=z5Pa4drf; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-87571-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87571-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id lk4-20020a17090308c400b001dc95e444cfsi2112216plb.255.2024.02.29.13.35.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 13:35:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87571-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=z5Pa4drf; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-87571-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87571-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk 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 242A2B21DBD for ; Thu, 29 Feb 2024 21:20:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A7EE16FF51; Thu, 29 Feb 2024 21:19:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="z5Pa4drf" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 81BB516FF3B; Thu, 29 Feb 2024 21:19:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709241598; cv=none; b=csp3hhZc1/qllOBI2thYYcCODNvni4jSiRiVdcxDMQti72NgyAU1xDl1DVvHZPZkGG6LLQD/Fn/5o/J8N+PCE2cs1IQh4tChuXa42s96QhE/SYs79ikA1aRVFyG3GH+5ceLAnv32RokI5+YeY6y6hV7JDJ9uAlTvRmBArK13snE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709241598; c=relaxed/simple; bh=u3ijsbwwWVJZZGFrjEW1ukuiYsJN0bV+9R2jacwvjH4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uC4qCwNo78l8rZQxnEOkKgT5j4YDzj+hEdM6iRu7lVuNrQ8eI0PupilDUtztbbgcKS0QQVYQo4WowYclD1ImrEwIFkRXeRr+klaOht5vcWYYNdIdTEZXqP2EREsnC4fKvRV49h5RBjXvzSk4kTiQWei2cSXcuEoPJ5mxOqpUoRc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=z5Pa4drf; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Kpe+BD9QqvU8mxo+1QWrY9BtJ/AXIEAAzW2g70pFWD0=; b=z5Pa4drfS/hdkyfz1vhMyqJeRh 1ohaIJ0HH4hAhkci2wtEEIAJCYZfCEKUgi/467nAcM6EGzBUkBwLbL79iuiS90dpP9jJG7Ow8w13e NERyPTxRxyt02vi4+ymA2TKvuQIc7weuwEIfFmOR2vrdJzFT59KKNnQPjEpEl9rxxOwEiWZCAi81k iQR4CSCjNOmU3lmeljn4X1fjLtYQfLG6aB7xsYtnx0gZYuwAYAW2BqO64wWPWOxG2HUjmXyPBMXpO yPvwPC4wAHJ/AIW4w4spaaY6AyzmxFADdVbn9h3MeC59/NupDAccPDAsZq2MNW7ba17y6YYhkGb9n gWxX5RaA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35576) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rfnoY-0000pd-2p; Thu, 29 Feb 2024 21:19:38 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rfnoU-000189-Nk; Thu, 29 Feb 2024 21:19:34 +0000 Date: Thu, 29 Feb 2024 21:19:34 +0000 From: "Russell King (Oracle)" To: Oleksij Rempel Cc: Wei Fang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Heiner Kallweit , 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 v7 5/8] net: phy: Immediately call adjust_link if only tx_lpi_enabled changes Message-ID: References: <20240229140800.3420180-1-o.rempel@pengutronix.de> <20240229140800.3420180-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: <20240229140800.3420180-6-o.rempel@pengutronix.de> Sender: Russell King (Oracle) On Thu, Feb 29, 2024 at 03:07:57PM +0100, Oleksij Rempel wrote: > +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) { > + phy_link_down(phydev); > + phy_link_up(phydev); Unfortunately, this isn't sufficient in all cases. Phylink will be fine with this though. If we take a look at fec_enet_adjust_link(), then we can see it tests phydev->link directly (which it has to, because there's nothing else to determine whether the link is up or down. FEC will cope with its fec_enet_adjust_link() being called with no changes however. In order to properly resolve this, I think we need: if (phydev->link) { phydev->link = false; phy_link_down(phydev); phydev->link = true; phy_link_up(phydev); to properly avoid the issue I've referred to. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!