Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp381662imn; Wed, 27 Jul 2022 08:46:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1un0198qZ4vCn8pkQ+4XH8ayZ42Xau21A7JEVi6usuqMLnSvnYp9Hv4yZEj8i8EOpF+V/5F X-Received: by 2002:a17:90b:3509:b0:1f2:dc98:5976 with SMTP id ls9-20020a17090b350900b001f2dc985976mr5394246pjb.154.1658936818311; Wed, 27 Jul 2022 08:46:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658936818; cv=none; d=google.com; s=arc-20160816; b=hBjG+16sofmPiSpiod1U/Jw+YJX2z/67Q6GOqRWARc6gjqWhEHCWXb+EkVNcUrmXN8 JthCkf8bWGvjR+NATg+S5lInQMRu4LY3XIPHhgcIcnK1RF9OtOtbC+14pE7T9xTCf0g2 Y3/ktt/G0uzMRjNHGsMUOczaGzrtgEog0HJx3XJ8UuoQnhyyfel418EjsrO3aTK5MGkl L5aIa1AQAdfARJYa6oxV/B2RTS93Bigy+LGyN1MbZupLaXjQacibl40g4Ue6LJutaAUd rIMDWvk9TovVKTdZXhqwRqD9k7kC9QRlfZDwmuHEUqfxFoi9c7jaeQznj5iJZtdJ3mQI DyCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=yalyUDvyIuW6r2/O+qk5yK74DwfP4KW2htTba1Dag6Y=; b=gRfrCcCXNOKkB6dO37Jy2R8G9e+aV56Jvxvaa38gK8rF+c8NZwgQPZyjjY6S/90DIY KhvQpS2UZV2A57VTpHnx1Kv9U8Gpt3RjoaX3uJwa57+KT2Wc1vyZjEu0xiZr6Lj77G9V 83lQgeRVNTjKzaHkFKC3qhf8mUXKERXb6lnPICyLmMaem1cRsp9T+Gy+vAm+7+u5ljNv hIX+ORYedcei0+asjy99OPfCpLELbJ2MejtcZuu1XjnVX/DfXBQIX2zjx04TxcfHUy7J LJly7EZbdoOkXleelYrpN9KamWnThnxxM2WOuCnwGcub8Vvp7g0Ob82LDoxKZbQ5na9p dbrg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hk8-20020a17090b224800b001df518c9e46si2752230pjb.190.2022.07.27.08.46.42; Wed, 27 Jul 2022 08:46:58 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231518AbiG0P0W (ORCPT + 99 others); Wed, 27 Jul 2022 11:26:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbiG0P0U (ORCPT ); Wed, 27 Jul 2022 11:26:20 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 785DC3336E; Wed, 27 Jul 2022 08:26:19 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ABAA5113E; Wed, 27 Jul 2022 08:26:19 -0700 (PDT) Received: from bogus (unknown [10.57.11.51]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E04EB3F73B; Wed, 27 Jul 2022 08:26:16 -0700 (PDT) Date: Wed, 27 Jul 2022 16:26:13 +0100 From: Sudeep Holla To: Anup Patel Cc: Krzysztof Kozlowski , Anup Patel , Rob Herring , Sudeep Holla , Krzysztof Kozlowski , Palmer Dabbelt , Paul Walmsley , Daniel Lezcano , Thomas Gleixner , Andrew Jones , Atish Patra , Samuel Holland , devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] dt-bindings: riscv: Add optional DT property riscv,timer-can-wake-cpu Message-ID: <20220727152613.kbhfnvekpkd7na72@bogus> References: <20220727114302.302201-1-apatel@ventanamicro.com> <20220727114302.302201-2-apatel@ventanamicro.com> <372e37bf-ac90-c371-ad9e-b9c18e1cc059@linaro.org> <20220727124556.owk3zlyzsg5uaa4t@bogus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,TVD_PH_BODY_ACCOUNTS_PRE 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 Wed, Jul 27, 2022 at 07:15:28PM +0530, Anup Patel wrote: > Hi Sudeep, > > On Wed, Jul 27, 2022 at 6:16 PM Sudeep Holla wrote: > > > > On Wed, Jul 27, 2022 at 02:07:50PM +0200, Krzysztof Kozlowski wrote: > > > On 27/07/2022 13:43, Anup Patel wrote: > > > > We add an optional DT property riscv,timer-can-wake-cpu which if present > > > > in CPU DT node then CPU timer is always powered-on and never loses context. > > > > > > > > Signed-off-by: Anup Patel > > > > --- > > > > Documentation/devicetree/bindings/riscv/cpus.yaml | 6 ++++++ > > > > 1 file changed, 6 insertions(+) > > > > > > > > diff --git a/Documentation/devicetree/bindings/riscv/cpus.yaml b/Documentation/devicetree/bindings/riscv/cpus.yaml > > > > index d632ac76532e..b60b64b4113a 100644 > > > > --- a/Documentation/devicetree/bindings/riscv/cpus.yaml > > > > +++ b/Documentation/devicetree/bindings/riscv/cpus.yaml > > > > @@ -78,6 +78,12 @@ properties: > > > > - rv64imac > > > > - rv64imafdc > > > > > > > > + riscv,timer-can-wake-cpu: > > > > + type: boolean > > > > + description: > > > > + If present, the timer interrupt can wake up the CPU from > > > > + suspend/idle state. > > > > > > Isn't this a property of a timer, not CPU? IOW, your timer node should > > > have "wakeup-source" property. > > > > > > > I agree on the concept that this is property of the timer and not CPU. > > However we generally don't need to use wakeup-source property for timer > > as we ideally use this for waking up from system sleep state and we don't > > want to be running timer when we enter the state. > > It seems ARM is using two separate timer DT properties: one for > system suspend (i.e. arm,no-tick-in-suspend) and another for CPU > system (i.e. always-on). Is this understanding correct ? > TBH, I hadn't looked at "arm,no-tick-in-suspend" before though it seem to be there for few years now. Based on the log, I see this as quirk for some platform and not used on many platforms. Ideally to account how much time was spent in suspend, we could use the counter as it continues to tick during the suspend as well i.e. just the timers are not available if not always. This was added to handle systems that are not conformant to the expectation of always available counter. -- Regards, Sudeep