Received: by 2002:a05:7208:3188:b0:7e:5202:c8b4 with SMTP id r8csp838632rbd; Fri, 23 Feb 2024 05:18:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXeANO64lc5vBvdauNSdZCAo/5w40TLAtUgRHAkW3gbO+BwRetVQw0vO4Lx3YvGj7tqUYFzm6TGCOdHxxFa6W0YAy3miiSqM/yb50MwKg== X-Google-Smtp-Source: AGHT+IHapl0b9pmrKwp11MJ5xjMV6rVpZJJugfsDWLr1ZJ6beI6F5BUrzlKM4yxiu2i5857JGU4u X-Received: by 2002:a05:6808:e83:b0:3c1:54eb:ff0a with SMTP id k3-20020a0568080e8300b003c154ebff0amr2006520oil.7.1708694329068; Fri, 23 Feb 2024 05:18:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708694329; cv=pass; d=google.com; s=arc-20160816; b=CuU93+6Wb0dQk5KcqYqehWX2XW2eWt2AqncBVM/l/sNUUz6MufWzfs0I6Jyy3/A4zE UZ60vUyqR87IGJvetNc8o84w1PCCq8/gY/bK67jV/s6kJ9/j81ZKEImpWngnCag0PPpv oVUDVzb/TT89gKenGpo/fvwRj0Q2Qm+DqyBecPMspSz+9FcJGA3NIaldKZQrg21C0w6B T4nq05zC4kEKa9G9FpFz0yu89glqdU0rcmSA7Q7pQzYsJXSv/nBR8k0NqzpiqrjhhcYt +DSIPPw9MabH02tdukCmDcF9WyZjDN+inX5nsKSfupoWSlDh59zZhtnoqZZeVEuDw/Su B4cQ== 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=3tX/zOPdfg9oNGtHW1EObwb4Rk2/rjHkYa5cJrgte9Y=; fh=+EYc+ehrj0zgEnv2ZHECVJYj3cZ7QmfG/9FcE4v9v+Q=; b=CYF51LPjMsG1djvyAeiov8pXjPo/L5N9NCRCjGPWI8ih4qUzgjunLHDgJrGPHEqImN f1ClGEFWb8fW5Tc7lp6A+B6+KqXJ1T62EB3k6Bq700S+h8O6RX4X8dyn8SZGeNfpC1Xl 6xMethEwwDelwDvDrsLGBpllTVPqBkkvoZuRaEztzRUnQWeu33PAWrCXbYVumJitKwhi 9Vkv1uT+OdAjVkkCcdyDIH5aYgX0C/QFstCbQkaewk91taqBSDjUIpiWk+5g2pVejPT3 fhdj9MefsP3AFhKZKC+pWcEIgM+OvQ4i7ihGt0ZLRrb4+dSqfNB06h54UjP6bRDPyZ5e YPFw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=u2D2k5NK; 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-78368-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78368-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id kk7-20020a056214508700b0068fdb1356b8si731538qvb.427.2024.02.23.05.18.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 05:18:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78368-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=u2D2k5NK; 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-78368-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78368-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C9B601C222EB for ; Fri, 23 Feb 2024 13:18:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F97180629; Fri, 23 Feb 2024 13:18:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="u2D2k5NK" 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 3695E7EF0E; Fri, 23 Feb 2024 13:17:58 +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=1708694281; cv=none; b=h9sG7U+5cVTAy1LBQhZVHnbfWi39Xm79HcL+nqCFk5juyyCGH3vRPncpPKV7mOwK1zOeabnQtGXEziGnlCe5sx15X9ZG1UmfPJEHe5h/4A45yn8iwr3nNpANpIv9rRZP9un1ZTGpuZlS9FqDqCfFMIcLjRkr6OgO/U4gmrDKcTQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708694281; c=relaxed/simple; bh=CJwV3AkbNYPmxUtNmWgmvsfyzdT6QZj/mLQfhzuCHbg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YwP5uOn9d/ytb/8GCmyHkY0zQZ72FXgG54Bnp0T9nKZsvTLOG+JC81ZknlHd4GPdaLLdGDBDCHn0T8lXjbomvDJFt3SMguRWkF5BWvoN/GPWu2vAad+pXVPR8ZaohHv9nEKCAb4gJIEcjzd9QP/fPnJRy/1j8FoM8TzlQDyTdqI= 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=u2D2k5NK; 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=3tX/zOPdfg9oNGtHW1EObwb4Rk2/rjHkYa5cJrgte9Y=; b=u2D2k5NKU+S/KbwkFfxUYlFwN/ j3v1IlFcMP3UrgK0pvVk/iTGY6eSlEVv74H1iPHksgNX9i8NhkFK/DCbft9HnBoy4p5iP6/606lAa cMJxgO1KQbuN5LQB8d9roKaKLJTXftU9Prtm4fwGFl8ZXUkL8CSYKX/Jh5nKU2rBHTns=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rdVR9-008XUK-2k; Fri, 23 Feb 2024 14:17:59 +0100 Date: Fri, 23 Feb 2024 14:17:59 +0100 From: Andrew Lunn To: "Russell King (Oracle)" Cc: Oleksij Rempel , Wei Fang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , 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 v6 5/8] net: phy: Immediately call adjust_link if only tx_lpi_enabled changes Message-ID: <84e1368d-ec6a-48af-945b-509528c45dff@lunn.ch> References: <20240223094425.691209-1-o.rempel@pengutronix.de> <20240223094425.691209-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: On Fri, Feb 23, 2024 at 10:38:20AM +0000, Russell King (Oracle) wrote: > On Fri, Feb 23, 2024 at 10:44:22AM +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) { > > + eee_to_eeecfg(data, &phydev->eee_cfg); > > + phydev->enable_tx_lpi = eeecfg_mac_can_tx_lpi(&phydev->eee_cfg); > > + if (phydev->link) > > + phy_link_up(phydev); > > I'm not convinced this is a good idea. Hasn't phylib previously had > the guarantee that the link will go down between two link-up events? > So calling phy_link_up() may result in either the MAC driver ignoring > it, or modifying registers that are only supposed to be modified while > the MAC side is down. When auto-neg is used, we expect the link to go down and come back up again. Here we are dealing with the case that autoneg is not used. The MAC needs informing somehow. If we want to preserve the down/up, we could call phy_link_down() and then phy_link_up() back to back. Andrew