Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5200517rwb; Sun, 4 Dec 2022 16:36:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf65BWmCygZOWh7a/5ADatuKBuI2lEmqACGoC8r2AatAdwLIr56CURA4ZOKsQE6kA8vq+X1q X-Received: by 2002:a62:be16:0:b0:56b:676e:1815 with SMTP id l22-20020a62be16000000b0056b676e1815mr63386019pff.66.1670200590776; Sun, 04 Dec 2022 16:36:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670200590; cv=none; d=google.com; s=arc-20160816; b=WeznHW3oKsK3dSMsKYis32VODLIQFbnCYBh5Sza9PNUpl6aRRFF05qg9oBxrxjQMob jQmWoxPv5qUfrurPQXYnsuKGoOwvPIbKTy19nJZELpAyW27OBqHUDNa53nOoyOz9mrfV swVO3HHF7eVk0cRQutUymJeOBMk6NigyduTRiDLns3TtSkx56Sn85vNIqEeKzSn8OrTz uMDiwzb05pydb8V+RiYZoIKD1VC9OP5JxuaUp0n5fYMd+AhvXBIDOf/PawlVVR99Jhj0 C5jhYKAVI8MOkA9Mw1HZGwyC79nCGOqexzEsxPyN7EdaLpVfzydpKSsnHNHaE+DEp6Bi G/NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:references:in-reply-to:user-agent:subject:cc:to:from :date:dkim-signature; bh=s8t3LfGlLoxQeHgNzsNXK+eFs0YltzDagQOGK+5fCz4=; b=V/Hm4snz9oJUvFA2vtpSduFqny0WIDW6fQQsPsbWJtXpoLSXIMRZttMbQX42EgKOUE MHImtLnUJuPN8UN5f6thK0BoMjtZ0sqLM7ZquSX9OikwNHDtdBW7mIoPIAb3J7n5Y18q oR/LmwiBYOUSX4lOvZbJ02qSd/DjJExidL2yrCwtoWXsYLspxhFOjpLIyVPXym6fJsW2 4HOFqT3Ddbq1tC9IaYwdZMKdJPE+X6qHFDVdZBy/zsLuS6iAn0lE7KTDkOV8HbcQsWW8 Z5m5HTVldcQ/wAytHtPVEjdjX+0VHnHdVnJRG8VZOUkdSXhVE13FuOzJSp8rUMai7k5j VnMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LYVLlfwQ; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020a63be06000000b00460f2778437si13382544pgf.366.2022.12.04.16.36.20; Sun, 04 Dec 2022 16:36:30 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=LYVLlfwQ; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230508AbiLEAKo (ORCPT + 84 others); Sun, 4 Dec 2022 19:10:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230254AbiLEAKm (ORCPT ); Sun, 4 Dec 2022 19:10:42 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71964EE07; Sun, 4 Dec 2022 16:10:41 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 26C01B807E5; Mon, 5 Dec 2022 00:10:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26D05C433D7; Mon, 5 Dec 2022 00:10:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670199038; bh=wHwBkSo7+9OsXeSnyzm3ampLGK0mAtM78dM7PJjSBzA=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=LYVLlfwQlNqL4IrP/fLTZ3aY/WveKlAsLqqhxuFI9pBkv+61ywlfdBNMfEMI9et2f thECXDLwAUFxfeeVM8QUEWgp7TBGxEtSu5VlmPcK+J60pVhutgNhTlH7p8UBnE9jL0 8X/2rQRT2w9Zvb+FeyUc2vBdRx4qP182YKwbzfhWLUI37EPceVJP8CYXp5PSZ/S6Ot ZrVHhapPO83mb1NbCEtQgjoKxhc3/EF4Xo1vmN6QZXLu+zdKgWFWxFMQw+DBlVk4Gc FF/sP7sHmrgqSCOEICFxjr6Nkk+MmIRkCoVRyhcUR9/XALh3NdyB+FgAouCnRPCGH6 dF0ChJteyChfw== Date: Mon, 05 Dec 2022 00:10:34 +0000 From: Conor Dooley To: Anup Patel , Rob Herring , Krzysztof Kozlowski , Palmer Dabbelt , Paul Walmsley , Daniel Lezcano , Thomas Gleixner CC: Andrew Jones , Atish Patra , Samuel Holland , Conor Dooley , Anup Patel , devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Palmer Dabbelt Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_v5_1/3=5D_RISC-V=3A_time=3A_initialize?= =?US-ASCII?Q?_hrtimer_based_broadcast_clock_event_device?= User-Agent: K-9 Mail for Android In-Reply-To: <20221201123954.1111603-2-apatel@ventanamicro.com> References: <20221201123954.1111603-1-apatel@ventanamicro.com> <20221201123954.1111603-2-apatel@ventanamicro.com> Message-ID: <04CBEBD4-3EDC-4FA0-BB11-DDD6B710C60C@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 1 December 2022 12:39:52 GMT, Anup Patel wr= ote: >From: Conor Dooley > >Similarly to commit 022eb8ae8b5e ("ARM: 8938/1: kernel: initialize >broadcast hrtimer based clock event device"), RISC-V needs to initiate >hrtimer based broadcast clock event device before C3STOP can be used=2E >Otherwise, the introduction of C3STOP for the RISC-V arch timer in >commit 232ccac1bd9b ("clocksource/drivers/riscv: Events are stopped >during CPU suspend") leaves us without any broadcast timer registered=2E >This prevents the kernel from entering oneshot mode, which breaks timer >behaviour, for example clock_nanosleep()=2E > >A test app that sleeps each cpu for 6, 5, 4, 3 ms respectively, HZ=3D250 >& C3STOP enabled, the sleep times are rounded up to the next jiffy: >=3D=3D CPU: 1 =3D=3D =3D=3D CPU: 2 =3D=3D =3D=3D CPU: 3 =3D=3D = =3D=3D CPU: 4 =3D=3D >Mean: 7=2E974992 Mean: 7=2E976534 Mean: 7=2E962591 Mean: 3=2E952= 179 >Std Dev: 0=2E154374 Std Dev: 0=2E156082 Std Dev: 0=2E171018 Std Dev: 0=2E= 076193 >Hi: 9=2E472000 Hi: 10=2E495000 Hi: 8=2E864000 Hi: 4=2E73600= 0 >Lo: 6=2E087000 Lo: 6=2E380000 Lo: 4=2E872000 Lo: 3=2E40300= 0 >Samples: 521 Samples: 521 Samples: 521 Samples: 521 > >Link: https://lore=2Ekernel=2Eorg/linux-riscv/YzYTNQRxLr7Q9JR0@spud/ >Fixes: 232ccac1bd9b ("clocksource/drivers/riscv: Events are stopped durin= g CPU suspend") >Suggested-by: Samuel Holland >Signed-off-by: Conor Dooley >Reviewed-by: Samuel Holland >Acked-by: Palmer Dabbelt Huh, thought I replied already but I just have forgotten to=2E=2E=2E Since you've added this patch to your series, it needs your SoB appended= =2E Thanks, Conor=2E >--- > arch/riscv/kernel/time=2Ec | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/arch/riscv/kernel/time=2Ec b/arch/riscv/kernel/time=2Ec >index 8217b0f67c6c=2E=2E1cf21db4fcc7 100644 >--- a/arch/riscv/kernel/time=2Ec >+++ b/arch/riscv/kernel/time=2Ec >@@ -5,6 +5,7 @@ > */ >=20 > #include >+#include > #include > #include > #include >@@ -29,6 +30,8 @@ void __init time_init(void) >=20 > of_clk_init(NULL); > timer_probe(); >+ >+ tick_setup_hrtimer_broadcast(); > } >=20 > void clocksource_arch_init(struct clocksource *cs)