Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1292516rwd; Thu, 1 Jun 2023 13:19:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4BrN4ChGsVJ6pwjIgEa793HsFr3NzYNuhufPEqsxLzM4U9buhE5HO8OumuFdwDLJbYbQDI X-Received: by 2002:a05:6a20:728d:b0:10f:be0:4dce with SMTP id o13-20020a056a20728d00b0010f0be04dcemr12534111pzk.8.1685650769842; Thu, 01 Jun 2023 13:19:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685650769; cv=none; d=google.com; s=arc-20160816; b=T5xTtd9ROKklJNZlldry2CrOMnR3+soQiMvSJ9ssqnUPTNZZnST+6dotjTns5Y9NTq flk9yQQLJy7aLvD6hs95RlKq05As/VxeyxPsnwulzYvV3OccgxpoRT4zPiF8b7s6NDof IvgTubTdHc3Fwl9wEHk/06sWEvHKYPspfbQrNDjLSK8obVyPQ6TPdPQ7GVKB+efUJgdy WCI59L5+VcC86x6YvWRIMlgWFbY+oRht3VtO6nM+rk5ipO8xa3W2mQsags5NKidzQr98 2v+uGMLR5y9hznwyPamaUn9B/01Y4OPWAGK3oKeTR0KZMZ+/E/go/iUjqF/O8HqPVFtn lWMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=OG/rCN+OmsjvZqSpHKkTEhSoHCNMP8tcTTpNoQzhqWw=; b=dBMNRZAZkZ7L5WmluH4+OfdoEBuvIVFpjCdjRexpR3sE5kTMXAO5oQ13HtOSh1wHIi YJ1qElFy4y9WEOP9/vqEKU0TQjgNDevl2rJ/CBKVfvk1PUV97SyEOHCdvQ31yhJ9O1N6 IpI5qYJ2Wq05MHU7Z3Z1I1MBwV9pgxQF6+aRtTbZlM8U786A21+/pg72P9SiJwrWza+a wOSMs4Zy3BTQ1Sb5Of6sg3F8UzlDhys9nND3qSh3J1E8Cwn5CBCoEPkgRGKu2pshxEm8 H+YMsFiRdOwd/b+1XaAVeNzhaVpLqC9noDUuhzBSyH9sv23IHN0shcFNoa91UyOHHk1c qDXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=kq2eymw2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv187-20020a632ec4000000b00534913a5303si3317072pgb.540.2023.06.01.13.19.16; Thu, 01 Jun 2023 13:19:29 -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; dkim=pass header.i=@gmail.com header.s=20221208 header.b=kq2eymw2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230151AbjFAUOy (ORCPT + 99 others); Thu, 1 Jun 2023 16:14:54 -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-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 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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