From: Conor Dooley <conor@kernel.org>
To: Palmer Dabbelt <palmer@rivosinc.com>
Cc: anup@brainfault.org, rafael@kernel.org,
daniel.lezcano@linaro.org,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
aou@eecs.berkeley.edu, linux-pm@vger.kernel.org,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
linux@rivosinc.com
Subject: Re: [PATCH] cpuidle: riscv-sbi: Stop using non-retentive suspend
Date: Mon, 21 Nov 2022 21:10:39 +0000 [thread overview]
Message-ID: <Y3vpT2XoylY4i2kx@spud> (raw)
In-Reply-To: <20221121205647.23343-1-palmer@rivosinc.com>
On Mon, Nov 21, 2022 at 12:56:47PM -0800, Palmer Dabbelt wrote:
> From: Palmer Dabbelt <palmer@rivosinc.com>
>
> 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.
For anyone playing along at home, Anup had a proposal for encoding this
information (yoinked from the GH issue below):
https://lore.kernel.org/all/20220727114302.302201-1-apatel@ventanamicro.com/>
> 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 <palmer@rivosinc.com>
>
> ---
>
> 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.
FWIW the revert is at:
https://lore.kernel.org/linux-riscv/20221023185444.678573-1-conor@kernel.org/
Commit message is probably a little lacking as I didn't understand the
problem when I wrote it. I'll respin the revert with a tidier message
tomorrow.
Acked-by: Conor Dooley <conor.dooley@microchip.com>
> ---
> 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
>
next prev parent reply other threads:[~2022-11-21 21:10 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-21 20:56 [PATCH] cpuidle: riscv-sbi: Stop using non-retentive suspend Palmer Dabbelt
2022-11-21 21:10 ` Conor Dooley [this message]
2022-11-22 0:45 ` Samuel Holland
2022-11-22 11:06 ` Conor Dooley
2022-11-23 3:42 ` Samuel Holland
2022-11-23 10:46 ` Conor Dooley
2022-11-22 3:45 ` Anup Patel
2022-11-22 5:16 ` Palmer Dabbelt
2022-11-22 5:36 ` Anup Patel
2022-11-22 11:19 ` Conor Dooley
2022-11-22 15:28 ` Palmer Dabbelt
2022-11-23 4:38 ` Anup Patel
2022-11-23 5:11 ` Samuel Holland
2022-11-23 5:35 ` Anup Patel
2022-11-23 5:38 ` Samuel Holland
2022-11-23 6:10 ` Anup Patel
2022-11-23 6:27 ` Samuel Holland
2022-11-23 6:41 ` Anup Patel
2022-11-23 6:49 ` Samuel Holland
2022-11-23 7:13 ` Anup Patel
2022-11-23 10:20 ` Sudeep Holla
2022-11-23 4:26 ` Anup Patel
2022-11-23 10:09 ` Conor Dooley
2022-11-23 10:36 ` Anup Patel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y3vpT2XoylY4i2kx@spud \
--to=conor@kernel.org \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux@rivosinc.com \
--cc=palmer@dabbelt.com \
--cc=palmer@rivosinc.com \
--cc=paul.walmsley@sifive.com \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox