From mboxrd@z Thu Jan 1 00:00:00 1970 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 7D95CC77B7A for ; Fri, 19 May 2023 11:14:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231258AbjESLOi convert rfc822-to-8bit (ORCPT ); Fri, 19 May 2023 07:14:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbjESLOf (ORCPT ); Fri, 19 May 2023 07:14:35 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50BB019F for ; Fri, 19 May 2023 04:14:29 -0700 (PDT) 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 fd01.gateway.ufhost.com (Postfix) with ESMTP id F0AC97FFB; Fri, 19 May 2023 19:14:27 +0800 (CST) Received: from EXMBX065.cuchost.com (172.16.6.65) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 19 May 2023 19:14:27 +0800 Received: from EXMBX066.cuchost.com (172.16.7.66) by EXMBX065.cuchost.com (172.16.6.65) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 19 May 2023 19:14:27 +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, 19 May 2023 19:14:27 +0800 From: JeeHeng Sia To: Song Shuai , "paul.walmsley@sifive.com" , "palmer@dabbelt.com" , "aou@eecs.berkeley.edu" , Mason Huo , Leyfoon Tan , "ajones@ventanamicro.com" CC: "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Song Shuai Subject: RE: [PATCH] riscv: hibernation: Remove duplicate call of suspend_restore_csrs Thread-Topic: [PATCH] riscv: hibernation: Remove duplicate call of suspend_restore_csrs Thread-Index: AQHZij0JnSRR82RN7UivChxgOm4HvK9hcVtQ Date: Fri, 19 May 2023 11:14:27 +0000 Message-ID: <9a274a44b61345e8aba747a44250c4d8@EXMBX066.cuchost.com> References: <20230519102908.253458-1-suagrfillet@gmail.com> In-Reply-To: <20230519102908.253458-1-suagrfillet@gmail.com> 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: [172.16.6.8] 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 looks good to me. Thanks Regards Jee Heng > -----Original Message----- > From: Song Shuai > Sent: Friday, May 19, 2023 6:29 PM > To: paul.walmsley@sifive.com; palmer@dabbelt.com; aou@eecs.berkeley.edu; suagrfillet@gmail.com; Mason Huo > ; Leyfoon Tan ; ajones@ventanamicro.com; JeeHeng Sia > > Cc: linux-riscv@lists.infradead.org; linux-kernel@vger.kernel.org; Song Shuai > Subject: [PATCH] riscv: hibernation: Remove duplicate call of suspend_restore_csrs > > The suspend_restore_csrs is called in both __hibernate_cpu_resume > and the `else` of subsequent swsusp_arch_suspend. > > Removing the first call makes both suspend_{save,restore}_csrs > left in swsusp_arch_suspend for clean code. > > Signed-off-by: Song Shuai > Signed-off-by: Song Shuai > --- > arch/riscv/kernel/hibernate-asm.S | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/arch/riscv/kernel/hibernate-asm.S b/arch/riscv/kernel/hibernate-asm.S > index 5c76671c7e15..d698dd7df637 100644 > --- a/arch/riscv/kernel/hibernate-asm.S > +++ b/arch/riscv/kernel/hibernate-asm.S > @@ -28,7 +28,6 @@ ENTRY(__hibernate_cpu_resume) > > REG_L a0, hibernate_cpu_context > > - suspend_restore_csrs > suspend_restore_regs Good catch. This function is invoked twice to restore the CSRs. I am good with removing this function from here. > > /* Return zero value. */ > -- > 2.20.1