From patchwork Mon May 27 14:25:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 13675436 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 5792AC25B74 for ; Mon, 27 May 2024 14:26:40 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=P2ZwfjYwYAEW9T7pAXGqcZF81/zE7M5nsglXGEmxFAw=; b=wnHNMrN6sR2xon 3IwqdCETVi27IgBF75xcMlUD8m8DCK4RrhlSTFxcWU8snCS6L2jP3iYDddonKO4BEnONfry9mpF1G 44brysT7Sdlx1KdaUDGTZ7EtpgXj/j+jToBegPBzn8oRXHobFvYcfNzSwAKyy5HZ+lALAavNh0f7u F5dIOBVSG8K3tedYNXSW4Mf5KX059RUch/qCesFfOiuMd3uAvTBfdkwhDX6K+CXWNe4zPn3UgqfrP ZY6lEv3Ve6fE/oXYSBwyDbv3LEqufvYLyYULMXYCHfUBj4fDzt3q6reGAs1ys+m3IpqZZ2IKd05yM QosTqG3dFSNncISFhUCQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBbJ0-0000000FMDO-3rUv; Mon, 27 May 2024 14:26:30 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBbIl-0000000FM3E-3zjn for linux-arm-kernel@lists.infradead.org; Mon, 27 May 2024 14:26:17 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-529aa4e988aso2026607e87.0 for ; Mon, 27 May 2024 07:26:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716819974; x=1717424774; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XR5PKdQ2iHKXMf6EJDdAOgUvQYES8E8gefpFvCEDCJQ=; b=mjpJbkzS5q/bcuVgS65VR8CH5J8XEygMfwgHRu5kxXN+9Vzfs3GjRBH5TwAYal7cY5 o4nKuJPkd4SsjLpBk9/BcgOr+7CGZEK+X1EFb2LJwRuYflreoemYud78bdy0U7WXvRyz Z/m/PKA00N1gTaFit0HgmFTPDp/DyZwDyOV+cdebZ8dkRC+XRoZKpm31bIhqTAk1KHan g4JEbhFZHcxIGT/Cn+ABxmKCaD1sIz23FxFd1KGJCI98ZFuucTpGSSPAcwsVVvrLxK8v v+yW8/hAhoxPWJIVP6ACuB6sGz72EugJK9y8pzJHVW5agiubny+/rxOgaE90cMHAEGgA 7U6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716819974; x=1717424774; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XR5PKdQ2iHKXMf6EJDdAOgUvQYES8E8gefpFvCEDCJQ=; b=G0RTBgQ+t9xnO3uFL+UpWHdGXTOGGYc12LXW8MZC0XEfO74+v6o6Lb4CJpc7nK/cq/ JuPLe/08R454BCqjK0Gc8kn4C6DkQbLoZ3Ne7XR89b8NVFWG4v9YVkPQW5fB1CPGOEyO iXTWcUBq8OSAzWA45vHPjK6h+TWMMMmNT1U5PtS0kN5JSyed3rl5ORXfGjlHjKj2TBhE UYMHHxD7X1RCwpBOqZBa7rnacJBnVzffOVZVl79cX93HPEo7ruerI9Et+2P57i3jMOrn uSdq4nNzzDYn8Qgo2u3zQ86LMuQUjKdjPg44iCWlef+SnrevEIisSvxr+O5OqkGyfPaL 5P+g== X-Forwarded-Encrypted: i=1; AJvYcCXOaszVuaE7+Zi8vUI8aezA2nm3eitYNTWuxpzm1GdT855BuJqwgDgOMaib54owkt+ZwOQ20X3NmpudiUvM0IK68sob+ncTq4LW24cJtjWP7VTj/BQ= X-Gm-Message-State: AOJu0YxyHfYA2rc579dRG4tP5ZltYvwPFFzZY0bKXDNEYvDuCGEQTqkK GEuqDfiGQsVaTmt9KrJYhqvFcxW+CS2LEhathtYIWRGB6pAiyE7+51oA5ZJQvDU= X-Google-Smtp-Source: AGHT+IHN6I0KgOI+mMpRmfv9UvFiyCmUDcI287s6FVISxsXFeKqa2fx6vLJsUQQYAYOYjuyf/gP2Aw== X-Received: by 2002:ac2:5a09:0:b0:523:88e9:9cd2 with SMTP id 2adb3069b0e04-529667cf983mr4822493e87.67.1716819973713; Mon, 27 May 2024 07:26:13 -0700 (PDT) Received: from uffe-tuxpro14.. (h-178-174-189-39.A498.priv.bahnhof.se. [178.174.189.39]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-529711fa7f3sm562002e87.258.2024.05.27.07.26.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 07:26:13 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Sudeep Holla , linux-pm@vger.kernel.org Cc: Lorenzo Pieralisi , Nikunj Kela , Prasad Sodagudi , Maulik Shah , Daniel Lezcano , Krzysztof Kozlowski , Ulf Hansson , linux-rt-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/7] cpuidle: psci-domain: Enable system-wide suspend on PREEMPT_RT Date: Mon, 27 May 2024 16:25:54 +0200 Message-Id: <20240527142557.321610-5-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527142557.321610-1-ulf.hansson@linaro.org> References: <20240527142557.321610-1-ulf.hansson@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240527_072616_065759_03CA0B81 X-CRM114-Status: GOOD ( 16.20 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The domain-idle-states are currently disabled on a PREEMPT_RT based configuration for the cpuidle-psci-domain. To enable them to be used for system-wide suspend and in particular during s2idle, let's set the GENPD_FLAG_RPM_ALWAYS_ON instead of GENPD_FLAG_ALWAYS_ON for the corresponding genpd provider. In this way, the runtime PM path remains disabled in genpd for its attached devices, while powering-on/off the PM domain during system-wide suspend becomes allowed. Signed-off-by: Ulf Hansson --- Changes in v2: - None. --- drivers/cpuidle/cpuidle-psci-domain.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c index fae958794339..ea28b73ef3fb 100644 --- a/drivers/cpuidle/cpuidle-psci-domain.c +++ b/drivers/cpuidle/cpuidle-psci-domain.c @@ -67,12 +67,16 @@ static int psci_pd_init(struct device_node *np, bool use_osi) /* * Allow power off when OSI has been successfully enabled. - * PREEMPT_RT is not yet ready to enter domain idle states. + * On a PREEMPT_RT based configuration the domain idle states are + * supported, but only during system-wide suspend. */ - if (use_osi && !IS_ENABLED(CONFIG_PREEMPT_RT)) + if (use_osi) { pd->power_off = psci_pd_power_off; - else + if (IS_ENABLED(CONFIG_PREEMPT_RT)) + pd->flags |= GENPD_FLAG_RPM_ALWAYS_ON; + } else { pd->flags |= GENPD_FLAG_ALWAYS_ON; + } /* Use governor for CPU PM domains if it has some states to manage. */ pd_gov = pd->states ? &pm_domain_cpu_gov : NULL;