[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e2a0b59ebe464d79af30a16bd1075f3d@EXMBX066.cuchost.com>
Date: Fri, 24 Feb 2023 01:33:16 +0000
From: JeeHeng Sia <jeeheng.sia@...rfivetech.com>
To: Andrew Jones <ajones@...tanamicro.com>
CC: "paul.walmsley@...ive.com" <paul.walmsley@...ive.com>,
"palmer@...belt.com" <palmer@...belt.com>,
"aou@...s.berkeley.edu" <aou@...s.berkeley.edu>,
"linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Leyfoon Tan <leyfoon.tan@...rfivetech.com>,
Mason Huo <mason.huo@...rfivetech.com>,
Conor Dooley <conor.dooley@...rochip.com>
Subject: RE: [PATCH v4 1/4] RISC-V: Change suspend_save_csrs and
suspend_restore_csrs to public function
> -----Original Message-----
> From: Andrew Jones <ajones@...tanamicro.com>
> Sent: Thursday, 23 February, 2023 2:40 PM
> To: JeeHeng Sia <jeeheng.sia@...rfivetech.com>
> Cc: paul.walmsley@...ive.com; palmer@...belt.com; aou@...s.berkeley.edu; linux-riscv@...ts.infradead.org; linux-
> kernel@...r.kernel.org; Leyfoon Tan <leyfoon.tan@...rfivetech.com>; Mason Huo <mason.huo@...rfivetech.com>; Conor Dooley
> <conor.dooley@...rochip.com>
> Subject: Re: [PATCH v4 1/4] RISC-V: Change suspend_save_csrs and suspend_restore_csrs to public function
>
> On Tue, Feb 21, 2023 at 10:35:20AM +0800, Sia Jee Heng wrote:
> > Currently suspend_save_csrs() and suspend_restore_csrs() functions are
> > statically defined in the suspend.c. Change the function's attribute
> > to public so that the functions can be used by hibernation as well.
> >
> > Signed-off-by: Sia Jee Heng <jeeheng.sia@...rfivetech.com>
> > Reviewed-by: Ley Foon Tan <leyfoon.tan@...rfivetech.com>
> > Reviewed-by: Mason Huo <mason.huo@...rfivetech.com>
> > Reviewed-by: Conor Dooley <conor.dooley@...rochip.com>
> > ---
> > arch/riscv/include/asm/suspend.h | 3 +++
> > arch/riscv/kernel/suspend.c | 4 ++--
> > 2 files changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/riscv/include/asm/suspend.h b/arch/riscv/include/asm/suspend.h
> > index 8be391c2aecb..75419c5ca272 100644
> > --- a/arch/riscv/include/asm/suspend.h
> > +++ b/arch/riscv/include/asm/suspend.h
> > @@ -33,4 +33,7 @@ int cpu_suspend(unsigned long arg,
> > /* Low-level CPU resume entry function */
> > int __cpu_resume_enter(unsigned long hartid, unsigned long context);
> >
> > +/* Used to save and restore the csr */
>
> s/the csr/CSRs/
>
> > +void suspend_save_csrs(struct suspend_context *context);
> > +void suspend_restore_csrs(struct suspend_context *context);
> > #endif
> > diff --git a/arch/riscv/kernel/suspend.c b/arch/riscv/kernel/suspend.c
> > index 9ba24fb8cc93..3c89b8ec69c4 100644
> > --- a/arch/riscv/kernel/suspend.c
> > +++ b/arch/riscv/kernel/suspend.c
> > @@ -8,7 +8,7 @@
> > #include <asm/csr.h>
> > #include <asm/suspend.h>
> >
> > -static void suspend_save_csrs(struct suspend_context *context)
> > +void suspend_save_csrs(struct suspend_context *context)
> > {
> > context->scratch = csr_read(CSR_SCRATCH);
> > context->tvec = csr_read(CSR_TVEC);
> > @@ -29,7 +29,7 @@ static void suspend_save_csrs(struct suspend_context *context)
> > #endif
> > }
> >
> > -static void suspend_restore_csrs(struct suspend_context *context)
> > +void suspend_restore_csrs(struct suspend_context *context)
> > {
> > csr_write(CSR_SCRATCH, context->scratch);
> > csr_write(CSR_TVEC, context->tvec);
> > --
> > 2.34.1
> >
>
> Otherwise,
>
> Reviewed-by: Andrew Jones <ajones@...tanamicro.com>
Noted with thanks
>
> Thanks,
> drew
Powered by blists - more mailing lists