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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 252FDC433FE for ; Mon, 8 Nov 2021 13:24:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1231A6120D for ; Mon, 8 Nov 2021 13:24:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239936AbhKHN1R (ORCPT ); Mon, 8 Nov 2021 08:27:17 -0500 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]:33350 "EHLO smtp-relay-internal-0.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239924AbhKHN1P (ORCPT ); Mon, 8 Nov 2021 08:27:15 -0500 Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id E63653F1AD for ; Mon, 8 Nov 2021 13:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1636377869; bh=/hm+frlIkfRbj18ggfJvfVA8HIIe4O3xDAkmIFBlwTA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hvj/p9QVRPgZgyraQkuJmkl3g81QfPNufnJx3+nZLSgxNCnagVrS9pk74wv9Ow7U3 Jm/DRwLsosyUIZtTyro6Pasm6uP0FAeRe8zFOHdd1NXyk/ntJyEK9aYwxIdStd8FT1 ZAPXZwuBJgDSBoqqdzVmUmGJbjLr9PzDy30Fl9bCgzYon8OpGoIa4JtvwpEP5mazi7 tDaYJMKo5CNk6lQ4j0D//jrtZR+TXuinsi+Vp1SxfZuSKsXZ0FAMZt3rVCfzbX926L +eHhLDD4FzB+88/b9JPk0ko4HD2hCKOYUJ+m7xOI0q3XEvPEnq119P9yihpZsU4cRx Y9zK7hNefPhhA== Received: by mail-lj1-f199.google.com with SMTP id w16-20020a05651c103000b00218c9d46faeso801890ljm.2 for ; Mon, 08 Nov 2021 05:24:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=/hm+frlIkfRbj18ggfJvfVA8HIIe4O3xDAkmIFBlwTA=; b=eGe3itj+0HdkCpe1Ak/nqjH0NMMwZUX91iktANC73n3IDph+EcXG0D0w32mmBqOLbb Tl7O2p0aEdN7+zkOfSIBcKDiPKI4Kz552uUV7Nmlw4vZKwtMdRvEEkPC2zviIMZ2IAQm 8r+IjEUktI4kVhZCHwXddJbUw9DnSBZN1bxbXpuhAwuZlc25B5FdF3i6dEgPA2w8h0eK gpOVou72Vp6IseQj5CqFydjmM19dv+sVyzgj1L+XT+B/MFjuy9JJlKO2VyB0ziPGcBG0 tA9+IK6pnSNySf+OIrBaQDvrOf+MPJw1QtAeSsK4gEgvufW/g7G01nYFwVaG5hmX5Gc0 mwZw== X-Gm-Message-State: AOAM533lulWtJtryMff4/H2HfTdvGH6RcmPO9Aom/HQzT0tZr0TZBhnD tjSTv+I85kT1cQhH8P6Bo7gsgGm064FmyWgz2L018/jU9JZNUD9NHUKuNMaTYuM//0d0x9A0/S3 oJDfeey6jds9Zl3MW1DM8LU+ehMkCR3hyOcmLvyLesw== X-Received: by 2002:a2e:3803:: with SMTP id f3mr10888425lja.460.1636377869441; Mon, 08 Nov 2021 05:24:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyjqrwH68UZei4PQ8gNRPh9hkUMStu/9MMdUsMdfRFhdPTou/EX5PUQAI5rB4VsmqAfR/889Q== X-Received: by 2002:a2e:3803:: with SMTP id f3mr10888395lja.460.1636377869193; Mon, 08 Nov 2021 05:24:29 -0800 (PST) Received: from [192.168.3.67] (89-77-68-124.dynamic.chello.pl. [89.77.68.124]) by smtp.gmail.com with ESMTPSA id l2sm1182683lfg.290.2021.11.08.05.24.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Nov 2021 05:24:28 -0800 (PST) Message-ID: Date: Mon, 8 Nov 2021 14:24:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH v3 10/12] watchdog: s3c2410: Support separate source clock Content-Language: en-US To: Sam Protsenko , Wim Van Sebroeck , Guenter Roeck , Rob Herring Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org References: <20211107202943.8859-1-semen.protsenko@linaro.org> <20211107202943.8859-11-semen.protsenko@linaro.org> From: Krzysztof Kozlowski In-Reply-To: <20211107202943.8859-11-semen.protsenko@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/11/2021 21:29, Sam Protsenko wrote: > Right now all devices supported in the driver have the single clock: it > acts simultaneously as a bus clock (providing register interface > clocking) and source clock (driving watchdog counter). Some newer Exynos > chips, like Exynos850, have two separate clocks for that. In that case > two clocks will be passed to the driver from the resource provider, e.g. > Device Tree. Provide necessary infrastructure to support that case: > - use source clock's rate for all timer related calculations > - use bus clock to gate/ungate the register interface > > All devices that use the single clock are kept intact: if only one clock > is passed from Device Tree, it will be used for both purposes as before. > > Signed-off-by: Sam Protsenko > --- > Changes in v3: > - Removed has_src_clk field: clk framework can handle NULL clk; added > s3c2410wdt_get_freq() function instead, to figure out which clock to > use for getting the rate > > Changes in v2: > - Reworded commit message to be more formal > - Used separate "has_src_clk" trait to tell if source clock is present > - Renamed clock variables to match their purpose > - Removed caching source clock rate, obtaining it in place each time > instead > - Renamed err labels for more consistency > > drivers/watchdog/s3c2410_wdt.c | 56 +++++++++++++++++++++++++--------- > 1 file changed, 41 insertions(+), 15 deletions(-) > Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58B22C433F5 for ; Mon, 8 Nov 2021 13:25:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2AC7D61361 for ; Mon, 8 Nov 2021 13:25:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2AC7D61361 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5WiXyv9aMOC55q+9Z/KoBMDAjoN9q2XwyxGbMfBL2+E=; b=luJjtdcnE4CAHC 58xdlXZlZVF3ozzDjvFrkZm+rnecSUsfPSsun1iLcLljqLBh4SLcFPYHdAphLBPdxrzSXQVBL5ATO zEdKAigU0TM2PCTRCbuh/dUjK6O36Bzuse9rnrLFPJO++iRTJXfDBua9H3QAEJJ4r5Hpsw31Go9yu vpI29o5yEHgg+Gz5Bf2A+rdy1wbQRw6nRPPQsDmYvWoP3ERWejUGGuQxOEnsqc3rXdBsXPzSCMlRK pY/+gfx1c9lhK3zSYg/U5mDa63Q8BX90Vjn1/Cc4DnIztEqI4GXtwgf7yMBzY0pXeWTPCAxPvhhR3 7XYZW2Oc0lipCoomemnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mk4dY-00GUZ9-Ta; Mon, 08 Nov 2021 13:24:37 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mk4dU-00GUXy-Qg for linux-arm-kernel@lists.infradead.org; Mon, 08 Nov 2021 13:24:34 +0000 Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 580C53F1BD for ; Mon, 8 Nov 2021 13:24:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1636377870; bh=/hm+frlIkfRbj18ggfJvfVA8HIIe4O3xDAkmIFBlwTA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=U0P2r5mfZ6HlnC0ACTxvRwEzeqPpvugDCLnTqns0Q3oRmZWRGGA1W6K1lGOJ8oIFN UctLLqdihJopNNFQbgsYKqFX09sk+uDrtrlV0C3bDEEmlW81LkLkdq4rXF9qbnDA2Q Xa8GhCq9w7XxOJc0AwfzEtR72ZenUzQz5zM66je1yq8j9ijLuX6peolOHm1Xye20fL kZXoue/SU73pARL68otws4u/F7ziIhQ3xvRo5xow9ooIq1+8K1xyS4Q5mQt679CTwS k+KNSEohv5sInbIxk0wOH05rPBPdVLRFwAqKfwty/Exsk07SCOxndnNolN0Y32/pbK gzqiJ6806k2Jg== Received: by mail-lf1-f70.google.com with SMTP id u20-20020a056512129400b0040373ffc60bso1145589lfs.15 for ; Mon, 08 Nov 2021 05:24:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=/hm+frlIkfRbj18ggfJvfVA8HIIe4O3xDAkmIFBlwTA=; b=sv4ZcSYXtK/omUU6DfImkN+B6U4uAtJJREQAH+hxCr/jd6T7qnXe9kSDvNgCRByzKx uqmREgKvgKp0MTywvOhWcVnitvZKoqn8/9+j633FFxaX+lZoWt0CnOouHJqzzkIH/0/g 6gE55AJS1dfRvLuLsc+Txue8F6qydKGaOvYV1eZd15Pp2tMBO7C06MZNnaLfLQhgNfOI YI49o2fdR0eTLyzgaBcEK023Nt2yj/qS5QvLPORkcpek+GC+E4R/G0GOuEzrY4LsgE2Y C5jSyoK3HWBnw4AUL830Ybz+TmFfL93XGGxjisZDe7idQPasjmnGSma8CsyY0f+Tx49j YoKQ== X-Gm-Message-State: AOAM5301srql3RYzZCTJcTyJrsendm51H6kLV5cu8T5Lohadu50OsRqf 2+u/HvZgFeIqv+tRuc7xU3z2ddKAcjN8IUp7OBnB1QcT4tfp63d09yaqqm7V1kU9n0P8rLGJJgG /fpgud2+fyWtgkS0QMSFwUMihQYSvSknINbqEsWBc48j28vhsdw0x X-Received: by 2002:a2e:3803:: with SMTP id f3mr10888411lja.460.1636377869358; Mon, 08 Nov 2021 05:24:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyjqrwH68UZei4PQ8gNRPh9hkUMStu/9MMdUsMdfRFhdPTou/EX5PUQAI5rB4VsmqAfR/889Q== X-Received: by 2002:a2e:3803:: with SMTP id f3mr10888395lja.460.1636377869193; Mon, 08 Nov 2021 05:24:29 -0800 (PST) Received: from [192.168.3.67] (89-77-68-124.dynamic.chello.pl. [89.77.68.124]) by smtp.gmail.com with ESMTPSA id l2sm1182683lfg.290.2021.11.08.05.24.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Nov 2021 05:24:28 -0800 (PST) Message-ID: Date: Mon, 8 Nov 2021 14:24:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH v3 10/12] watchdog: s3c2410: Support separate source clock Content-Language: en-US To: Sam Protsenko , Wim Van Sebroeck , Guenter Roeck , Rob Herring Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org References: <20211107202943.8859-1-semen.protsenko@linaro.org> <20211107202943.8859-11-semen.protsenko@linaro.org> From: Krzysztof Kozlowski In-Reply-To: <20211107202943.8859-11-semen.protsenko@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211108_052433_107690_8AB14BE2 X-CRM114-Status: GOOD ( 22.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 07/11/2021 21:29, Sam Protsenko wrote: > Right now all devices supported in the driver have the single clock: it > acts simultaneously as a bus clock (providing register interface > clocking) and source clock (driving watchdog counter). Some newer Exynos > chips, like Exynos850, have two separate clocks for that. In that case > two clocks will be passed to the driver from the resource provider, e.g. > Device Tree. Provide necessary infrastructure to support that case: > - use source clock's rate for all timer related calculations > - use bus clock to gate/ungate the register interface > > All devices that use the single clock are kept intact: if only one clock > is passed from Device Tree, it will be used for both purposes as before. > > Signed-off-by: Sam Protsenko > --- > Changes in v3: > - Removed has_src_clk field: clk framework can handle NULL clk; added > s3c2410wdt_get_freq() function instead, to figure out which clock to > use for getting the rate > > Changes in v2: > - Reworded commit message to be more formal > - Used separate "has_src_clk" trait to tell if source clock is present > - Renamed clock variables to match their purpose > - Removed caching source clock rate, obtaining it in place each time > instead > - Renamed err labels for more consistency > > drivers/watchdog/s3c2410_wdt.c | 56 +++++++++++++++++++++++++--------- > 1 file changed, 41 insertions(+), 15 deletions(-) > Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel