From: Pavel Machek <pavel@ucw.cz>
To: Sia Jee Heng <jeeheng.sia@starfivetech.com>
Cc: paul.walmsley@sifive.com, palmer@dabbelt.com,
aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org, leyfoon.tan@starfivetech.com,
mason.huo@starfivetech.com
Subject: Re: [PATCH 3/3] RISC-V: Add arch functions to support hibernation/suspend-to-disk
Date: Sat, 18 Feb 2023 15:01:03 +0100 [thread overview]
Message-ID: <Y/DaH0vjMsln4Ghr@duo.ucw.cz> (raw)
In-Reply-To: <20230106060535.104321-4-jeeheng.sia@starfivetech.com>
[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]
Hi!
> @@ -21,6 +21,11 @@ struct suspend_context {
> #endif
> };
>
> +/* This parameter will be assigned to 0 during resume and will be used by
> + * hibernation core for the subsequent resume sequence
> + */
> +extern int in_suspend;
"/*" should be on separate line. (This occurs multiple times.)
> +ENTRY(core_restore_code)
> + /* switch to temp page table */
> + csrw satp, s1
> + sfence.vma
> + beqz s4, done
> +loop:
> + /* The below code will restore the hibernated image. */
> + ld a1, HIBERN_PBE_ADDR(s4)
> + ld a0, HIBERN_PBE_ORIG(s4)
> +
> + lui a4, 0x1
> + add a4, a4, a0
Do you have enough registers to move a4 = 0x1 assignment before the
loop:?
> +static int __init riscv_hibernate__init(void)
> +{
> + hibernate_cpu_context = kcalloc(1, sizeof(struct suspend_context), GFP_KERNEL);
> +
kzalloc?
> + if (WARN_ON(!hibernate_cpu_context))
> + return -ENOMEM;
> +
> + return 0;
> +}
> +
> +early_initcall(riscv_hibernate__init);
Does this really need to be done early?
Best regards,
Pavel
--
People of Russia, stop Putin before his war on Ukraine escalates.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2023-02-18 14:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-06 6:05 [PATCH 0/3] RISC-V Hibernation Support Sia Jee Heng
2023-01-06 6:05 ` [PATCH 1/3] RISC-V: Change suspend_save_csrs and suspend_restore_csrs to public function Sia Jee Heng
2023-01-06 6:05 ` [PATCH 2/3] RISC-V: mm: Enable huge page support to kernel_page_present() function Sia Jee Heng
2023-01-06 13:21 ` kernel test robot
2023-01-06 14:01 ` kernel test robot
2023-01-06 6:05 ` [PATCH 3/3] RISC-V: Add arch functions to support hibernation/suspend-to-disk Sia Jee Heng
2023-01-06 9:18 ` kernel test robot
2023-02-18 14:01 ` Pavel Machek [this message]
2023-02-20 4:21 ` JeeHeng Sia
2023-02-21 3:16 ` JeeHeng Sia
2023-01-06 9:37 ` [PATCH 0/3] RISC-V Hibernation Support Conor Dooley
2023-01-07 9:10 ` JeeHeng Sia
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=Y/DaH0vjMsln4Ghr@duo.ucw.cz \
--to=pavel@ucw.cz \
--cc=aou@eecs.berkeley.edu \
--cc=jeeheng.sia@starfivetech.com \
--cc=leyfoon.tan@starfivetech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mason.huo@starfivetech.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
/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
all inboxes | Powered by JetHome®