From patchwork Mon Apr 29 14:05:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 13647035 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 52B0BC4345F for ; Mon, 29 Apr 2024 14:06:24 +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=saOJlNu25YP7+qMPxxY25944A9FA3qQTnbUDYojJ9cA=; b=EPt+Y3ffQzYw+u MFsbaiSlRabNyf96InW8Z0hyJli4A6w4uvt+n860YXfncEWqlGUX1hEAOuAF3TjglJ8bkLEayK7gR imOqhToxdFt75EMgM5fD3srkzEqMyZ5Zj4T/0Hnhftg+F6jpklkTi3tYME86H9/X5Y67cqrXs+GnU fHTwm4HEVvARu04Fv+658XHe8DEoo9tj8ot6Ij+4Of6/eCnYUVZugL4VtmnrRoIfmZLPGP9wdS8sL 9tLQl3QvcJtm1+1PFXDXKo7SE7nhpLDlrO7CW3qHHebUytPI6v1ISLtYfFxuJiAcrDjovTE48vwGz rdUEi/tqjAGt9+g3pgow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1Rdx-000000033PI-3foO; Mon, 29 Apr 2024 14:06:09 +0000 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1Rdn-000000033LQ-3VUn for linux-arm-kernel@lists.infradead.org; Mon, 29 Apr 2024 14:06:01 +0000 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2db13ca0363so71650331fa.3 for ; Mon, 29 Apr 2024 07:05:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714399557; x=1715004357; 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=AW5irYe0gjQq7lL2yVFdE32QB/2sja742dgELwuFIJk=; b=RSzM17bF5LElOomwitQbZWbmFlUOIiqnutfXjd8SKyYKJZLxYfyS5QEmjhOX9STENU 5xDRDQ7fZuRKKPZ3xhPrJnBcwlYLoLCYpujpARGiL5QThnfs6Ft+vlJUvsVIIlRRbmFS IvbT+8/1kJHvAj6bFwgrzhwikjIx9oqWniKraR9R0PqsKdVbqlBwtZZfMt5BJ2pqEyp9 Rz0VRng0nG1gxWERm93fS0j/bgiRNln9EnvgOqfZEm/pKrO4CzwcF3TQXSt8LDGJDn9W feI4rhAhPVnRlSegfsR+yzNcd7bfzcYXC4EESaXzpuWMYbaXvBvQchQ/VyLUnz9nCkD5 w7Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714399557; x=1715004357; 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=AW5irYe0gjQq7lL2yVFdE32QB/2sja742dgELwuFIJk=; b=wizuymrYcQq8542mLx4SjTPu0GhNf4qN02zjSz2fIjV0nawy5z7ooW6e52CCLaUv94 YxrRjjo/KCJBqpXI6A7xEDQJkQhdQ+lZWeON3m1pSlS3KankA6O0YiphlTuRSImrYC16 xx2qYIsR4q0ct+rDBfhC+j53ct3ZVogwAuLtgccLm3D5TsbMB+rskWMQhM1kY/5F+2xH OTwRN2mx3ogRG+hfK5ZuXu8DgmWv4ujCxeUfHk2X48binYk7G/909S4xS1+x8QkFYTfq /52NcY7U3Yx4VWM6W0ceLfE9wnBlK0dxwql5nm3mmFnjlD256q3rnyYzY2pnXkEDWemL 0i3A== X-Forwarded-Encrypted: i=1; AJvYcCXQoKSDDgJeS0jV1YrMqLEmAToKwDa/G5xMLnd2R2GLdgbJDk90KnzM5C/GrNNcTNdFsasRf6LEi4TD9fhF/E8nvdodZevp/6d8y0962hokz1IBDTE= X-Gm-Message-State: AOJu0Yz3kqUV6m1IYjsYryr/Lewt5owpz05QwiAtc0kJncAbgsEn8lgQ DfsI0CojUUTuLj+udP11gp1W0ASsM/lzLDNIHuhggtC79NjLmEjaQvJo3aEaT1A= X-Google-Smtp-Source: AGHT+IGF1UWUkvnjVr7+ybR1e2V30LVUypzK2Fkn+AyO/pGbJIHureio72OUBUaKULp0nWYCZstvjA== X-Received: by 2002:a2e:730c:0:b0:2d8:5af9:90c5 with SMTP id o12-20020a2e730c000000b002d85af990c5mr8482506ljc.39.1714399557079; Mon, 29 Apr 2024 07:05:57 -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 l5-20020a2e9085000000b002d7095bf808sm3636733ljg.128.2024.04.29.07.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 07:05:56 -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 3/6] cpuidle: psci-domain: Enable system-wide suspend on PREEMPT_RT Date: Mon, 29 Apr 2024 16:05:28 +0200 Message-Id: <20240429140531.210576-4-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240429140531.210576-1-ulf.hansson@linaro.org> References: <20240429140531.210576-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-20240429_070600_015126_0F357FCD X-CRM114-Status: GOOD ( 15.29 ) 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 --- 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;