Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16FE9C61DA4 for ; Fri, 24 Feb 2023 01:33:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229797AbjBXBdo convert rfc822-to-8bit (ORCPT ); Thu, 23 Feb 2023 20:33:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbjBXBdm (ORCPT ); Thu, 23 Feb 2023 20:33:42 -0500 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B42F7298C6 for ; Thu, 23 Feb 2023 17:33:29 -0800 (PST) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id 2A76B24E24E; Fri, 24 Feb 2023 09:33:17 +0800 (CST) Received: from EXMBX168.cuchost.com (172.16.6.78) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 24 Feb 2023 09:33:17 +0800 Received: from EXMBX066.cuchost.com (172.16.7.66) by EXMBX168.cuchost.com (172.16.6.78) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 24 Feb 2023 09:33:16 +0800 Received: from EXMBX066.cuchost.com ([fe80::5947:9245:907e:339f]) by EXMBX066.cuchost.com ([fe80::5947:9245:907e:339f%17]) with mapi id 15.00.1497.044; Fri, 24 Feb 2023 09:33:16 +0800 From: JeeHeng Sia To: Andrew Jones CC: "paul.walmsley@sifive.com" , "palmer@dabbelt.com" , "aou@eecs.berkeley.edu" , "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Leyfoon Tan , Mason Huo , Conor Dooley Subject: RE: [PATCH v4 1/4] RISC-V: Change suspend_save_csrs and suspend_restore_csrs to public function Thread-Topic: [PATCH v4 1/4] RISC-V: Change suspend_save_csrs and suspend_restore_csrs to public function Thread-Index: AQHZRZ0s27ZIes8WRE6urFHZP2L6bK7bkdoAgAHCyCA= Date: Fri, 24 Feb 2023 01:33:16 +0000 Message-ID: References: <20230221023523.1498500-1-jeeheng.sia@starfivetech.com> <20230221023523.1498500-2-jeeheng.sia@starfivetech.com> <20230223063936.6tsqh57lom3tvjxo@orel> In-Reply-To: <20230223063936.6tsqh57lom3tvjxo@orel> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [60.50.196.81] x-yovoleruleagent: yovoleflag Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Andrew Jones > Sent: Thursday, 23 February, 2023 2:40 PM > To: JeeHeng Sia > Cc: paul.walmsley@sifive.com; palmer@dabbelt.com; aou@eecs.berkeley.edu; linux-riscv@lists.infradead.org; linux- > kernel@vger.kernel.org; Leyfoon Tan ; Mason Huo ; Conor Dooley > > 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 > > Reviewed-by: Ley Foon Tan > > Reviewed-by: Mason Huo > > Reviewed-by: Conor Dooley > > --- > > 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 > > #include > > > > -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 Noted with thanks > > Thanks, > drew