Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5280666rwb; Mon, 21 Nov 2022 20:05:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf5aodpQvXAQplA3EoTjYGoDfdEYusT/dwqiR4L2+jcOiZlIFlnSjP/gELKEImTXNn7K2J89 X-Received: by 2002:a05:6402:1f85:b0:462:2410:9720 with SMTP id c5-20020a0564021f8500b0046224109720mr19229205edc.84.1669089950588; Mon, 21 Nov 2022 20:05:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669089950; cv=none; d=google.com; s=arc-20160816; b=cb9p/0ZDZNod5vwmuMmHsZMOWxE9+MlnFeFxp79kIFnbBnqRbX5309Hfsk8UjECp51 78N55dbeG+WRkWX0QYJknhpMjkEDujqwnfdW4Onxm8hKqNCBQm7lTtOn2vzpwDBopOLB KI8Chmsu4Z7EzLZ4r1kjIK+gkLOhQx42UFpLzIo21Bdi7yxwmwN4X9q9m6eVW3bUGzFw JaNjvtcuVILaHYxYkfpg12V3XtJ6HNgTFrhUyb+uGHVaK9sbsEizJbW054AGWsfW9vtG lpdYMUHmlEwTRv4uCbx3+avPQbzMU3sDr8rQahQZw9G/k6kqD/3A3XIaa6CCfg1BG8GV Ukeg== 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=QR536p2gGCkxha4o6fxwGlER6MG9ufp5pleM3jEqWQk=; b=AEbg/ycBlvaGIMkoaPDXcRXb/uxFw+wm/18wVOhknoPFweVBKxd3PIVwjeNHd0Od4M OL+dxj9qi/IFvD+37g9Y2xEOwqsUYO3fl/nECTJQwEU8e4M25xx+p6YsdeeuHJ4/dz6K 7wn6ZxIq81h+SG2QCEU6JXSyZ7xFwpUdGMVnci0kfEtGWgR3qXfEPfMKlqwhYaNblh+8 BJPGtx2lCLFg62mQVAWpx7e0DuQsfSsrrVHIchauLs4LX6tzTRcEf5oKJ/6/UTQsat+j 17O/fr+6f9P06pxjYwaG3Rbttal2lc26Vr7jCWQm7FAQWB8nSV2pE8uQF7uhRC1GHQiY wV5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=b3ExBeff; 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 ck9-20020a170906c44900b0078dcc87b1c4si9167935ejb.923.2022.11.21.20.05.22; Mon, 21 Nov 2022 20:05:50 -0800 (PST) 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=b3ExBeff; 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 S232225AbiKVDpX (ORCPT + 91 others); Mon, 21 Nov 2022 22:45:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232229AbiKVDpV (ORCPT ); Mon, 21 Nov 2022 22:45:21 -0500 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDBBA27DD4 for ; Mon, 21 Nov 2022 19:45:20 -0800 (PST) Received: by mail-ed1-x533.google.com with SMTP id f7so18925704edc.6 for ; Mon, 21 Nov 2022 19:45:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QR536p2gGCkxha4o6fxwGlER6MG9ufp5pleM3jEqWQk=; b=b3ExBeffr1D3+LEQamxGefmMUYbjmpT3u6jRUjrkL/C+PLfrKZBl6TWNYnN/DQGDbB nhSZ07fjBLunlkqbBhIHMAmuiqKUO3Blptvy1LDhu2XfyJt7sgi4BysOcjh2ZNho81qL Fx7aUCmd+BAQ1euG8yOB7ggsYOgJAir87382ZIeFHFHPGw6L+dVubrxli3rWU7qQzDpF mBouFsjyC1LLhMSMeiMqBWT9Z0zlgwFMePqn1FQj/AEWmNPACDB6JfixFA0/gkKV5aRU EvLFK3YhQHQHl5QMAH5hQUvZc/JJSgB9f3M4LKUhZZPmxeHrSZAquHcBUcqaeCmXStyt VF8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QR536p2gGCkxha4o6fxwGlER6MG9ufp5pleM3jEqWQk=; b=XkUVNjb3YlK+mVx+c2oehF8xwilDeGFcdlL99HVTYdGqQkZqgk9vEhC8opI4JFvizI 4TzfaYhTN1K1jyWJJDVp6xFB5woU0FCrL1DWUxY7ux9wUVrZhhBTi0v/Hxyx7431GWQG 8juj4fjJ4ZTviZE3ZcIUUV5I24DPsgoTLhaCSiVikkKmzU7lk4rvM+HWdZDcOqU+Y5Gq /TaVdn1CPB5qZbsaBDb5kh5qWfebA96K3JpZauQ/W4XPf5DC+qJgXcinXAE2erIgpcYt wVZ3OKKJ2BLd2CHSD48wuY/2YlWVQvIqwMzDbdEDZx/hjFJVG/mkLahRo0u60UZ6Dzxn ODJw== X-Gm-Message-State: ANoB5pk2Ornnh+QwVDgyHybB2oaWZ1VDllMoA9aQe4dgq5/xGh1hbN2/ +WBEqVz4Ol5Rx2WpHS7RwHAvzj1VNZxWamOVaNEisg== X-Received: by 2002:a05:6402:399a:b0:468:fdf2:477f with SMTP id fk26-20020a056402399a00b00468fdf2477fmr16691217edb.329.1669088719273; Mon, 21 Nov 2022 19:45:19 -0800 (PST) MIME-Version: 1.0 References: <20221121205647.23343-1-palmer@rivosinc.com> In-Reply-To: <20221121205647.23343-1-palmer@rivosinc.com> From: Anup Patel Date: Tue, 22 Nov 2022 09:15:07 +0530 Message-ID: Subject: Re: [PATCH] cpuidle: riscv-sbi: Stop using non-retentive suspend To: Palmer Dabbelt Cc: Conor Dooley , rafael@kernel.org, daniel.lezcano@linaro.org, Paul Walmsley , Palmer Dabbelt , aou@eecs.berkeley.edu, linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux@rivosinc.com 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 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 Tue, Nov 22, 2022 at 2:27 AM Palmer Dabbelt wrote: > > From: Palmer Dabbelt > > As per [1], whether or not the core can wake up from non-retentive > suspend is a platform-specific detail. We don't have any way to encode > that, so just stop using them until we've sorted that out. > > Link: https://github.com/riscv-non-isa/riscv-sbi-doc/issues/98#issuecomment-1288564687 > Fixes: 6abf32f1d9c5 ("cpuidle: Add RISC-V SBI CPU idle driver") > Signed-off-by: Palmer Dabbelt This is just unnecessary maintenance churn and it's not the right way to go. Better to fix this the right way instead of having a temporary fix. I had already sent-out a patch series 5 months back to describe this in DT: https://lore.kernel.org/lkml/20220727114302.302201-1-apatel@ventanamicro.com/ No one has commented/suggested anything (except Samuel Holland and Sudeep Holla). Please review this series. I can quickly address comments to make this available for Linux-6.2. Until this series is merged, the affected platforms can simply remove non-retentive suspend states from their DT. With all due respect, NACK to this patch from my side. Regards, Anup > > --- > > This should allow us to revert 232ccac1bd9b ("clocksource/drivers/riscv: > Events are stopped during CPU suspend"), which fixes suspend on the D1 > but breaks timers everywhere. > --- > drivers/cpuidle/cpuidle-riscv-sbi.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/cpuidle/cpuidle-riscv-sbi.c b/drivers/cpuidle/cpuidle-riscv-sbi.c > index 05fe2902df9a..9d1063a54495 100644 > --- a/drivers/cpuidle/cpuidle-riscv-sbi.c > +++ b/drivers/cpuidle/cpuidle-riscv-sbi.c > @@ -214,6 +214,17 @@ static bool sbi_suspend_state_is_valid(u32 state) > if (state > SBI_HSM_SUSPEND_NON_RET_DEFAULT && > state < SBI_HSM_SUSPEND_NON_RET_PLATFORM) > return false; > + > + /* > + * Whether or not RISC-V systems deliver interrupts to harts in a > + * non-retentive suspend state is a platform-specific detail. This can > + * leave the hart unable to wake up, so just mark these states as > + * unsupported until we have a mechanism to expose these > + * platform-specific details to Linux. > + */ > + if (state & SBI_HSM_SUSP_NON_RET_BIT) > + return false; > + > return true; > } > > -- > 2.38.1 >