All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC v2 PATCH 0/1] riscv: Introduce system suspend support
@ 2023-01-18 18:03 Andrew Jones
  2023-01-18 18:03 ` [RFC v2 PATCH 1/1] riscv: sbi: " Andrew Jones
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Jones @ 2023-01-18 18:03 UTC (permalink / raw)
  To: linux-riscv
  Cc: 'Ley Foon Tan ', 'Palmer Dabbelt ',
	'Sia Jee Heng ', 'Paul Walmsley ',
	'Albert Ou ', 'Anup Patel '

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-v1
    Posting: http://lists.infradead.org/pipermail/opensbi/2023-January/004260.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

Note, this is a v2 of an RFC because I'm leaving the patch in RFC
state until the spec is approved.

RFC-v2:
  - RISCV_SBI dependency [Conor]
  - Rename SBI_EXT_SUSP_SUSPEND to SBI_EXT_SUSP_SYSTEM_SUSPEND and
    SBI_SUSP_SLEEP_TYPE_SUSPEND to SBI_SUSP_SLEEP_TYPE_SUSPEND_TO_RAM [Ley Foon]

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  | 43 ++++++++++++++++++++++++++++++++++++
 3 files changed, 56 insertions(+), 1 deletion(-)

-- 
2.39.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-28 17:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-18 18:03 [RFC v2 PATCH 0/1] riscv: Introduce system suspend support Andrew Jones
2023-01-18 18:03 ` [RFC v2 PATCH 1/1] riscv: sbi: " Andrew Jones
2023-02-28 15:54   ` Palmer Dabbelt
2023-02-28 16:48     ` Conor Dooley
2023-02-28 17:05     ` Andrew Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.