Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2355993rwi; Fri, 21 Oct 2022 02:57:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5X+R6j+8PPclfYRs+VoAPGj1lvMTwDpDngwRn0S40hVFzpfoK2jc+hWD95JJug1LsTN6Kx X-Received: by 2002:a50:9519:0:b0:45f:ca89:cf9a with SMTP id u25-20020a509519000000b0045fca89cf9amr8124838eda.248.1666346236750; Fri, 21 Oct 2022 02:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666346236; cv=none; d=google.com; s=arc-20160816; b=TfTy16GBFohJ6WvnKAhaDKFdO6c6uz/Zk4ERO/ZgtiaS/PqETj1SOssCbGRZ0AtAsB QaGkgfcohBeV0VlnducxwdP7Jsau2L/SdTGmqPlcVeK5JEDRiliJALq5TJKqe1OyQqAa n/VBDitTDFM4ZPXDH3uJoenu6G8RPaRyzfTqovOA9uLQzVsFEAOL8HEMep8qkFNgR5ae nIvlv9yE6HceObSntkXWUwZEdoGWQvs772U1fnTtpC3cu8BB8zFphZWnNq9ZxKQPr9xo yh0EyrjAJe3EAr59BvBtoH0mshbSRs7iv9ZzglEzJaGLQGjLM3otH9EWLGb2D3sxGXph pgtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=WS9U/h0eLREvN5YCEYIxxoDx00yD2VskE3FYytt/kXw=; b=gcQq6yw2NuM695rNSE5zJux6ZfrDoRKLt49U4Djfl+PDDYqIJlY6O4a+6pU+yMkxEE XR56H9VgvzMi457EK+8WqoUHkUQfOLOU0JMW0WwziZ1Q2GXgFHu2jNE2B8Hc7GWnvE+u ERtZYHgOTTm6rhDfqzrW222NClpLBupXDwMf/Z/NNyfE1anHdBRkfA6Ih1W1/wtbeDOD e5zz6ARZw0CQy5NYZxhySMVlls/iJGzYAvleOzE9O5vJL7y4PZdqIo/jEUGYVgc2wE2V amWhJS8Vi3Lx6XgPlo6BZIFXRGy5vMeLPR8NIeQ4DJWc/y8ER2scEsakTLtm40i7P0Uu qlAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t25-20020a1709064f1900b00783d969f337si15672094eju.307.2022.10.21.02.56.51; Fri, 21 Oct 2022 02:57:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229823AbiJUJfP (ORCPT + 99 others); Fri, 21 Oct 2022 05:35:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbiJUJfN (ORCPT ); Fri, 21 Oct 2022 05:35:13 -0400 Received: from mx.socionext.com (mx.socionext.com [202.248.49.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E013913FDF8; Fri, 21 Oct 2022 02:35:09 -0700 (PDT) Received: from unknown (HELO iyokan2-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 21 Oct 2022 18:35:09 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by iyokan2-ex.css.socionext.com (Postfix) with ESMTP id 1B97620584CE; Fri, 21 Oct 2022 18:35:09 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Fri, 21 Oct 2022 18:35:09 +0900 Received: from [10.212.242.61] (unknown [10.212.242.61]) by kinkan2.css.socionext.com (Postfix) with ESMTP id 92D0DB62B3; Fri, 21 Oct 2022 18:35:08 +0900 (JST) Subject: Re: [PATCH net] net: phy: Avoid WARN_ON for PHY_NOLINK during resuming To: Heiner Kallweit , Andrew Lunn , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221021074154.25906-1-hayashi.kunihiko@socionext.com> <4d2d6349-6910-3e73-e6c5-db9041bcfdb8@gmail.com> From: Kunihiko Hayashi Message-ID: <86262217-a620-dc5b-cf5a-3a23ea869834@socionext.com> Date: Fri, 21 Oct 2022 18:35:09 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <4d2d6349-6910-3e73-e6c5-db9041bcfdb8@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Heiner, Thank you for your comment. On 2022/10/21 17:38, Heiner Kallweit wrote: > On 21.10.2022 09:41, Kunihiko Hayashi wrote: >> When resuming from sleep, if there is a time lag from link-down to link-up >> due to auto-negotiation, the phy status has been still PHY_NOLINK, so >> WARN_ON dump occurs in mdio_bus_phy_resume(). For example, UniPhier AVE >> ethernet takes about a few seconds to link up after resuming. >> > That autoneg takes some time is normal. If this would actually the root > cause then basically every driver should be affected. But it's not. Although the auto-neg should happen normally, I'm not sure about other platforms. >> To avoid this issue, should remove PHY_NOLINK the WARN_ON conditions. >> >> Signed-off-by: Kunihiko Hayashi >> --- >> drivers/net/phy/phy_device.c | 8 ++++---- >> 1 file changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c >> index 57849ac0384e..c647d027bb5d 100644 >> --- a/drivers/net/phy/phy_device.c >> +++ b/drivers/net/phy/phy_device.c >> @@ -318,12 +318,12 @@ static __maybe_unused int mdio_bus_phy_resume(struct >> device *dev) >> phydev->suspended_by_mdio_bus = 0; >> >> /* If we managed to get here with the PHY state machine in a state >> - * neither PHY_HALTED, PHY_READY nor PHY_UP, this is an indication >> - * that something went wrong and we should most likely be using >> - * MAC managed PM, but we are not. >> + * neither PHY_HALTED, PHY_READY, PHY_UP nor PHY_NOLINK, this is an >> + * indication that something went wrong and we should most likely >> + * be using MAC managed PM, but we are not. >> */ > > Did you read the comment you're changing? ave_resume() calls phy_resume(), > so you should follow the advice in the comment. I understand something is wrong with "PHY_NOLINK" here, and need to investigate the root cause of the phy state issue. Thank you, --- Best Regards Kunihiko Hayashi