Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3078644pxb; Mon, 1 Mar 2021 00:33:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwkrq+7NHkc4NXHwTS6wY9sC6YkvHAk20Qxbbw5bcML6EDHcA5NFMGZDOcLf6QGEcGbz3Xr X-Received: by 2002:a17:906:a896:: with SMTP id ha22mr14907429ejb.503.1614587614059; Mon, 01 Mar 2021 00:33:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614587614; cv=none; d=google.com; s=arc-20160816; b=PX7pCzDy6nbV38PA8dlNzfRBiuX2ecyMACP0fFRDofB89v7v5HkihtROjSotA0heLi 3XLmR/4nEa0MtVflIIuxeyV9qp1dQ63GSGYvmTBM0oTU9F5m0+UVvoQ99GxGj7QvD1rZ ps9Rv06eCtbDvd1DsVM4xIT8vqffY8NEL6e3Jc13PsJi/wUopD6IwY790R1ER6JlRjDN 4VPJLFE8MGvEd4YikEKgiyI66xBLQF5Jr/Wf80skCcWcAPyG5++FwOugkZBCW6BX5rve kmuAigz/BRlCNmeTbk5qxIwamGzFMxpFceo+4u5jdg1+6P/40+TsYRniaQ7ldn6hWwGu kwEg== 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:dkim-signature; bh=1OJW58i2V+qbpcJlxYwrqsB9da04RyZ9nHYnyVmXEZ4=; b=x9TCv0cn29SirT4KbsZTXlan4xanhxNumIXFoKNVtc8kryvGJFBtoE7GIVv2gSnTvq Mv7xLHJ187YBwg5Fx73TSrflhE8NrafPOjL05BkTXs1R58h0NFvEmExUz1v6hCiBeVMH u3VP1rhIfYFmumu1Qxojjo3oTRHsrCQREne7CnaYwn7lnG6RCF/wni8xjOSJpQbTFj7l k88kxEylWFqnGvp7yRBG60pGKvp+uBlEd6pIPmeUhKCrp+oeFgCC1Kx8A2fZr2gM5a/V sEg1f1ZTjwCVIe/FkN4mrUs2LdC3/qw/9K6lNGmpBIYhlP2Vx0XbfRL1rU49TTmD+7lV g4MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=IN2IxXXj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u25si1410671edo.148.2021.03.01.00.33.10; Mon, 01 Mar 2021 00:33:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=IN2IxXXj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233035AbhCAIa0 (ORCPT + 99 others); Mon, 1 Mar 2021 03:30:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233048AbhCAIaQ (ORCPT ); Mon, 1 Mar 2021 03:30:16 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94030C061756 for ; Mon, 1 Mar 2021 00:29:35 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id bm21so7759658ejb.4 for ; Mon, 01 Mar 2021 00:29:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1OJW58i2V+qbpcJlxYwrqsB9da04RyZ9nHYnyVmXEZ4=; b=IN2IxXXj3mi4wuOvmblnpYyJ8Sy6okMxYKI1FA3s0tFAVj8KMoiZufyIaLaApt4mTo 1zMF6+i12g717Lj1ofu1cdrxjzCX4cbatK1VpFWkayFwKwARz6GV49achfJSZ0SaoLu0 NWHiovKn+NgChneGJ3TxowVeCsUQb7O8/wHVc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1OJW58i2V+qbpcJlxYwrqsB9da04RyZ9nHYnyVmXEZ4=; b=qEELU18hnyB3rsFjWp6yd9AVrgN5TfDmcTyh6dPws7QHEYRmGSrAmN8muMsoWm3+T3 JsYSAT/PHKqJ3jjcQndovrGUYGm6itORAGcfLqUwUzRKhvGeMdtXyizEJH1sfcZYgjHm Q3VHrGMz4esMnL/A5HwiSRharJu1n2NnNrPzszEoxmHekS4gLVBdCDisz7+YaDoc/FC1 q0F1e6FCxvehrbhs2JBUIQybPH6FUfdCBEkqnVgHpooV0Bhh7A1K7rAheArMIUJ0VxR7 iHAiYx30P2kEQ13fqtRZjU5eiYieGBguba8Iee6+zVU4UlWemoa0ts5mUkQGv72+oAZF yP5A== X-Gm-Message-State: AOAM533MwMxPczQstFtJH5UnUuznZztk23Ul5DsF6LkM91+qYkVwZlVF R5SxKKWqNwZDwvwX2owChmx4Yg== X-Received: by 2002:a17:906:acb:: with SMTP id z11mr6463031ejf.193.1614587374363; Mon, 01 Mar 2021 00:29:34 -0800 (PST) Received: from [192.168.1.149] ([80.208.71.141]) by smtp.gmail.com with ESMTPSA id y24sm12030495eds.23.2021.03.01.00.29.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Mar 2021 00:29:33 -0800 (PST) Subject: Re: [PATCH 2/2] drivers: misc: add ripple counter driver To: Andy Shevchenko Cc: Greg Kroah-Hartman , Rob Herring , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Arnd Bergmann , "linux-clk@vger.kernel.org" References: <20210226141411.2517368-1-linux@rasmusvillemoes.dk> <20210226141411.2517368-3-linux@rasmusvillemoes.dk> From: Rasmus Villemoes Message-ID: <2bdc6d5d-3739-1fd7-5864-b52cc3d90355@rasmusvillemoes.dk> Date: Mon, 1 Mar 2021 09:29:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/02/2021 10.33, Andy Shevchenko wrote: > On Sun, Feb 28, 2021 at 11:29 AM Andy Shevchenko > wrote: >> >> On Sun, Feb 28, 2021 at 11:07 AM Andy Shevchenko >> wrote: >>> On Friday, February 26, 2021, Rasmus Villemoes wrote: >>>> >>>> The only purpose of this driver is to serve as a consumer of the input >>>> clock, to prevent it from being disabled by clk_disable_unused(). >>> >>> We have a clock API to do the same (something like marking it used or so) why do you need a driver? >> >> Example: >> https://elixir.bootlin.com/linux/latest/source/drivers/platform/x86/pmc_atom.c#L365 >> >> If it's a DT based platform I think you can make it somehow work thru DT. > > Okay, briefly looking at the state of affairs [1] seems like you need > to hack it into clock provider. > > [1]: https://elixir.bootlin.com/linux/latest/C/ident/CLK_IS_CRITICAL > I did find CLK_IS_CRITICAL and CLK_IGNORE_UNUSED while trying to figure out how to handle this. However, while CLK_IS_CRITICAL is in principle settable via DT, the comment above of_clk_detect_critical() seems to make it clear that adding a call of that from the RTC driver is a total no-no. CLK_IGNORE_UNUSED can't be set at all from DT, and wouldn't solve the problem fully - while we can and do make sure the bootloader sets the appropriate bit in the RTCs registers, it's more robust if we also ensure the kernel explicitly enables the clock. But if there is some way to do this within the clk framework/existing bindings, I'm all ears - that's the reason I cc'ed the clk list. Rasmus