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 1A976C7EE23 for ; Thu, 1 Jun 2023 20:14:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229648AbjFAUOx (ORCPT ); Thu, 1 Jun 2023 16:14:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231419AbjFAUOs (ORCPT ); Thu, 1 Jun 2023 16:14:48 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69A09D1; Thu, 1 Jun 2023 13:14:43 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-75d13719304so107828485a.3; Thu, 01 Jun 2023 13:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685650482; x=1688242482; 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=OG/rCN+OmsjvZqSpHKkTEhSoHCNMP8tcTTpNoQzhqWw=; b=kq2eymw2VSjHxgZ8bD2qhvvonK2PEHdjli0KOfLUxmQ/reYbP3lOLdnC+/bDkkptnS WXO8dmaxEX/I0+uFe3e1gs3BkwGdOBXbA8WYwfY2lcHy4HNTjFyDG4XEyZSH7PmT0UWP nc112NetAYEetGwtatwT3IceRMroEras5Fn+drBKH1g6lhs6yHflY9u5HM10uZ17dKHt dVLAVvuFIrnzfyqXc+5pTg0FFhnaKVAhYcCPhd7IR30XOKIwk4aNJl8iuLLNDstqYR31 H+Mow4/CJyqAJ5g1l3Gn+IyMEmth8sXZiwh9aMNNeO4PKg6gkiVXH3EX0NEEAGNt+uAc nw1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685650482; x=1688242482; 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=OG/rCN+OmsjvZqSpHKkTEhSoHCNMP8tcTTpNoQzhqWw=; b=JwGaVM5kiHCKcgdFL0578I/opskKuvSAgsc6aJmsDW13wMfLukBCrriRqg4d0bY0VY BHC09zbBWCA1CaKQWUKKkOv9hRxHzG7LCKQeAmgj2PqrP94shSElGfEe0uwJf3s9WPi6 vO22TzQs8TLjEYgu2sds//vutDtGkmhQeqrhjvIekbZVda8G6+paiJdH59L+U9zlnL2S 5hFrSBW5EgqiZ1tjVWjCgywpecdCAjq/kypjQZBlaqNv9aJGxdnRNk3QFmoPy62PFwm2 sSzK9InbYYet533rnbQE5Jk2fkjrs0cMx9HNGucmSUF71kDSp/IVoL6nep02JRefgicH QsZg== X-Gm-Message-State: AC+VfDyiBDuI2eA0JB0gXP5UOQeR4ok3c5xY0/NDy1sR9+qEz3nRXzRp X/2DAcvyGj9NWADcEXkT36M= X-Google-Smtp-Source: ACHHUZ4AV6WD1JfrulwBn2M+UAuEznKd8O2ihs18fRBEsZf19tJuZpS3f6qRw6lQmik/Y6HYPT3UvA== X-Received: by 2002:a05:620a:2e1:b0:75b:23a1:3ec with SMTP id a1-20020a05620a02e100b0075b23a103ecmr9220461qko.2.1685650482328; Thu, 01 Jun 2023 13:14:42 -0700 (PDT) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id c11-20020a05620a134b00b0074e0abe59a0sm7035104qkl.78.2023.06.01.13.14.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Jun 2023 13:14:41 -0700 (PDT) Message-ID: <94d74b65-55ad-d070-2590-d21b79ff5abb@gmail.com> Date: Thu, 1 Jun 2023 13:14:27 -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 2/2] net: phy: realtek: Add optional external PHY clock Content-Language: en-US To: Andrew Lunn , Detlev Casanova Cc: linux-kernel@vger.kernel.org, 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 References: <20230531150340.522994-1-detlev.casanova@collabora.com> <20230531150340.522994-2-detlev.casanova@collabora.com> <4a6c413c-8791-fd00-a73e-7a12413693e3@gmail.com> <5682492.DvuYhMxLoT@arisu> <7bde15a1-08fe-4036-9256-b13280340b6b@lunn.ch> From: Florian Fainelli In-Reply-To: <7bde15a1-08fe-4036-9256-b13280340b6b@lunn.ch> 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/1/23 12:37, Andrew Lunn wrote: >> I'm not sure about this. Isn't the clock still necessary when suspended for >> things like wake on lan ? > > Yes, but the PHY should know if its a WoL source, and not disable its > own clock. There is some support for this in phylib, and Florian has > also reworked it recently for Broadcom PHYs. If you want to have the PHY driver have a chance to disable the clock if Wake-on-LAN is disabled and therefore conserve power, you should set PHY_ALWAYS_CALL_SUSPEND in the phy_driver::flags and in the suspend/resume functions do something like: suspend: /* last step after all registers are accessed */ if (!phydev->wol_enabled) clk_disable_unprepare() resume: /* first step before registers are accessed */ if (!phydev->wol_enabled) clk_prepare_enable() The flag is necessary to ensure that the PHY driver's suspend function will be called. The resume will be called regardless of Wake-on-LAN being enabled or not. -- Florian