Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1655748iob; Sat, 14 May 2022 16:09:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxH36vTAm9uSTJXlgEY5F+3HlTDqyuxYWA3WiwGd6bhbfBQj3Hr5aBp66ecH0LMpwfatQ32 X-Received: by 2002:a5d:64a5:0:b0:20c:599d:6b29 with SMTP id m5-20020a5d64a5000000b0020c599d6b29mr9300095wrp.642.1652569790413; Sat, 14 May 2022 16:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652569790; cv=none; d=google.com; s=arc-20160816; b=UsSykH/QXtr+ANp+KdRlBrWIjLsfM6Dnu5/sLb2hV3xUhen+AxxPAMEb08D+2CcHpo z6yEnifB/J9jr4P5ASw8MR0IfMOJC0H6WsJj3M3t87/JPZOoIkxFsxoFv0xh6/y5+asB 6p8bH1qyqXn1uZruuHJre9IZZFTa/02klRjFeQQLIY4W3pBwXlvONGsUdaKKuFVVcCPy 6Q/1MWjbFYl967tIH8ILstU6g6OybdVGl10p/+C+0NWvklefv5uayA8HKg16YDDBo4XX 0ClYnoXhSCdjZuof+NzTMpr7JY0/lFFZKjfWDnlyB02w5theKnxGXwojCYdfLY0iB3Re Rlcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=n/mgIjRvvJPY19sTVzBgUbBKV/toAZXWOr19sK94Ueg=; b=uLyX2yC72phuwbYno+ZAsLryws8laoz1/L9Z7vTCT14bSCGlSx08iYEhxUjylpK/// TQZhm7INyzmqwvohkvTPzf7krjUC4jo+bB7V36zqckFYEB1p+n/XOXPR3qhe7ajYOzCO rng5Y2GddceRLzj/yyrt0yZTZC97gGj2k2GzV1cP/8SUi7iYrHcllPWdbQWrDBoiSQ3M 0mtdy8ENK8tk/CapD5Pdkr3/9g9ofS6sc9VU6RL5yq5/YZ8fJA3lvcpW1FpBVvPfg3+D khKhmTBbjVKQBGn/MrNB6P1fUUNiQyrFJ2DHZF6NNI8VyV5Ds7QetfWx4DLytW+YIgJ+ +hRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=FnLI62td; 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 v3-20020a05600c428300b00394351ae8b3si8204524wmc.207.2022.05.14.16.09.23; Sat, 14 May 2022 16:09:50 -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=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=FnLI62td; 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 S234352AbiENQrm (ORCPT + 99 others); Sat, 14 May 2022 12:47:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234358AbiENQrg (ORCPT ); Sat, 14 May 2022 12:47:36 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 781923193B for ; Sat, 14 May 2022 09:47:34 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id i5so15062133wrc.13 for ; Sat, 14 May 2022 09:47:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=n/mgIjRvvJPY19sTVzBgUbBKV/toAZXWOr19sK94Ueg=; b=FnLI62tda7G4LUCDCeToyihFzqCLwmokw+LF+XC/D2mcefciSGP2A24Igxnhkkhahc vRvtv5rMVO2/vot6MWLs7i+BA9EuNCGusNNxfsWkF5D2sDrvpcnkRgDaLq+nVeIIhGNN LscT7xk/lrUsi0/oGm6JQpcsNHpPzodIUkHRGPUVcsidAuObpjxwwF0yzekrXG7igOgg BDmhv4snk6f0ykJPqElje/EJsyubnaGWxri4UaWNnz3oMQnmM1qWE1WRsoi3cR7XRCSy Pg2ICmtFYTpGLHnE9/elllsWYTHKc+63SC41gUBrvWrNGsVnE87liAaIl/3wKnsgQkzE jLYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=n/mgIjRvvJPY19sTVzBgUbBKV/toAZXWOr19sK94Ueg=; b=p/iJMrG7wnvb6NuiPftCkov7PrUu0+yMa88l7wo2FyeOIfmBWHgAloe5YL0Ho4cvJB my/yrecM2/elnbl/4tRKQSRuWrPcGRnONCAiQKHLLEgVQkwMzzMpLKGRnKj1C+IFs2vQ xDj0f7YmpccHX1TYdEj+Y/JzKLdoJeBgBeNFPacdvy0T1jWoeCNhc3PUfpRvCyN+UsMs bQXFWkmxG1sIuDiv4ZhxWu90VIPHoEZY8wNnqyYp77d5KpvXCKcgRFWz7+/E7sU4de0m 1KNTfpzN6V0gPpKVYM5KMBGFckyPtZQeXx2Jwv9Zzc6yY/4UAWJ0CDA9QB0kLaNy3nNt XRjg== X-Gm-Message-State: AOAM531/qO+4koGHVJ3nvA92gdBhdIKYzTvnCs5mQThTktm2d04vJ+zM GoTpX8xRblzQ7hQ4b03ii9H/2qvqWMcqMeqz91PAtOC0Tj+26WfU X-Received: by 2002:a5d:6483:0:b0:20c:5c21:5c8c with SMTP id o3-20020a5d6483000000b0020c5c215c8cmr8122994wri.86.1652546852805; Sat, 14 May 2022 09:47:32 -0700 (PDT) MIME-Version: 1.0 References: <20220514152044.758802-1-ulf.hansson@linaro.org> In-Reply-To: <20220514152044.758802-1-ulf.hansson@linaro.org> From: Anup Patel Date: Sat, 14 May 2022 22:17:20 +0530 Message-ID: Subject: Re: [PATCH 2/2] cpuidle: riscv-sbi: Fix code to allow a genpd governor to be used To: Ulf Hansson Cc: "Rafael J . Wysocki" , "open list:THERMAL" , Sudeep Holla , Lorenzo Pieralisi , Maulik Shah , Daniel Lezcano , Paul Walmsley , Palmer Dabbelt , Albert Ou , Atish Patra , linux-arm-kernel , linux-riscv , "linux-kernel@vger.kernel.org List" Content-Type: text/plain; charset="UTF-8" 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_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Sat, May 14, 2022 at 8:50 PM Ulf Hansson wrote: > > The intent is to use a genpd governor when there are some states that needs > to be managed. Although, the current code ends up to never assign a > governor, let's fix this. > > Fixes: 6abf32f1d9c50 ("cpuidle: Add RISC-V SBI CPU idle driver") > Signed-off-by: Ulf Hansson Looks good to me. I have tested this on QEMU RISC-V as well. Reviewed-by: Anup Patel Tested-by: Anup Patel Thanks, Anup > --- > drivers/cpuidle/cpuidle-riscv-sbi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/cpuidle/cpuidle-riscv-sbi.c b/drivers/cpuidle/cpuidle-riscv-sbi.c > index b459eda2cd37..478970fa3b0c 100644 > --- a/drivers/cpuidle/cpuidle-riscv-sbi.c > +++ b/drivers/cpuidle/cpuidle-riscv-sbi.c > @@ -413,7 +413,7 @@ static int sbi_pd_init(struct device_node *np) > struct generic_pm_domain *pd; > struct sbi_pd_provider *pd_provider; > struct dev_power_governor *pd_gov; > - int ret = -ENOMEM, state_count = 0; > + int ret = -ENOMEM; > > pd = dt_idle_pd_alloc(np, sbi_dt_parse_state_node); > if (!pd) > @@ -432,7 +432,7 @@ static int sbi_pd_init(struct device_node *np) > pd->flags |= GENPD_FLAG_ALWAYS_ON; > > /* Use governor for CPU PM domains if it has some states to manage. */ > - pd_gov = state_count > 0 ? &pm_domain_cpu_gov : NULL; > + pd_gov = pd->states ? &pm_domain_cpu_gov : NULL; > > ret = pm_genpd_init(pd, pd_gov, false); > if (ret) > -- > 2.25.1 >