Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1620154lqa; Mon, 29 Apr 2024 14:00:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWrvrJMx8c8rVQwPA7fT7fzUbNGjr8QYzOhNnoyrKnVyf1GV0BBnpKUDoIe/Bg0KiU4Jo8Cfw1aUfkYeOcLxVfaJOTM5ED59IcykpYKSg== X-Google-Smtp-Source: AGHT+IHxsnYviAxjIeoKqb3w36SiY5ZQJO0mLhdYaRtlGWVIZ152w9h25i7K/qkjX0jqG85n8RCj X-Received: by 2002:a17:90a:4207:b0:2b0:763b:370e with SMTP id o7-20020a17090a420700b002b0763b370emr1091192pjg.18.1714424402165; Mon, 29 Apr 2024 14:00:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714424402; cv=pass; d=google.com; s=arc-20160816; b=ooUBMUYGTkAq5wRxku/yNPldm0Cwk6ysaIV0EW/TVWD7ik7XlKtGvDVqGpMLmc4ZUo 080dCEOF/Xy6ogpjIre/i7tDAdXqzU4toSr3R6ltAsmtGdq4jCDYSVt5yN98DM8s2xte U4RFENCvFHBoL7t28I4Ebu//VKJO5wyZKDWD814bWpolBLEKar+kFZhEYMVo6714THYj O69PghBCrV+ohm41B/TZ2QDcY8liCsONxD3DkkwwwRsjHJZ1B63JXBtlGZmU72KDP5wh m4HcVwBBDdrKN3QSTEETePS0apFo0ro/Ith2fMz/sdnOCiVcCu6wK3/nPBJIYOlB0etv pFZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:to:from:cc:in-reply-to :subject:date:dkim-signature; bh=YPb10z2R6QzqCU/Ny7A6YIEMfMl5Kr9JPZ53mPCpdgY=; fh=ouCBdkfdiRX9M45yHhnT61wWSpgXDXyEbd6/DGIJ7uE=; b=mww4Jkj5i2xxK2IBg1c/kpf3BO6M6QNgnqi6dcrnNB0X9SAtIHoX4sD+QafzSOyLJm FvP6aFJw07OUE7rQdQYTflm6nWJZb7FGnzj/KpwgcHRI4Bk6yU3ZqFx0ZYkw5Xo9/RZt X2IEGHavsco87MXjevu2WZmQafcpQRT2ie3VAyI93si5fWRBAhRDhCwNKX2q1I9WmkXh 8fBb/SlnfJHQl7J4OHpZ0yX6S62hn7FfvUmOXEgdl2H49vfLG60ar4IUzefT3zaC/3aN 9xjcbjoWFlp+L16h5WEinR0SPyGoHJbtMbdy3fcU43+n1ocR2gwP2oCbR07m11OkfuPl zMMg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@dabbelt-com.20230601.gappssmtp.com header.s=20230601 header.b=byQXqCty; arc=pass (i=1 spf=pass spfdomain=dabbelt.com dkim=pass dkdomain=dabbelt-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-163032-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163032-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u137-20020a63798f000000b005dc81a6b2c9si20176794pgc.666.2024.04.29.14.00.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 14:00:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163032-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@dabbelt-com.20230601.gappssmtp.com header.s=20230601 header.b=byQXqCty; arc=pass (i=1 spf=pass spfdomain=dabbelt.com dkim=pass dkdomain=dabbelt-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-163032-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163032-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2079A28142B for ; Mon, 29 Apr 2024 21:00:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C4978178CD2; Mon, 29 Apr 2024 20:59:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dabbelt-com.20230601.gappssmtp.com header.i=@dabbelt-com.20230601.gappssmtp.com header.b="byQXqCty" Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF1BB1779AB for ; Mon, 29 Apr 2024 20:59:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714424395; cv=none; b=RVgeDac8ag2xPn1l47wuwpxDx7VUHR+LyumRqpyukDE1zIUJE0HOvxHTpB6fgesHH1h6Mnd0zLaAOUcLouDREQqVcSU9w/M1NdLbq6pqml3w8P6l3MKxPhf40Q11XSGRFRRg7Fm4GI7NmZnRDWNK3CoQwvGBSxjwvmDAiLgtWFk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714424395; c=relaxed/simple; bh=GOfEDRU6P0ovWrWCU9wtFsIhy74/04c7AX+niJ+qtt4=; h=Date:Subject:In-Reply-To:CC:From:To:Message-ID:Mime-Version: Content-Type; b=JujRs3fnuXLejxTDXVu5x5lOPm9EY064UW7qPtfuu6IXnjWyYh1cDIVkiG0dPmMalhuxVAQEZ7ZocSHDh42xxXF9beeFt+PD5EYHz20My8XXdxWKTiobqTDL6bFADBqN4Yz9CeQ98PVF7BrJ94hf7X5cvl0Hwhk+1X9HihVNRo8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dabbelt.com; spf=pass smtp.mailfrom=dabbelt.com; dkim=pass (2048-bit key) header.d=dabbelt-com.20230601.gappssmtp.com header.i=@dabbelt-com.20230601.gappssmtp.com header.b=byQXqCty; arc=none smtp.client-ip=209.85.210.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dabbelt.com Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-6f0aeee172dso3460771b3a.1 for ; Mon, 29 Apr 2024 13:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20230601.gappssmtp.com; s=20230601; t=1714424392; x=1715029192; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=YPb10z2R6QzqCU/Ny7A6YIEMfMl5Kr9JPZ53mPCpdgY=; b=byQXqCtyLlixH+TXDbYgk3c2ARFOcDGc5SKTn0XZF4kSctEh36fupBI10jqdXCotgV 0zoW7wfC7UUNzR5I+2XWH7YFML08H+sakz+d5TZiDyy+q7OIz9VrhMWm3jICw1lP7vWV 0rjKICLa9uT36BZyvKrxbcfxdi6tczk2/eHaocPUJOSsWB9tnUAV6QpwkHx6xucmb95y kaVd37J+dT2ajGbX5sGy1fcKxhtJ4CW8JbnldmBtLo1FF6MmnHX41vh6c2pOTJAjg7jv 77qCbBfXEoqbGW7KOFIsyZKfQke69NBhOna/YVU9fElTd+TgHpTq0gVp/iSB0/maKc7o Frxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714424392; x=1715029192; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YPb10z2R6QzqCU/Ny7A6YIEMfMl5Kr9JPZ53mPCpdgY=; b=WqBj7+vkLwEPfNox7QJ6hWJAg0UL3bDIo/+27MCqJMoIOh0ZNrTYJW9gfiqXRKTf/E ZqwelI+ACjeFR+5otualtObQ4CEkCyAA0SYomdOKHRi8EwUsErd6Q+6IfUUEQY9mbbCi DPVvv8LEBYTSTRt1WMTr53yEDNuCiJIN0vwQk7F6XYGJxL7rqY6o7bEtIyPWSPrF2CSr LlFzFKnGXV3SGiACiD7t0sn47YbJ2N2RbIckDljli65HTfQj68dccaaSqp3zk+CRetrg /27eeLP5jDL1xtK8/H8gsTbPtqXVgZJdzNTphnQ1LKgNXb3WSHbkx4OfGUa+a9UIra7j 9xpA== X-Forwarded-Encrypted: i=1; AJvYcCW3TtClG9i6UjUepuiP90aR8AaawVADQ/GazOIhbijwvM5A9e7rS4P88EA1k/uGS/C4tvY65verhKAuetMWGLeic3efLYaimAcYBJK6 X-Gm-Message-State: AOJu0YyqtqNsb4REdq6KM3pW4YuGjiPgVPAiwCRq8EdTvYZLlhkB4xGz l+bWBXF9CBEr94cMoKhZ/Nntt30ib9gFhMIGmcTz7tvRi8lZirpWPdKZN6B1i/g= X-Received: by 2002:a05:6a00:2e91:b0:6ec:ebe0:e4ba with SMTP id fd17-20020a056a002e9100b006ecebe0e4bamr1023158pfb.9.1714424391806; Mon, 29 Apr 2024 13:59:51 -0700 (PDT) Received: from localhost ([192.184.165.199]) by smtp.gmail.com with ESMTPSA id fj40-20020a056a003a2800b006f3021367desm13045927pfb.197.2024.04.29.13.59.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 13:59:51 -0700 (PDT) Date: Mon, 29 Apr 2024 13:59:51 -0700 (PDT) X-Google-Original-Date: Mon, 29 Apr 2024 13:59:47 PDT (-0700) Subject: Re: [PATCH] cpuidle: riscv-sbi: Add cluster_pm_enter()/exit() In-Reply-To: CC: nick.hu@sifive.com, anup@brainfault.org, rafael@kernel.org, daniel.lezcano@linaro.org, Paul Walmsley , linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, zong.li@sifive.com From: Palmer Dabbelt To: ulf.hansson@linaro.org Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On Mon, 29 Apr 2024 07:32:12 PDT (-0700), ulf.hansson@linaro.org wrote: > On Mon, 26 Feb 2024 at 07:51, Nick Hu wrote: >> >> When the cpus in the same cluster are all in the idle state, the kernel >> might put the cluster into a deeper low power state. Call the >> cluster_pm_enter() before entering the low power state and call the >> cluster_pm_exit() after the cluster woken up. >> >> Signed-off-by: Nick Hu > > I was not cced this patch, but noticed that this patch got queued up > recently. Sorry for not noticing earlier. > > If not too late, can you please drop/revert it? We should really move > away from the CPU cluster notifiers. See more information below. Sorry about that, I'll toss it. I'm testing some other stuff right now so it might miss today's linux-next. >> --- >> drivers/cpuidle/cpuidle-riscv-sbi.c | 24 ++++++++++++++++++++++-- >> 1 file changed, 22 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/cpuidle/cpuidle-riscv-sbi.c b/drivers/cpuidle/cpuidle-riscv-sbi.c >> index e8094fc92491..298dc76a00cf 100644 >> --- a/drivers/cpuidle/cpuidle-riscv-sbi.c >> +++ b/drivers/cpuidle/cpuidle-riscv-sbi.c >> @@ -394,6 +394,7 @@ static int sbi_cpuidle_pd_power_off(struct generic_pm_domain *pd) >> { >> struct genpd_power_state *state = &pd->states[pd->state_idx]; >> u32 *pd_state; >> + int ret; >> >> if (!state->data) >> return 0; >> @@ -401,6 +402,10 @@ static int sbi_cpuidle_pd_power_off(struct generic_pm_domain *pd) >> if (!sbi_cpuidle_pd_allow_domain_state) >> return -EBUSY; >> >> + ret = cpu_cluster_pm_enter(); >> + if (ret) >> + return ret; > > Rather than using the CPU cluster notifiers, consumers of the genpd > can register themselves to receive genpd on/off notifiers. > > In other words, none of this should be needed, right? > > [...] > > Kind regards > Uffe