mbox series

[RFC,0/1] riscv: Introduce system suspend support

Message ID 20230106113216.443057-1-ajones@ventanamicro.com (mailing list archive)
Headers show
Series riscv: Introduce system suspend support | expand

Message

Andrew Jones Jan. 6, 2023, 11:32 a.m. UTC
Booting with an OpenSBI including the RFC series[1] implementing the
draft proposal for SBI system suspend[2] we can add system support to
Linux. This support implements "suspend-to-RAM", which means when a
kernel is built with CONFIG_SUSPEND 'echo mem > /sys/power/state' will
initiate a suspension.

This has only been tested on QEMU using the OpenSBI system suspend
test. The test just waits 5 seconds and then resumes. To truly use
system suspend a platform must have a low-level firmware implementation
and provide at least one wake-up event, such as from a wakeup-capable
RTC alarm, to resume.

[1] https://github.com/jones-drew/opensbi/commits/susp-rfc
    Posting: http://lists.infradead.org/pipermail/opensbi/2023-January/004091.html
[2] https://github.com/jones-drew/riscv-sbi-doc/commit/d9e43e9a938fc3eb510e023c3f352462876f7785
    Posting: https://lists.riscv.org/g/tech-prs/message/75

This patch is also available at
https://github.com/jones-drew/linux/commits/riscv/sbi-susp-rfc

Andrew Jones (1):
  riscv: sbi: Introduce system suspend support

 arch/riscv/Kconfig           |  5 ++++-
 arch/riscv/include/asm/sbi.h |  9 ++++++++
 arch/riscv/kernel/suspend.c  | 41 ++++++++++++++++++++++++++++++++++++
 3 files changed, 54 insertions(+), 1 deletion(-)

Comments

Conor Dooley Jan. 17, 2023, 10:34 p.m. UTC | #1
Hey Drew!

On Fri, Jan 06, 2023 at 12:32:15PM +0100, Andrew Jones wrote:
> Booting with an OpenSBI including the RFC series[1] implementing the
> draft proposal for SBI system suspend[2] we can add system support to
> Linux. This support implements "suspend-to-RAM", which means when a
> kernel is built with CONFIG_SUSPEND 'echo mem > /sys/power/state' will
> initiate a suspension.
> 
> This has only been tested on QEMU using the OpenSBI system suspend
> test. The test just waits 5 seconds and then resumes. To truly use
> system suspend a platform must have a low-level firmware implementation
> and provide at least one wake-up event, such as from a wakeup-capable
> RTC alarm, to resume.
> 
> [1] https://github.com/jones-drew/opensbi/commits/susp-rfc
>     Posting: http://lists.infradead.org/pipermail/opensbi/2023-January/004091.html
> [2] https://github.com/jones-drew/riscv-sbi-doc/commit/d9e43e9a938fc3eb510e023c3f352462876f7785

In case you don't get alerts from GH, I left one *tiny* comment on this.
And I really mean tiny!

Thanks,
Conor.
Andrew Jones Jan. 18, 2023, 11:55 a.m. UTC | #2
On Tue, Jan 17, 2023 at 10:34:59PM +0000, Conor Dooley wrote:
> Hey Drew!
> 
> On Fri, Jan 06, 2023 at 12:32:15PM +0100, Andrew Jones wrote:
> > Booting with an OpenSBI including the RFC series[1] implementing the
> > draft proposal for SBI system suspend[2] we can add system support to
> > Linux. This support implements "suspend-to-RAM", which means when a
> > kernel is built with CONFIG_SUSPEND 'echo mem > /sys/power/state' will
> > initiate a suspension.
> > 
> > This has only been tested on QEMU using the OpenSBI system suspend
> > test. The test just waits 5 seconds and then resumes. To truly use
> > system suspend a platform must have a low-level firmware implementation
> > and provide at least one wake-up event, such as from a wakeup-capable
> > RTC alarm, to resume.
> > 
> > [1] https://github.com/jones-drew/opensbi/commits/susp-rfc
> >     Posting: http://lists.infradead.org/pipermail/opensbi/2023-January/004091.html
> > [2] https://github.com/jones-drew/riscv-sbi-doc/commit/d9e43e9a938fc3eb510e023c3f352462876f7785
> 
> In case you don't get alerts from GH, I left one *tiny* comment on this.
> And I really mean tiny!

Hi Conor,

Yup, I saw the comma suggestion and agree with it. As there are two other
instances of that error description in the spec I'll also send a PR to add
commas to them as well.

Thanks,
drew