Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4476111pxb; Tue, 2 Mar 2021 16:56:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJye+gcK8Jte7JaoZ14Yx+JHIGbAs7llfwjOjXQPcXzkQqfutzBzY3oOpy1c1h+Aga3FX2CO X-Received: by 2002:a17:906:1956:: with SMTP id b22mr24091280eje.114.1614732981732; Tue, 02 Mar 2021 16:56:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614732981; cv=none; d=google.com; s=arc-20160816; b=Giz/AINybQq0zr3HIQ1JiLoUJ/rbcjBCBVtL9nhVOs9p+v4MGYKRtYmHlLFiv4eVrR IkYTvIlGiVckX6wmYCd19sEmymqBGb70wAzcVry3gJaUk1E0pbsMfhFp4ApXIabthp3p cZtNAkKUAdSq5FMon9Gd5ecJDqfoAolc9+iUKb2u4fPb580bHOIV1WP+5BMCvopH84dF 5uDKjH6aOmWttQkWUCusfTXN5XM98DDpEuE/eowLbtXnmDqrS/iDs18iEGNJL8zzdgdO O28sDbwSYVXHD7VBzDRkzcYsACO7Wg3/NUndEumUKTPmd1NIX2QOZFDPxCbZUT4d0m96 9jAg== 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=lDAufuhpzrV03TMTLpI4rsJPdAs1FZA19H3Gjjzj/H8=; b=jW68laQ3z2X/1aiUr19AEKgVLjLv1tqZxrCN+TM8wkcMPUzM5jy0NPdOi93juNxWy+ nw4/SCFYOry02pIyGmW15EY79M8kWdA8pJiFbVZ+Nd06NYH4dnO1Sx8Xg82xNb3ycnLe I/jVa0KkfSVHdWrF7uItvonWlCgrg0BELd04Zg6NNmWOsjcJFZGdoMCMPhrn2RzGBNGj KlAeiQqxnnQSz4w+EYl8qK0Bb2wDzwLIM9hM2B4rVYl9226h8E46Khw3svWmHqLGgjrj sfLqTHBNkM7jGQJ3Ikgu7BLA19+d8plzi4fNJSmE2rDo9eSboS+FiADnT1GiOFsOmM4o mpyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=hYd7SO61; 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 j22si14547494eds.434.2021.03.02.16.55.58; Tue, 02 Mar 2021 16:56:21 -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=hYd7SO61; 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 S233234AbhCAIgw (ORCPT + 99 others); Mon, 1 Mar 2021 03:36:52 -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-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