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 X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 301A9C433DB for ; Mon, 1 Mar 2021 08:37:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E8B5164DEF for ; Mon, 1 Mar 2021 08:37:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233235AbhCAIhF (ORCPT ); Mon, 1 Mar 2021 03:37:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233065AbhCAIfV (ORCPT ); Mon, 1 Mar 2021 03:35:21 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E64EBC061756 for ; Mon, 1 Mar 2021 00:34:40 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id hs11so26644560ejc.1 for ; Mon, 01 Mar 2021 00:34:40 -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=lDAufuhpzrV03TMTLpI4rsJPdAs1FZA19H3Gjjzj/H8=; b=hYd7SO61L3RSn8PhZEs9fr4+k0HyH5eQIyPA4fNHipymNkx7Cbq9/DYvGJwNXMhgCS EzwIwbAP1UdNG5AzP5UvleA3yOTwvEwiOUEHiXPRfX7oYM7l7dqQ6CmPzqkceHbNO9uc oAaKm3WYacHhtJpVMHvF2FVysEwB/nmVqdLPY= 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=lDAufuhpzrV03TMTLpI4rsJPdAs1FZA19H3Gjjzj/H8=; b=WAA5OyO4YAbSQVSK6npavIxr132ROwlD8jqnhEhnh096F2PfEwZqXZLarKass97DTj svQaORUtxgId8SIIryqMrb4bjyP1tkfTa9r7sPfPkfqHPC6LR5fCgbhgg1AbGU652K8E tu5lqzPQo3HMzOYxUC16SL+7X4F1QiXj+c8/mvosNx+CkmreT/fqy8xzgzVYLjTWMOqT 6wLyTqPngWyj/AEwMVbgxH/mJLZZrbkYr4MXuRFYYecqVevK8KsrsMPb6wg3jJifQ0qr UAVNjSB+DDwSeM7WV6R9uY57yCzrmAnxYQiEHjFTVhE+DbpweaWlNFGqH4wu9AgCjx8x geHw== X-Gm-Message-State: AOAM532qgSneioRqlyTPum0Zrut+RqsaKwAlJzZ8yU49kHi6dTcM6Afm xiMxInemJGjIObq15qAzsFbEFA== X-Google-Smtp-Source: ABdhPJzyoWxnbcRLJyYqJf+BkrEk3Qke/unRo+Xvj2PJgrlnj5tnNDmHWXtHesVzhkIklMC0YVQ5+g== X-Received: by 2002:a17:906:35cf:: with SMTP id p15mr5227601ejb.379.1614587679738; Mon, 01 Mar 2021 00:34:39 -0800 (PST) Received: from [192.168.1.149] ([80.208.71.141]) by smtp.gmail.com with ESMTPSA id p25sm13926890eds.55.2021.03.01.00.34.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Mar 2021 00:34:39 -0800 (PST) Subject: Re: [PATCH 0/2] add ripple counter dt binding and driver To: Guenter Roeck , Arnd Bergmann Cc: Greg Kroah-Hartman , Rob Herring , DTML , "linux-kernel@vger.kernel.org" , Arnd Bergmann , linux-clk , Wim Van Sebroeck , "linux-watchdog@vger.kernel.org" References: <20210226141411.2517368-1-linux@rasmusvillemoes.dk> <2208f466-e509-6bbe-0358-34effb965610@roeck-us.net> From: Rasmus Villemoes Message-ID: <285d739a-b343-c411-5461-0fe1f44177a5@rasmusvillemoes.dk> Date: Mon, 1 Mar 2021 09:34:38 +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: <2208f466-e509-6bbe-0358-34effb965610@roeck-us.net> 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 26/02/2021 20.53, Guenter Roeck wrote: > On 2/26/21 8:35 AM, Rasmus Villemoes wrote: >> On 26/02/2021 15.35, Arnd Bergmann wrote: >>> On Fri, Feb 26, 2021 at 3:14 PM Rasmus Villemoes >>> wrote: >>> >>>> >>>> So I'm thinking that the proper way to handle this is to be able to >>>> represent that ripple counter as a clock consumer in DT and have a >>>> driver do the clk_prepare_enable(), even if that driver doesn't and >>>> can't do anything else. But I'm certainly open to other suggestions. >>> >>> How about adding support for the optional clock to the gpio_wdt driver, >>> would that work? >> >> I think it would _work_ (all I need is some piece of code doing the >> clock_prepare_enable(), and until now we've just stashed that in some >> otherwise unrelated out-of-tree driver, but we're trying to get rid of >> that one), but the watchdog chip isn't really the consumer of the clock >> signal, so in-so-far as DT is supposed to describe the hardware, I don't >> think it's appropriate. >> >> OTOH, one could argue that the watchdog chip and the ripple counter >> together constitute the watchdog circuit. >> >> Cc += watchdog maintainers. Context: I have a gpio-wdt which can >> unfortunately effectively be disabled by disabling a clock output, and >> that happens automatically unless the clock has a consumer in DT. But >> the actual consumer is not the gpio-wdt. >> Please see >> https://lore.kernel.org/lkml/20210226141411.2517368-1-linux@rasmusvillemoes.dk/ >> for the original thread. >> > > Sorry, I am missing something. If the watchdog is controlled by the clock, > it is a consumer of that clock. But that's just it, the watchdog chip is _not_ a consumer of the clock - I don't think I've ever seen a gpio_wdt that is not internally clocked, but even if they exist, that's not the case for this board. What else does "consumer" mean ? And why > not just add optional clock support to the gpio_wdt driver ? Because, the consumer is a piece of electronics sitting _between_ the watchdog chip's reset output and the SOCs reset pin, namely the ripple counter that implements a 64 ms delay from the watchdog fires till the actual reset. (The watchdog's reset is also routed directly to an interrupt; so software gets a 64 ms warning that a hard reset is imminent). Rasmus