From patchwork Mon Apr 29 14:05:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 13647064 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 49FA7C4345F for ; Mon, 29 Apr 2024 14:06:30 +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=ixExnNTFdmatwYUz4UpnRXu+YhfGyVjJqVj4wNkagu8=; b=ieOZmFHNiqlMVZ GNsdw+CA8tp4BQRAP6MgitAgy9VRi0yXuZLvxL8sPsfhIML0KQRLQbj8gMVhsH7OHKKa/2za8j3a2 Zxny1W9BJVAQtZRA4xBZuagtj2McZNG1E1NK7z5wSgt0nhKNU+SbP8WscGJsPvqUa7Zylf6e6NrXk 90rwYh42OMiCSwT6zrYfDhG4ZzPfJjw0bT+ljpt9ixkOth/QWeQCQd+9NMQr0zrCbqGPcjPUnPZSi OOYWPwDWFC1ogHYidt/tXkdQez+8KGF6cxWwoAuQCfb96n6DgXWTh970nFAOAP4UPuvGpLOovT5FU MxVmr5Xy6UCuFsJHkyjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1Re1-000000033SO-32jl; Mon, 29 Apr 2024 14:06:13 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1Rds-000000033Mv-08Ad for linux-arm-kernel@lists.infradead.org; Mon, 29 Apr 2024 14:06:05 +0000 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2e01d666c88so14244511fa.2 for ; Mon, 29 Apr 2024 07:06:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714399561; x=1715004361; 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=IDwOmSA7MQ7+zytHkA+laGeE0LQljf7L1jWo+P70lko=; b=ke8coQYdp739fike/kHyzV6J1F5FlRrQuwG2nL85nUuyVov2RUPg4ao4leDotxBGws VA5Wym2CBWtDj5FGkYNebPJvuTwNQ4TtWFSAkBKbxoJVBulNgENWOLsJjFoTsmKnLnHQ kOPsN1GsToAFFvJB9f5c5qCiQQLF1QRQ9MhHLPX1npg6lU9l7DlGJo8Y8uJOqgEqYTlo fD1/ZNNoF0sjir1e6n0LBz2benM8CEaghU6owX4KtjzbBJGkWAyTuI28YtU4gVSNRuBo PaeVdXb1IIl7/OdWo4/uo1kar6/BnzipiuK/cMVX5TyNRtrYG9BNk+L6bNsPozoUIz5u gmDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714399561; x=1715004361; 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=IDwOmSA7MQ7+zytHkA+laGeE0LQljf7L1jWo+P70lko=; b=S5Pf3J+mMB8wcuhYV2mFoW3mBPVYOF080q3WBwJ/ojDKJO/G1MU1YqFmt4GT0KLyy6 vBxqutT3iCLcZn8/He9rctjFcMswA1hjaon98DOUiCH0Nu3d82BlCKpK+Tgwx9yYcBMx OScDA1vZATM+Wreudc5jiXPBWxIBBpHfzQohYwP3Dck3hUMdv8kH5QTzxVKFAWkzPxN5 CQTQRWZxAyD8Ea1KnS782BOlO3QaqKBSzLZClCx5Zy7skDn1y77TArFhcN0c44CLencN bdSvKNl3a7uBFQ+AK/GpKAtHlVZh/tVPKYluOl+7HjBrPxPnr5+EPc5NKuMHAlhnJUDq 7B8w== X-Forwarded-Encrypted: i=1; AJvYcCVjLXKCKzSsS7JLo+8jzSh6iWfoVsh2862V68+McLV253Kg4AYZnUJzlRIPzMA/frYSU805Yd/JcTuUwaGLgn+F075NRvt/qYC27hOGUBJ8ESONf5s= X-Gm-Message-State: AOJu0YwxCBnB1PrxHUDbLPJQFxBtVcrZDdTmeqUHKdNEfr9nxbeT3yxj 2C9kRVYoIhpwXdihsp5GoI0N+gbBsFXhl0XioLSGcl0dQKNCZVhXYtmnPjTZA10= X-Google-Smtp-Source: AGHT+IHp/AQbEYZZdpmQu1KIboKwTFnhRTHy3IUitMBtdTfQEIp1e8p8oPGMBXNXjtBT0xrYq8GO+w== X-Received: by 2002:a2e:93d5:0:b0:2dd:6d67:3064 with SMTP id p21-20020a2e93d5000000b002dd6d673064mr6309727ljh.28.1714399560822; Mon, 29 Apr 2024 07:06:00 -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.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 07:06:00 -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 6/6] cpuidle: psci: Enable the hierarchical topology for s2idle on PREEMPT_RT Date: Mon, 29 Apr 2024 16:05:31 +0200 Message-Id: <20240429140531.210576-7-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_070604_101851_DBAA9554 X-CRM114-Status: GOOD ( 15.13 ) 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 To enable the domain-idle-states to be used during s2idle on a PREEMPT_RT based configuration, let's allow the re-assignment of the ->enter_s2idle() callback to psci_enter_s2idle_domain_idle_state(). Similar to s2ram, let's leave the support for CPU hotplug outside PREEMPT_RT, as it's depending on using runtime PM. For s2idle, this means that an offline CPU's PM domain will remain powered-on. In practise this may lead to that a shallower idle-state than necessary gets selected, which shouldn't be an issue (besides wasting power). Signed-off-by: Ulf Hansson --- drivers/cpuidle/cpuidle-psci.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/cpuidle/cpuidle-psci.c b/drivers/cpuidle/cpuidle-psci.c index ad6ce9fe12b4..2562dc001fc1 100644 --- a/drivers/cpuidle/cpuidle-psci.c +++ b/drivers/cpuidle/cpuidle-psci.c @@ -233,18 +233,17 @@ static int psci_dt_cpu_init_topology(struct cpuidle_driver *drv, psci_cpuidle_use_syscore = true; - /* The hierarchical topology is limited to s2ram on PREEMPT_RT. */ - if (IS_ENABLED(CONFIG_PREEMPT_RT)) - return 0; - /* * Using the deepest state for the CPU to trigger a potential selection * of a shared state for the domain, assumes the domain states are all - * deeper states. + * deeper states. On PREEMPT_RT the hierarchical topology is limited to + * s2ram and s2idle. */ - drv->states[state_count - 1].enter = psci_enter_domain_idle_state; drv->states[state_count - 1].enter_s2idle = psci_enter_s2idle_domain_idle_state; - psci_cpuidle_use_cpuhp = true; + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) { + drv->states[state_count - 1].enter = psci_enter_domain_idle_state; + psci_cpuidle_use_cpuhp = true; + } return 0; }