Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3245578rdb; Tue, 6 Feb 2024 11:17:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IHlBkFYxW65ShrzL3kMZrN5EceVpOl7fcWagqdhD4rT0Zc/iIjKtZjOjMQeodzzVm455kVl X-Received: by 2002:a05:6a20:2d0d:b0:19e:9959:35e with SMTP id g13-20020a056a202d0d00b0019e9959035emr2992688pzl.12.1707247072581; Tue, 06 Feb 2024 11:17:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707247072; cv=pass; d=google.com; s=arc-20160816; b=cMHtTTx/43pm0JeFHS7pSs+mWoIn1O3DR1PZpwg/yWP5AJBFHdZ71zZS/KEiKAZlq3 fo7oUjehAacutBI7A0DCvrf57qCAKSi2NLbE/DcIRknBaGh61KFkdOnXFfFyM6eotV0+ r71OccSD83+kGlSTDR32N/5jONnWotbVXD9y+epy4rVSQmkHZVZVnGvrvBAaZUlPIGmJ skaJKbG2SZJrI5c+O38r/TFavKaVBdV5MjoAo58oFO2RlcZIN2O+qRgSOYREJ0hxYPPa aVF1pWjtH0CQLUsOc5ZRme21lSaZgUq1e5bIAd0uhTk6xZhK4zL9qgZKIzYxc6cquejK t+bw== 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=T7oA3o1/PV86rg/COPWoNeGWudEDqQS1SUtT78lzkFQ=; fh=YfKs0KZmvVS3yBIntvWpoiFard5m8hM6YYAPG98o72s=; b=YTIxoYrLJmaDgtr9MTdsUFXVeG8zr/c7o6vB4lBf9Xn21mMuipuD0BlKoISqhgwrRz AARksYc5Vdc+Ul0155+eVwqx8N9YB/Rj3EqDXxBb3RhfkPwg5Idrt8QH33bgmWnzuXIa 2iRfzZGzN2cPYi9Mo1TJw3ovLGeqFcf7UAYobyxoUZnTqmRpLS932lWmMmm5KmuHPeFH qTXkLW3XP5mA+pnmkjgLcZISFVhjdxVeXur4V06qwQtgSrsCpZyBNyrnwk7q7br0tzHe XocUDyU2f5Hrr6bVD5jpvwh0ocN4+Hu7fOlaW5yrW4R3K3G1AyRtQFqCo/MNRopV38dh uYAQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@dolcini.it header.s=default header.b="Z/68Qkyx"; arc=pass (i=1 spf=pass spfdomain=dolcini.it dkim=pass dkdomain=dolcini.it dmarc=pass fromdomain=dolcini.it); spf=pass (google.com: domain of linux-kernel+bounces-55543-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55543-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dolcini.it X-Forwarded-Encrypted: i=1; AJvYcCWpdxDt6gJv784wlP/VtbRJLd8e+ej4geg3x5UtFECqeVXqO2+L0j5bcmWcdx+uYtwK0HHnT0W4qL1y+GA6i7TOZPkLqLtxBz8vyXLa+g== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id s37-20020a635265000000b005d8e0d44d86si2033497pgl.553.2024.02.06.11.17.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 11:17:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55543-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=pass header.i=@dolcini.it header.s=default header.b="Z/68Qkyx"; arc=pass (i=1 spf=pass spfdomain=dolcini.it dkim=pass dkdomain=dolcini.it dmarc=pass fromdomain=dolcini.it); spf=pass (google.com: domain of linux-kernel+bounces-55543-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55543-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dolcini.it 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 D3A8BB21994 for ; Tue, 6 Feb 2024 19:09:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B85DD13FFB; Tue, 6 Feb 2024 19:09:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dolcini.it header.i=@dolcini.it header.b="Z/68Qkyx" Received: from mail11.truemail.it (mail11.truemail.it [217.194.8.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E76AB13FF0; Tue, 6 Feb 2024 19:09:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.194.8.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707246577; cv=none; b=MKdYnkskbopFLP0zylyKfd8Xe/zrG0diuQv5w+xwB5vRpcqVn0E2WW1KD/hZbT+VmQiGbGyEf39uwdfo+cs8KEfYQAMU5WN1/lN506jX2P1qkWV7g/XLCel9ain4e5RKSmbqCNqrWoxvTuoHZWkejqityw195aQdhIw5JrTjvP4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707246577; c=relaxed/simple; bh=ICT9GMmbWANWtV3WdQlzASzd3A+oLCs55eUv8T8iveY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WDoT7cnp64eWASETjjCTi8u/Eu3Kh0fLN5uomHRpoGsJVehLAyhaIUnl3v27jo+X+vj0Sb+7W2uhRQsi0eLRTtrpvR1WIXwkcmGIpjS6Ug4/YsIOfVglXfU8Od1h+2dx+O4GnOtDR13D4Htc/WjdswZNsZMMuUSY86nsWW838RA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=dolcini.it; spf=pass smtp.mailfrom=dolcini.it; dkim=pass (2048-bit key) header.d=dolcini.it header.i=@dolcini.it header.b=Z/68Qkyx; arc=none smtp.client-ip=217.194.8.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=dolcini.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dolcini.it Received: from gaggiata.pivistrello.it (93-49-2-63.ip317.fastwebnet.it [93.49.2.63]) by mail11.truemail.it (Postfix) with ESMTPA id EA07622268; Tue, 6 Feb 2024 20:09:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dolcini.it; s=default; t=1707246572; bh=T7oA3o1/PV86rg/COPWoNeGWudEDqQS1SUtT78lzkFQ=; h=Received:From:To:Subject; b=Z/68Qkyx9maE5F2kdosAHBwgsa8JoWXLPIxbGMerQ3NiyEB6KxiJsyCmP69dSqGpG QoEGS0y9M0J5IvqyYSA0qmZBJyzoTkINmqrz83JYAdk6IcFnQqdOOuiQPoL5AjISRJ wfDhwYsFWINXVHHxd1GYs1LtE9KqiybGCSevQZR8k2n0pGs72RseXDGAV0XoNvsTHg dnww4I3OGkVZQ/WVRiT/lnjEvDDXSUgfMJcEyYE8/tTkOaW8SjimNZhCvJXGmQ0lmz FZudZKIiQtN2rNMQ+70KVeqJhkTTpbpTO99V940gvvU2rJb8vJrbCDajtQ9x2yp/dm YbLPyonDAO1HA== Received: by gaggiata.pivistrello.it (Postfix, from userid 1000) id 8FB077F98B; Tue, 6 Feb 2024 20:09:31 +0100 (CET) Date: Tue, 6 Feb 2024 20:09:31 +0100 From: Francesco Dolcini To: Andrew Lunn Cc: Francesco Dolcini , Wolfram Sang , linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, Francesco Dolcini , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] net: phy: micrel: reset KSZ9x31 when resuming Message-ID: References: <20240109205223.40219-1-wsa+renesas@sang-engineering.com> <20240109232838.GA3626@francesco-nb> <20240206172645.GA24848@francesco-nb> 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 Tue, Feb 06, 2024 at 06:57:37PM +0100, Andrew Lunn wrote: > On Tue, Feb 06, 2024 at 06:26:45PM +0100, Francesco Dolcini wrote: > > On Wed, Jan 17, 2024 at 02:33:53PM +0100, Wolfram Sang wrote: > > > Makes sense? Tests work fine here, at least. > > > > What I do not know, is what happen to any configuration that was done to > > the phy before. > > I'm assuming here WoL was not enabled, so the PHY did actually > suspend. > > mdio_bus_phy_suspend() calls phy_stop_machine() which will set the > state of the PHY to UP. > > During resume mdio_bus_phy_resume() calls phy_init_hw(). That should > do a soft reset, call the config_init() callback, and configure > interrupts. After that phy_resume() is called and then > phy_state_machine(). Do to setting the state to UP, the state machine > will kick off auto-negotiation, which will cause any auto-neg > parameters to be written to the PHY. > > > What if you have disabled gigabit ethernet from auto negotiation before > > suspend, it will be enabled again after the phy get out of reset. > > If you have set in fixed mode, the wrongly named phy_config_aneg() > will set the fixed modes, same as it would set the auto-neg modes. So > they should be preserved over suspend/resume. Thanks for the detailed explanation Andrew. What if the configuration was done using ethtool? Francesco