Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1105867rwb; Thu, 22 Sep 2022 10:09:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM51m+yYCf+36OnooVOqZSTcQSiqw3xr3v9/JHPHS7vAAJM6KsZy7Q+DxaziEROmGuqBhbFM X-Received: by 2002:a05:6402:26d4:b0:451:280d:3533 with SMTP id x20-20020a05640226d400b00451280d3533mr4360962edd.316.1663866565633; Thu, 22 Sep 2022 10:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663866565; cv=none; d=google.com; s=arc-20160816; b=jWZ9qnmjF9gwy+MTh/ruJs/fd92sH3euBGHJEncAgGBL2W9cS6NHmWAVLrJJwDN8MY 0dD2pt3/O2w6KHOVgIVSiL/svms8XwR4EctUSUEYlulpn121WcLc5q9PupoZ9lefcz7e wNUL5emf3SYkB7fd21ZQ1ywSPXatvqAvHZ9v0L8GijJocwx7uK8ErjbZ0mKCv440Kv4Q PC1X+11qgHZDo16pEYccPcodlAmY1jokyPx3SyDoIBhgeT7lcz7JBOClJxjf1ahhJ+1A Am87UWS56J4ZPnCYRrGgdRy+BCeD90wEF9tjiMVkMyhIPdN2taniqkEHNSL5rTZCjNGw iv0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=YGdLhOJeWnP3ca9LNB+W2QEKOPugBX7rmEhz4mGpjas=; b=tv355Ne+YZT+HbZIxiQXC1RVlOyYdsgl7YeClR0TMk4WLwR8e5edYMemfXozNwjY74 nkQaOkbgA2XZFL8e7XHhCC6j/8s2rLBBtWNugMDOZIMC4ayUpBlcyy2sRtqlVl712dNH A4wsh9oC3AeAGlkqMoMBt0KPuZoZiQeoPRqMbNLWMUHpJGhDZsM7zp4ziwyneJJN65IU 5mA8sARHB8zdfBddNzgpn0G3jLTOq0Ld6P2Chj8TS7807MzxbaGS4tpg12tahj66MyZ2 c9mros77FgLNEvLFupi8JeAMvWG51ujSbS1ywJClD8eTyr8QungjuJc1XbeF73fpmPL5 RfXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=wv+VgBM0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s21-20020a50d495000000b0045184540cfbsi6067109edi.72.2022.09.22.10.08.57; Thu, 22 Sep 2022 10:09:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@dabbelt-com.20210112.gappssmtp.com header.s=20210112 header.b=wv+VgBM0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229862AbiIVRHu (ORCPT + 99 others); Thu, 22 Sep 2022 13:07:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229701AbiIVRHs (ORCPT ); Thu, 22 Sep 2022 13:07:48 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47E5DF08BF for ; Thu, 22 Sep 2022 10:07:47 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id b21so9369588plz.7 for ; Thu, 22 Sep 2022 10:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date; bh=YGdLhOJeWnP3ca9LNB+W2QEKOPugBX7rmEhz4mGpjas=; b=wv+VgBM0Yf/zCrrpBZZ8BFKRdVmmrSTsOdXwyIoqGil5AW+Z+ijHmB/EpcHkJ2aYOF +KO8jsO6OL3nvjyTnNTQFnR0T0WNO3GgCf5XRM862nncqkCCfHX/BsPmH6D8BFH0OOsv BRYhjkNxamT6msLfsf+XasyvAGORtTe06Yb9QYNxZRI8h8jSrqZ72R9zI2dUBOIl2EVW pvemQLSPDqB1RUfooyJYrXckcyjkOYoPqW/bzKVroI4Clj97gecc/OSd/5X6RS+gUp5O eISz85U69O4HBzXhcgM47g1gbaYZm4sqtlOmVk+xCNqNAHe6fQYw7/DENLxVM3wfkN1J FbzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=YGdLhOJeWnP3ca9LNB+W2QEKOPugBX7rmEhz4mGpjas=; b=c9XMG2IcQofI7U4F00iww9OjCSj7vh+/g9Dul5FDSiRS4Ml6iOFUCpOgDjvwy9t3Ea CV6GCGnTpbaYcJE87uADihKlooOY7qEspm/0hc+2b9CFIsXq5yRKQJObE9qk/CPQ3Um8 yn3k27n6xH/JRRTou8n6y4Vm3X1LnErrkBTbf6hy8inFFPyhFG+hrVJ1xmb90u/+Wb8n nUCChMgi7x9wfFwGnV/rDuYFwM3w6ta2NQ6J2JaUB7laagn3k87XvHY//MqBt1OJerLP a7x9Yu/Yq6/GJgm7WJm6BMrA60LsXzVjPlXWa5y+GGjb+fQZT4hQrSO5BM9Eo+3P4ViD 43sw== X-Gm-Message-State: ACrzQf0pO2dV638D9xfhuwZHyXKz/Eljad3ydPw0iieM2oTLVnY5Pm7I XnMB+mD0pQqyXxxOzP0hYZVS9A== X-Received: by 2002:a17:90a:2b0c:b0:203:b7b1:2ba2 with SMTP id x12-20020a17090a2b0c00b00203b7b12ba2mr4806032pjc.34.1663866466643; Thu, 22 Sep 2022 10:07:46 -0700 (PDT) Received: from localhost (pop.92-184-98-183.mobile.abo.orange.fr. [92.184.98.183]) by smtp.gmail.com with ESMTPSA id p63-20020a625b42000000b0053e80618a23sm4699299pfb.34.2022.09.22.10.07.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 10:07:46 -0700 (PDT) Date: Thu, 22 Sep 2022 10:07:46 -0700 (PDT) X-Google-Original-Date: Thu, 22 Sep 2022 10:07:28 PDT (-0700) Subject: Re: [PATCH] cpuidle: riscv-sbi: Fix CPU_PM_CPU_IDLE_ENTER_xyz() macro usage In-Reply-To: CC: rafael@kernel.org, daniel.lezcano@linaro.org, Paul Walmsley , ulf.hansson@linaro.org, atishp@atishpatra.org, Alistair Francis , linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, apatel@ventanamicro.com From: Palmer Dabbelt To: anup@brainfault.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 28 Aug 2022 19:59:45 PDT (-0700), anup@brainfault.org wrote: > Hi Palmer, > > On Mon, Jul 18, 2022 at 2:16 PM Anup Patel wrote: >> >> Currently, we are using CPU_PM_CPU_IDLE_ENTER_PARAM() for all SBI HSM >> suspend types so retentive suspend types are also treated non-retentive >> and kernel will do redundant additional work for these states. >> >> The BIT[31] of SBI HSM suspend types allows us to differentiate between >> retentive and non-retentive suspend types so we should use this BIT >> to call appropriate CPU_PM_CPU_IDLE_ENTER_xyz() macro. >> >> Fixes: 6abf32f1d9c5 ("cpuidle: Add RISC-V SBI CPU idle driver") >> Signed-off-by: Anup Patel > > Can you please take this patch through the RISC-V tree ? Sorry I missed this, I didn't realize you wanted me to merge it. It's on fixes. > > Regards, > Anup > >> --- >> drivers/cpuidle/cpuidle-riscv-sbi.c | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/cpuidle/cpuidle-riscv-sbi.c b/drivers/cpuidle/cpuidle-riscv-sbi.c >> index 1151e5e2ba82..33c92fec4365 100644 >> --- a/drivers/cpuidle/cpuidle-riscv-sbi.c >> +++ b/drivers/cpuidle/cpuidle-riscv-sbi.c >> @@ -97,8 +97,13 @@ static int sbi_cpuidle_enter_state(struct cpuidle_device *dev, >> struct cpuidle_driver *drv, int idx) >> { >> u32 *states = __this_cpu_read(sbi_cpuidle_data.states); >> + u32 state = states[idx]; >> >> - return CPU_PM_CPU_IDLE_ENTER_PARAM(sbi_suspend, idx, states[idx]); >> + if (state & SBI_HSM_SUSP_NON_RET_BIT) >> + return CPU_PM_CPU_IDLE_ENTER_PARAM(sbi_suspend, idx, state); >> + else >> + return CPU_PM_CPU_IDLE_ENTER_RETENTION_PARAM(sbi_suspend, >> + idx, state); >> } >> >> static int __sbi_enter_domain_idle_state(struct cpuidle_device *dev, >> -- >> 2.34.1 >>