From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27C97C7EE24 for ; Mon, 5 Jun 2023 15:27:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233691AbjFEP1W (ORCPT ); Mon, 5 Jun 2023 11:27:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232819AbjFEP1V (ORCPT ); Mon, 5 Jun 2023 11:27:21 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 495E4AD; Mon, 5 Jun 2023 08:27:20 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-5289ce6be53so4324104a12.0; Mon, 05 Jun 2023 08:27:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685978840; x=1688570840; 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=Ieu/xxysVKbGsHF+00dw71+S3ejA2tEitu5T3zoXPB0=; b=A5scA0dd0wm3VKZ3PTP3Gd9o+B39YstHpIKJ+NE1iRokmyg4qeXr29sJ5o/2cwBLMb ObmUbtXeaDT/ZyO7OnC5ovBw6zM/Oh+trg0B9DKbubkHslv4+pT/msS11OzUtLMA4+yz wgGtgFuTrR4TrBFcAcuHgmASBQxOkKOOOJPiVle70qpOMXaLAOPq5q6fxRug1XMNy2dI X9Iww7P6X+zJVPYAYx3OOOFDm/JORWr88pZFysCQ319fXjxgnx73CRKt5TECYDlDumxI vFOSaNjfYs95m8AjR+Buc254DvIEhRWuvu60eHPwBTiOybAJvciui/x0ialbIGF95rUZ Bgwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685978840; x=1688570840; 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=Ieu/xxysVKbGsHF+00dw71+S3ejA2tEitu5T3zoXPB0=; b=Q7pmvi11y7596vw7BrI0qcSqtLAby7TTUkbN6dBvhyr6WEbfpwp+Hf2YN9rcqD60B5 0lp7dru391bMJAAFiHSHsRgFJT8csCuaZMxHbwLs7+apVuRSi+NuEpiWUF+yEWK/Q11t vkqqqPT7RyPyHrI/dmaOfQL8XGf5YZjDwNjc2UDI1o5EZp8QCGVGnsTA99IoVWr742Z7 zd27LP0ieoTpswfcJxyADV3xK/SsJZILaDvlZKlFLOatvWRq6Ys55eKHyy+f6DSi92Wr VElzmIybGLh2iSk3eYD14f23iGcRDezJfvmZDQHwL0ajWBogbT/Kmee9D1XYo61fXNaF DKQA== X-Gm-Message-State: AC+VfDzN/3LHFD3biqXniozF7Au6XpVSQH0QHF1GQtScoaeDpqk0HzL0 YthdOES5iTjHc+upPHCrVOs= X-Google-Smtp-Source: ACHHUZ6/on28cGqEUtuLH1gzTbjbi0i7Uc578RrsqZpQ1uDxG2t+ExFz+BzyyUDIoebj6ATgtJ//+Q== X-Received: by 2002:a17:90a:6b4e:b0:244:d441:8f68 with SMTP id x14-20020a17090a6b4e00b00244d4418f68mr9271108pjl.16.1685978839644; Mon, 05 Jun 2023 08:27:19 -0700 (PDT) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id f19-20020a17090ace1300b002502161b063sm7886395pju.54.2023.06.05.08.27.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Jun 2023 08:27:18 -0700 (PDT) Message-ID: <086b52d5-4159-ffaf-8bcd-30ac24c25017@gmail.com> Date: Mon, 5 Jun 2023 08:27:07 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v3 3/3] net: phy: realtek: Disable clock on suspend Content-Language: en-US To: Detlev Casanova , linux-kernel@vger.kernel.org Cc: Andrew Lunn , Heiner Kallweit , Russell King , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , netdev@vger.kernel.org, devicetree@vger.kernel.org, Florian Fainelli References: <20230605151953.48539-1-detlev.casanova@collabora.com> <20230605151953.48539-4-detlev.casanova@collabora.com> From: Florian Fainelli In-Reply-To: <20230605151953.48539-4-detlev.casanova@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 6/5/23 08:19, Detlev Casanova wrote: > For PHYs that call rtl821x_probe() where an external clock can be > configured, make sure that the clock is disabled > when ->suspend() is called and enabled on resume. > > The PHY_ALWAYS_CALL_SUSPEND is added to ensure that the suspend function > is actually always called. > > Reviewed-by: Florian Fainelli > Signed-off-by: Detlev Casanova > --- > drivers/net/phy/realtek.c | 24 ++++++++++++++++++++++-- > 1 file changed, 22 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c > index b13dd0b3c99e..62eac4835def 100644 > --- a/drivers/net/phy/realtek.c > +++ b/drivers/net/phy/realtek.c > @@ -426,10 +426,28 @@ static int rtl8211f_config_init(struct phy_device *phydev) > return genphy_soft_reset(phydev); > } > > +static int rtl821x_suspend(struct phy_device *phydev) > +{ > + struct rtl821x_priv *priv = phydev->priv; > + int ret = genphy_suspend(phydev); Sorry I missed that part, if Wake-on-LAN is enabled you cannot suspend the PHY as this will typically prevent it from passing received frames up the MAC where Wake-on-LAN can be done. You need to move genphy_suspend() into the !phydev->wol_enabled clause. -- Florian