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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0A81C54EAA for ; Tue, 24 Jan 2023 15:34:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235243AbjAXPec (ORCPT ); Tue, 24 Jan 2023 10:34:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235239AbjAXPeX (ORCPT ); Tue, 24 Jan 2023 10:34:23 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C0AB04C0CA; Tue, 24 Jan 2023 07:34:15 -0800 (PST) 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 4CF224B3; Tue, 24 Jan 2023 07:34:57 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DDBE73F5A1; Tue, 24 Jan 2023 07:34:13 -0800 (PST) Date: Tue, 24 Jan 2023 15:34:11 +0000 From: Sudeep Holla To: Krzysztof Kozlowski Cc: "Rafael J. Wysocki" , Sudeep Holla , Daniel Lezcano , Lorenzo Pieralisi , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sebastian Andrzej Siewior , Ulf Hansson , Adrien Thierry , Brian Masney , linux-rt-users@vger.kernel.org Subject: Re: [PATCH v3] cpuidle: psci: Do not suspend topology CPUs on PREEMPT_RT Message-ID: <20230124153411.nwkbjgoqgkua2icm@bogus> References: <20230119184228.683892-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230119184228.683892-1-krzysztof.kozlowski@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 19, 2023 at 07:42:28PM +0100, Krzysztof Kozlowski wrote: > The runtime Power Management of CPU topology is not compatible with > PREEMPT_RT: > 1. Core cpuidle path disables IRQs. > 2. Core cpuidle calls cpuidle-psci. > 3. cpuidle-psci in __psci_enter_domain_idle_state() calls > pm_runtime_put_sync_suspend() and pm_runtime_get_sync() which use > spinlocks (which are sleeping on PREEMPT_RT). > > Deep sleep modes are not a priority of Realtime kernels because the > latencies might become unpredictable. On the other hand the PSCI CPU > idle power domain is a parent of other devices and power domain > controllers, thus it cannot be simply skipped (e.g. on Qualcomm SM8250). > > Disable the runtime PM calls from cpuidle-psci, which effectively stops > suspending the cpuidle PSCI domain. This is a trade-off between making > PREEMPT_RT working and still having a proper power domain hierarchy in > the system. > > Cc: Adrien Thierry > Cc: Brian Masney > Cc: linux-rt-users@vger.kernel.org > Signed-off-by: Krzysztof Kozlowski > > --- > > Changes since v1: > 1. Re-work commit msg. > 2. Add note to Kconfig. > > Several other patches were dropped, as this is the only one actually > needed. It effectively stops PSCI cpuidle power domains from suspending > thus solving all other issues I experienced. > --- > drivers/cpuidle/Kconfig.arm | 3 +++ > drivers/cpuidle/cpuidle-psci.c | 4 ++-- > 2 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/cpuidle/Kconfig.arm b/drivers/cpuidle/Kconfig.arm > index 747aa537389b..24429b5bfd1c 100644 > --- a/drivers/cpuidle/Kconfig.arm > +++ b/drivers/cpuidle/Kconfig.arm > @@ -24,6 +24,9 @@ config ARM_PSCI_CPUIDLE > It provides an idle driver that is capable of detecting and > managing idle states through the PSCI firmware interface. > > + The driver is not yet compatible with PREEMPT_RT: no idle states will > + be entered by CPUs on such kernel. > + Any particular reason for even compiling this file in or allowing the ARM_PSCI_CPUIDLE when PREEMPT_RT=y ? If we can't enter idle states, we can as well compile this file out ? -- Regards, Sudeep 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 558B2C25B4E for ; Tue, 24 Jan 2023 15:35:18 +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=1nQNy2WNXapjpJBS8ZLX2Mx0qgHQaywBD0Lcac5eubE=; b=4NOu/d9igoWNwb 26har+SQi3gqD30W/BQKLHDm5ieubZKezbd56VosZ3+ACRzrUDQHwtzx93ELY11VtLF2KKo63GgQb azmP2akk201oXM3CwyEAwIZgCZDndvg2FkhumZ3Q7HXu7egAPCDAG8GC0CgNfqu2RYkhQzox5wsRk G4DGpTzn/j0huCW+hrnTSiW2lQWpTftQYBBS2VNMuZ+MQFtPEp38t1SmO08RbkXUHXC9bqZf7ogbi IsxadINLCFiZqPARd4wBf9jRnsGRXaP3TyBFpMcXMferfbD/5wllmDz3bxQxkrNe7b2IpDb65+1L5 UTOUXJYyH4wZErN3TdCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKLJW-004XDF-FG; Tue, 24 Jan 2023 15:34:22 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKLJS-004XBl-9Q for linux-arm-kernel@lists.infradead.org; Tue, 24 Jan 2023 15:34:20 +0000 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 4CF224B3; Tue, 24 Jan 2023 07:34:57 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DDBE73F5A1; Tue, 24 Jan 2023 07:34:13 -0800 (PST) Date: Tue, 24 Jan 2023 15:34:11 +0000 From: Sudeep Holla To: Krzysztof Kozlowski Cc: "Rafael J. Wysocki" , Sudeep Holla , Daniel Lezcano , Lorenzo Pieralisi , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sebastian Andrzej Siewior , Ulf Hansson , Adrien Thierry , Brian Masney , linux-rt-users@vger.kernel.org Subject: Re: [PATCH v3] cpuidle: psci: Do not suspend topology CPUs on PREEMPT_RT Message-ID: <20230124153411.nwkbjgoqgkua2icm@bogus> References: <20230119184228.683892-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230119184228.683892-1-krzysztof.kozlowski@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230124_073418_410465_25388A96 X-CRM114-Status: GOOD ( 20.74 ) 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 Thu, Jan 19, 2023 at 07:42:28PM +0100, Krzysztof Kozlowski wrote: > The runtime Power Management of CPU topology is not compatible with > PREEMPT_RT: > 1. Core cpuidle path disables IRQs. > 2. Core cpuidle calls cpuidle-psci. > 3. cpuidle-psci in __psci_enter_domain_idle_state() calls > pm_runtime_put_sync_suspend() and pm_runtime_get_sync() which use > spinlocks (which are sleeping on PREEMPT_RT). > > Deep sleep modes are not a priority of Realtime kernels because the > latencies might become unpredictable. On the other hand the PSCI CPU > idle power domain is a parent of other devices and power domain > controllers, thus it cannot be simply skipped (e.g. on Qualcomm SM8250). > > Disable the runtime PM calls from cpuidle-psci, which effectively stops > suspending the cpuidle PSCI domain. This is a trade-off between making > PREEMPT_RT working and still having a proper power domain hierarchy in > the system. > > Cc: Adrien Thierry > Cc: Brian Masney > Cc: linux-rt-users@vger.kernel.org > Signed-off-by: Krzysztof Kozlowski > > --- > > Changes since v1: > 1. Re-work commit msg. > 2. Add note to Kconfig. > > Several other patches were dropped, as this is the only one actually > needed. It effectively stops PSCI cpuidle power domains from suspending > thus solving all other issues I experienced. > --- > drivers/cpuidle/Kconfig.arm | 3 +++ > drivers/cpuidle/cpuidle-psci.c | 4 ++-- > 2 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/cpuidle/Kconfig.arm b/drivers/cpuidle/Kconfig.arm > index 747aa537389b..24429b5bfd1c 100644 > --- a/drivers/cpuidle/Kconfig.arm > +++ b/drivers/cpuidle/Kconfig.arm > @@ -24,6 +24,9 @@ config ARM_PSCI_CPUIDLE > It provides an idle driver that is capable of detecting and > managing idle states through the PSCI firmware interface. > > + The driver is not yet compatible with PREEMPT_RT: no idle states will > + be entered by CPUs on such kernel. > + Any particular reason for even compiling this file in or allowing the ARM_PSCI_CPUIDLE when PREEMPT_RT=y ? If we can't enter idle states, we can as well compile this file out ? -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel