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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 024C1CA553C for ; Thu, 14 Sep 2023 13:22:28 +0000 (UTC) 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:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ku/75/Yqe5n9EJqgyhg2G3Sf97Nw2lcvjNt08UspapE=; b=L9N/PPpSdWXjgm 5/iZwSzvWG0fGXjDHeQ/LLtfuwLEnFRnbtd1aZHk8XajQFn4u2txaFRtA7zSHfaF9pBCLPbi4d/Vt rrOXI1kMIJgn9IoPQxhHIrurgU3KqMrZGsCli8C98gbqfT931MH/F27k7x46SoGr/7Lw2KzE5yga+ FNofRoWEMBZLRGXjHf+nmYkC28YqYHd5G6LWCpDq/7I0hvoueN+ygvcaAMMdVfj7L13LE4QPrmDbY sZZ0bg4NF8FPPnsyiAIzxYHisMHmymUYFDX5rljpcvqwOxPNwy3BnwRZuKbu4m7laVXECi+0+cSje S5i7hbh1Qn5uMH00+kMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qgmIC-008RN9-1L; Thu, 14 Sep 2023 13:22:00 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qgmI9-008RMV-1v for linux-arm-kernel@lists.infradead.org; Thu, 14 Sep 2023 13:21:58 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8AC6061D66; Thu, 14 Sep 2023 13:21:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 479F9C433C8; Thu, 14 Sep 2023 13:21:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694697716; bh=FzlNAs3rImdHO1pAdlHaXIjQ1hufjxExpSnTB4BHtY0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EdT53XN7rp75UYrl4UjRDK+k6N6DHdGyF4Kn9iog/QWHPhwnTa2HxE3vC6m9QotD1 deWOexHV3XmrQB1CeMf61oxOky9wqkJ7a2c79anw2bV27je28pgHT4egk82wSWrew6 F4YXa2AOSFG1iYoh11TIeLdONUNgOn8/f5ywnBOl+hBpg+rB4pD2nlR2j00BZJP9Nq pZ3LVr4Q3LZYdMLhXV8OA4EbbazUJU6p77bm5xi2tVQSlJQWq38atrhD+ILkiMlslq pftRuW4ekNk/BH5sUVItdiMY+jKYUOjSl1cX7pDzjWjQqf/38TvPT8wU/TUu8zFpow 5DxsDkisXaeLA== Date: Thu, 14 Sep 2023 14:21:50 +0100 From: Will Deacon To: Oza Pawandeep Cc: sudeep.holla@arm.com, catalin.marinas@arm.com, rafael@kernel.org, lenb@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH v5] cpuidle, ACPI: Evaluate LPI arch_flags for broadcast timer Message-ID: <20230914132149.GA13461@willie-the-truck> References: <20230912172933.3561144-1-quic_poza@quicinc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230912172933.3561144-1-quic_poza@quicinc.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230914_062157_738696_F67DABBF X-CRM114-Status: GOOD ( 21.33 ) 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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Sep 12, 2023 at 10:29:33AM -0700, Oza Pawandeep wrote: > Arm=AE Functional Fixed Hardware Specification defines LPI states, > which provide an architectural context loss flags field that can > be used to describe the context that might be lost when an LPI > state is entered. > = > - Core context Lost > - General purpose registers. > - Floating point and SIMD registers. > - System registers, include the System register based > - generic timer for the core. > - Debug register in the core power domain. > - PMU registers in the core power domain. > - Trace register in the core power domain. > - Trace context loss > - GICR > - GICD > = > Qualcomm's custom CPUs preserves the architectural state, > including keeping the power domain for local timers active. > when core is power gated, the local timers are sufficient to > wake the core up without needing broadcast timer. > = > The patch fixes the evaluation of cpuidle arch_flags, and moves only to > broadcast timer if core context lost is defined in ACPI LPI. > = > Reviewed-by: Sudeep Holla > Signed-off-by: Oza Pawandeep > = > diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h > index 4d537d56eb84..a30b6e16628d 100644 > --- a/arch/arm64/include/asm/acpi.h > +++ b/arch/arm64/include/asm/acpi.h > @@ -9,6 +9,7 @@ > #ifndef _ASM_ACPI_H > #define _ASM_ACPI_H > = > +#include > #include > #include > #include > @@ -44,6 +45,25 @@ > = > #define ACPI_MADT_GICC_TRBE (offsetof(struct acpi_madt_generic_interrup= t, \ > trbe_interrupt) + sizeof(u16)) > +/* > + * Arm=AE Functional Fixed Hardware Specification Version 1.2. > + * Table 2: Arm Architecture context loss flags > + */ > +#define CPUIDLE_CORE_CTXT BIT(0) /* Core context Lost */ > + > +#ifndef arch_update_idle_state_flags > +static __always_inline void _arch_update_idle_state_flags(u32 arch_flags, > + unsigned int *sflags) > +{ > + if (arch_flags & CPUIDLE_CORE_CTXT) > + *sflags |=3D CPUIDLE_FLAG_TIMER_STOP; > +} > +#define arch_update_idle_state_flags _arch_update_idle_state_flags > +#endif Why do you need the #ifndef/endif guards here? I'd have thought you'd _always_ want this definition to be the one used, with the compiler complaining otherwise. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel