Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp978218rdd; Wed, 10 Jan 2024 05:21:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGoGPo+rBkQ2XFjtE2lUoVSm+WLk93fH4GYTvydZquR0Fyf7FbHIVD2rIGvchCD919DNrl X-Received: by 2002:ad4:5fcb:0:b0:681:1885:40f4 with SMTP id jq11-20020ad45fcb000000b00681188540f4mr1161318qvb.130.1704892870968; Wed, 10 Jan 2024 05:21:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704892870; cv=none; d=google.com; s=arc-20160816; b=GzLhwqZBlFYipwZkjEpL+2o8LXj59A+mLJD1hgpmY79A8i44Y0DN8OJmcGPmCyhB0Z uH829WBIxC6G8vFg0+d7EQQNoGdvZwW9QXTszLcn6MaEt14kSQzlYCYx5nv196NELGxH 2/u0rSVvac6SlL5iqbVNr0fZMPGOd7BiDg0B2nZEaynXwzcdUywZfW0I1cbMwwDZySJS 6PuC9Cx9ZGzY6IYY08Xu8/FrjjQHCcjG/fNAeqWnodwbu8Ps+pvn+UAIbDbp4Vycx9nU N5SmqBCfVlgQciXnUaMyJrXzU22pTTRLURArnivW+aQhG7BR/mdvbx4j4v5OAJzGtr+R 3MJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=YCkcD8LjRksDas2PtB8JO47e3MMJedookR84ZvoZyac=; fh=imksQgK2lxcnofi7wMEmt3uxj+dNkzsVg1r7Nhmt0JE=; b=y9/3xogYTLdL9MFcS+xoOZMmt6SoPZEZC5v0clQvoyNDVJBz41EAzhlmun1AzGyG/L Zx3o1N6IdVxbOW+sUMckDxlDdLoP0ESSq2ELyEV8IWc+dktDkRzK/5+ji8pnmVQJtpNb N/xtC4GAigOMJSYwilB/P2aW+ttt/PE9WNYdqeMfvxXOCLuF8gGlVwOhC+Ryz8GseDyP 7GsELpxWeDtBXm1YE3WxfhZCJOXdj8srb3jHC5ObUCN8cmBe8aJF8AQmKTLV790IevSF pRV3FXzwyWqw8GK8z12R4u9BcZjSG8l9qYGs09CAB8meT3dzcS0uq16EYb8QbELDjMAp 8pDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=MFyST6Py; spf=pass (google.com: domain of linux-kernel+bounces-22225-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22225-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 z15-20020a0cda8f000000b00680b0f40fb4si4406433qvj.206.2024.01.10.05.21.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 05:21:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22225-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=@tuxon.dev header.s=google header.b=MFyST6Py; spf=pass (google.com: domain of linux-kernel+bounces-22225-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22225-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 8FB511C22170 for ; Wed, 10 Jan 2024 13:20:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F23F948CD5; Wed, 10 Jan 2024 13:20:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="MFyST6Py" Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 99525487A5 for ; Wed, 10 Jan 2024 13:20:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-40e5508ecb9so12412245e9.3 for ; Wed, 10 Jan 2024 05:20:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1704892822; x=1705497622; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=YCkcD8LjRksDas2PtB8JO47e3MMJedookR84ZvoZyac=; b=MFyST6Py6D6ev3dlzQ1fiUFvB93vMMhbBXy1A20u1nMLJfRRFBqB06UduA88eZLsnr 2+2cufqDBFdWANXQP1eMhTAogXwOGy+MUztrqAoat1JOeX9XyfWAMONtIkob1YEg/Mac 4AeLI8g1oJMPAG2dauT8yfLa3OKKss5pzao35u2OJ2HnsqSLlHt/BzOcUOCiAH2TJY66 o+CiB6SVQ//HIvvO70oJrII65qBpGS1odPvuTq/5OEzbmiBX9/AyN1SQ3XfSYrkN2fcS ee35NVeC+lZi2aNFDQZGFz12R3PqUnNvH6zI3LjRCndukKMx868w5MlLy3rqBiIV68ub Vofw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704892822; x=1705497622; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YCkcD8LjRksDas2PtB8JO47e3MMJedookR84ZvoZyac=; b=vGOQovYf+e1JN6cRun6zZcSaL2kEE3a3ThYskOcg/P98VbVcW2JW+uXNMQHB7M751M vQihUzEUQkr5xICthDv0YUaXnRjpOKZNw6Xgv1YjbNTBL24A6pIGaaJjRFSRR0NqJyNF CFMOqRLKwTPeOljy9JBrxDmpGb/c3DTrqKh6/6zu0DXODmw62Gx2PDAZpNDywrrZam/G RhgdhECzTw6SSjsyqm1X4Q/1u4aQBc9Jx0d3wKzcDG4sVpZCz5V2TIh2thtx1v3opRp/ cukr6KUD9azRN/tSj6xZ6IbHmoxVb7NRan5kVtvd5obn+XU+leAKAiFY3S8qo/SxoV6y +7/w== X-Gm-Message-State: AOJu0Yx6umWkTgjW3bmTO3Rc2yn8r4hXeSn7A//iDA0SQlokRHUPkNK8 no/yt8fIxJwIDv1mkb5TZt7/tsZk18OQmQ== X-Received: by 2002:a05:600c:5014:b0:40d:91b9:436b with SMTP id n20-20020a05600c501400b0040d91b9436bmr611598wmr.183.1704892821813; Wed, 10 Jan 2024 05:20:21 -0800 (PST) Received: from [192.168.50.4] ([82.78.167.5]) by smtp.gmail.com with ESMTPSA id n16-20020a05600c4f9000b0040d62f97e3csm2200114wmq.10.2024.01.10.05.20.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jan 2024 05:20:21 -0800 (PST) Message-ID: Date: Wed, 10 Jan 2024 15:20:19 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net] net: phy: micrel: populate .soft_reset for KSZ9131 Content-Language: en-US To: Andrew Lunn , "Russell King (Oracle)" Cc: hkallweit1@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, yuiko.oshino@microchip.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Claudiu Beznea References: <20240105085242.1471050-1-claudiu.beznea.uj@bp.renesas.com> From: claudiu beznea In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, Andrew, Russell, On 05.01.2024 16:36, Andrew Lunn wrote: > On Fri, Jan 05, 2024 at 09:43:22AM +0000, Russell King (Oracle) wrote: >> On Fri, Jan 05, 2024 at 10:52:42AM +0200, Claudiu wrote: >>> The order of PHY-related operations in ravb_open() is as follows: >>> ravb_open() -> >>> ravb_phy_start() -> >>> ravb_phy_init() -> >>> of_phy_connect() -> >>> phy_connect_direct() -> >>> phy_attach_direct() -> >>> phy_init_hw() -> >>> phydev->drv->soft_reset() >>> phydev->drv->config_init() >>> phydev->drv->config_intr() >>> phy_resume() >>> kszphy_resume() >>> >>> The order of PHY-related operations in ravb_close is as follows: >>> ravb_close() -> >>> phy_stop() -> >>> phy_suspend() -> >>> kszphy_suspend() -> >>> genphy_suspend() >>> // set BMCR_PDOWN bit in MII_BMCR >> >> Andrew, >> >> This looks wrong to me - shouldn't we be resuming the PHY before >> attempting to configure it? > > Hummm. The opposite of phy_stop() is phy_start(). So it would be the > logical order to perform the resume as the first action of > phy_start(), not phy_attach_direct(). > > In phy_connect_direct(), we don't need the PHY to be operational > yet. That happens with phy_start(). > > The standard says: > > 22.2.4.1.5 Power down > > The PHY may be placed in a low-power consumption state by setting > bit 0.11 to a logic one. Clearing bit 0.11 to zero allows normal > operation. The specific behavior of a PHY in the power-down state is > implementation specific. While in the power-down state, the PHY > shall respond to management transactions. > > So i would say this PHY is broken, its not responding to all > management transactions. So in that respect, Claudiu fix is correct. > > But i also somewhat agree with you, this looks wrong, but in a > different way to how you see it. However, moving the phy_resume() to > phy_start() seems a bit risky. So i'm not sure we should actually do > that. It's not clear to me if you both agree with this fix. Could you please let me know? Thank you, Claudiu Beznea > > Andrew