Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp509230rbb; Sat, 24 Feb 2024 09:57:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWWEpoDfy0GMkBDTXF0wz1UAMNQnyqx5EBG3Ry9OR3R4cmBJqZtd6RRcSmTAxXG5vY94b9uG8PkRDv3Ta4hX/Q+0S2n6N9A3L9YOp7Uew== X-Google-Smtp-Source: AGHT+IFz3Yy2M1MNZ9IW//T+e5ub7ORC1jDmilAhe5+ejPGGjpQw7PQp59KQG7BOq06zD/z6mVIb X-Received: by 2002:a05:6808:1795:b0:3bf:ded4:2d15 with SMTP id bg21-20020a056808179500b003bfded42d15mr3556201oib.50.1708797478981; Sat, 24 Feb 2024 09:57:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708797478; cv=pass; d=google.com; s=arc-20160816; b=lUCPO/ENDILDpDxERdk0bnqEO6LhiKD6NOrsCz4wGKBf+SkEKihFMc02p303Q8Qwmz VmgyaLuaymNDB+di9YD/lLA+IL3JU7fkdiE/hQcWJ87+SLRVZDzpS0ZVCTZtU3lm08H4 sybHpt3E++E6Kt5wCZNij9tLdg75WurmcqDVIvdq/uq7UVkn6MyvLi09qGcwwIWqxjOb lxNgR+Axfw4Q6GN4BtMBOjCyis8DS83RDrFRRffYYpspepWRoslxO8R+imW+NePEzNsj uq12WWuQ6ecT1wzz92sXZIvwaZys3o+NsIHnLBKemMVqnMMZJLHL0k3F/rsJ2saIGnkN ehyw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date; bh=XDG042FEkW/wHzDKQ4mTMDHHvl6JePtTqErar60Dbtc=; fh=wa+SckufT9ASgKBiFXGw37CMvXCu8vIrGO+xJUdy9gU=; b=Fq1o/quWFvDMdHKn4iB2ibb69I4dkUE9wCC9Op5SZUohJjF0tA9SnAAQdPUOBpHAl/ UuT55NVNGTWB6VebncM54PywftRi3dTFr6PbWSCnJ43LIX48spKIYSebjpbwaC7s9gvJ kvMV16/Khk5BuBIaYDUF6U8pUic3KIMC9L1udE+O+iwt4kFlUriUh0MdlSfr8ZlltHqG 9rl0f8C3/83c0y+80Pgs/3F+ne8AxTDMyhs3TraNhCflOF2Tz2MkkYhjohdU0VRpMAbt p3ciDheeRbAqCVZbbFIFsZJbnu7g+G91EQCpc17U+hXHjmnoKlqikVWEraqV+GlnsuIl B4ag==; 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-79775-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79775-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a5-20020a0562140c2500b0068f45b80656si1521824qvd.138.2024.02.24.09.57.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 09:57:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79775-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; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-79775-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79775-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B5ACA1C20C46 for ; Sat, 24 Feb 2024 17:57:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DDE29481D0; Sat, 24 Feb 2024 17:57:51 +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 5A25E1362 for ; Sat, 24 Feb 2024 17:57:48 +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=1708797471; cv=none; b=p57Ohfrgj+ustYeFDfPO7I71NVJHAdX+6pUNTPOnXsRr9FQdTn9QEOMRPtwO44NhqlZEy7iJomZCG+aKdMkdAKa1e9bQfyEs8eDtBevVQKU7Ki/GyP7kEH0lE3mBpyaAIpAZCwhxt1pC6DL/2LaJSC7xpJt07iNABdWALxJwXV0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708797471; c=relaxed/simple; bh=tR5PRCTus2EF210gXUkGX6tXvo6hwHDBhRUrqzTaugI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AZTUyYuVlz8nZk8PTMlndtgmv4KA4DUrbRj7n4EPmrHkj9X8kFLJ61O6OucuZLE+DI0IdiAeXqrQwnQdccsH5ZM8bRhb/orNzztlYMyIXqfVc8FfewT+B0vmXYwMa2mD5J+35/ZRGNlYD2ZIt4ccHQW6J8+gW9oNee1hht7rs4w= 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 1rdwH0-0001uP-7w; Sat, 24 Feb 2024 18:57:18 +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 1rdwGu-002ef9-Po; Sat, 24 Feb 2024 18:57:12 +0100 Received: from ore by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rdwGu-005pID-2F; Sat, 24 Feb 2024 18:57:12 +0100 Date: Sat, 24 Feb 2024 18:57:12 +0100 From: Oleksij Rempel To: Florian Fainelli Cc: "Russell King (Oracle)" , Andrew Lunn , Wei Fang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Heiner Kallweit , 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: References: <20240223094425.691209-1-o.rempel@pengutronix.de> <20240223094425.691209-6-o.rempel@pengutronix.de> <84e1368d-ec6a-48af-945b-509528c45dff@lunn.ch> <6af3406a-7968-41e5-bf6e-71d020d8b28a@broadcom.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 Content-Transfer-Encoding: quoted-printable In-Reply-To: <6af3406a-7968-41e5-bf6e-71d020d8b28a@broadcom.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 Fri, Feb 23, 2024 at 09:53:06AM -0800, Florian Fainelli wrote: > On 2/23/24 05:26, Russell King (Oracle) wrote: > > On Fri, Feb 23, 2024 at 02:17:59PM +0100, Andrew Lunn wrote: > > > 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 !=3D > > > > > + data->tx_lpi_enabled) { > > > > > + eee_to_eeecfg(data, &phydev->eee_cfg); > > > > > + phydev->enable_tx_lpi =3D eeecfg_mac_can_tx_lpi(&phydev->eee_c= fg); > > > > > + if (phydev->link) > > > > > + phy_link_up(phydev); > > > >=20 > > > > 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 ignori= ng > > > > it, or modifying registers that are only supposed to be modified wh= ile > > > > the MAC side is down. > > >=20 > > > When auto-neg is used, we expect the link to go down and come back up > > > again. > > >=20 > > > 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. > >=20 > > Would it be better to have a separate callback for EEE state (as I > > mentioned in another comment on this series?) That would be better > > for future SmartEEE support. >=20 > That sounds like a good approach to me. The additional callback also helps > figure out which drivers use the API and it should be simpler to audit for > changes in the future, too. At this point I need help to understand how to proceed. What exactly do you have in mind? Some description like following would be helpful: Add callback with name phy_link_set_eee(), which should be executed in function bla/blup.. Regards, Oleksij --=20 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 |