Message ID | 20230519102908.253458-1-suagrfillet@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1130489vqo; Fri, 19 May 2023 03:35:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4twaHA/qdgam9zJS85BmscPfLhK4/xn//3ACR02SzR+o7Uu7ApylfhJ/FVySVeug765q6q X-Received: by 2002:a05:6a20:7215:b0:d9:250:665c with SMTP id y21-20020a056a20721500b000d90250665cmr1345875pzb.15.1684492532379; Fri, 19 May 2023 03:35:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684492532; cv=none; d=google.com; s=arc-20160816; b=ORpfwn+6hNb7G6hityyVqFNkJCKVmMg3kfQLH6s6liED3c/O7Ph0E+dy3KOAf8Gslh Qnmk+tzOg7bsQtYGJABQlUUKUmzlucfHydFH3w9i6yckicLE89MWJ1TN6CyV4xxnE1Nb bxQi4G4UB+kjlVEbxrmBRexE9fY9R1DfaO9Ou3McDJr+EhL4+3QqK7/45Xyui/ofXKBZ pUrztsUOQ6t/drtUJtxjo2eHwXuBNoDuhx+ocfJfeW2NqH4fzcEH7c8ZI/VKpMbnUPQL 4R4LaJryiZd0ghZTjTBT1A92mG0IkY6yZTxAa5GY+gqkDhlBXtyzAXRvCOFolxGkyO6d XTzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=dyCts+3MIamz/ZP/Th1oUrcgbH11s2oWCUMvcOwKW/c=; b=jPZkipRpzJNZ84aRkBitKFuMrWgaPghQj9vm6nuV6bFK7XN1aA6VyDLXTE37DjuoLR HOpYCZBdqsn4/3WMAFYUfdUqHYVktOPxZPd6vgnyI4+68UXgGiTzpknOY88ntfhW4qeP 7EvP0pCGYg90Hnkn9MHaEcy5meN0YMaIuvbjUcnl6jADnOtKzohsx2y+AsLKmQbJ0ldu 2oZUszO0MwR2KxBGKbbEjzROijVJ6/QIjdM66Md44CRlAUBLi9HIwaPUHYks/ZvmhHym I+/vvh224iYJScqqkCuEvRS2puvf49RPNBkTixpsJZJJXzWjDOM0hqVB1xkyxlO8co6l wpNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=QwQQ1jJW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q18-20020a638c52000000b00517a4a75528si3546005pgn.162.2023.05.19.03.35.19; Fri, 19 May 2023 03:35:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=QwQQ1jJW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231864AbjESK3l (ORCPT <rfc822;wlfightup@gmail.com> + 99 others); Fri, 19 May 2023 06:29:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231635AbjESK3j (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 19 May 2023 06:29:39 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08962E6E for <linux-kernel@vger.kernel.org>; Fri, 19 May 2023 03:29:16 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1a516fb6523so29353425ad.3 for <linux-kernel@vger.kernel.org>; Fri, 19 May 2023 03:29:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684492156; x=1687084156; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=dyCts+3MIamz/ZP/Th1oUrcgbH11s2oWCUMvcOwKW/c=; b=QwQQ1jJWLOQbljg6TCUXa5q9qgSjdve6OeoE561RDnhWjdKSN8Ga4m81FubQ9mtfC7 iPCKNMdZNbrLBp0aYOQ3WyKkrYI8Rksn8fKcwFdXF+46wQYH/mB1rxMeHXeo+PyXJ1/O 8l5l25MIW2Kg198SOnoYzl6NQcdfRqrHAUglrIUPPTB0GfWfh+zH3FzG1cE+133HABWJ W5XMihnrXeQEkPbQtdELGmA5Sm0LHRMqN8osScTjCYITHfWrr45XfAsS7IuQ5vmPT/FQ krpPDhSJ8yhIvvidzzMDrc4am9qi3WZygZMG1TC0uncBnRDIwwCps2co07joA0pXRcCS vKzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684492156; x=1687084156; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dyCts+3MIamz/ZP/Th1oUrcgbH11s2oWCUMvcOwKW/c=; b=U7QSbfskgdttNoPoaO3j86Hq21rOk7bCUMQcMGzBW4SrpMI/dLtXpr1mnEegdI7HEY qtJxfbLtN7eVFWHwLypj8AmaAH6/rwJWXTqoM7FctCfplif7Q2b9mriMKujsorG1ipZK PYAME486bkc7SoZo1tT2MnOWVrYAeIE5pcOVSRHgLZx9iDxmolvyX9AUYUa4lm5+vr90 3fqvZ/PqZ8XV0Co8dLFUPSf2yjcA0bkHnlcDx4RQRoJN0+wNUbHVNLTGVix59tyNFJSx NTgaVomyWFhDrBTJ+q9HV81HWJH7z4A+QBkWB13tA7JIb98bEENndReqK6nS4BabQVm9 xnXA== X-Gm-Message-State: AC+VfDyxSsVuAMhOuwEuQoLMvupvGitXhXo4JSdg+3tSTHmha8RvcqPx i4SQWCESkL81oBvkZ2OFKaI= X-Received: by 2002:a17:903:1112:b0:1a6:8ed5:428a with SMTP id n18-20020a170903111200b001a68ed5428amr2918121plh.22.1684492156382; Fri, 19 May 2023 03:29:16 -0700 (PDT) Received: from localhost.localdomain ([221.226.144.218]) by smtp.gmail.com with ESMTPSA id x4-20020a170902ea8400b001aaffe15f39sm3102770plb.30.2023.05.19.03.29.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 03:29:16 -0700 (PDT) From: Song Shuai <suagrfillet@gmail.com> To: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, suagrfillet@gmail.com, mason.huo@starfivetech.com, leyfoon.tan@starfivetech.com, ajones@ventanamicro.com, jeeheng.sia@starfivetech.com Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Song Shuai <songshuaishuai@tinylab.org> Subject: [PATCH] riscv: hibernation: Remove duplicate call of suspend_restore_csrs Date: Fri, 19 May 2023 18:29:08 +0800 Message-Id: <20230519102908.253458-1-suagrfillet@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766318441564092944?= X-GMAIL-MSGID: =?utf-8?q?1766318441564092944?= |
Series |
riscv: hibernation: Remove duplicate call of suspend_restore_csrs
|
|
Commit Message
Song Shuai
May 19, 2023, 10:29 a.m. UTC
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 <suagrfillet@gmail.com> Signed-off-by: Song Shuai <songshuaishuai@tinylab.org> --- arch/riscv/kernel/hibernate-asm.S | 1 - 1 file changed, 1 deletion(-)
Comments
looks good to me. Thanks Regards Jee Heng > -----Original Message----- > From: Song Shuai <suagrfillet@gmail.com> > 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 > <mason.huo@starfivetech.com>; Leyfoon Tan <leyfoon.tan@starfivetech.com>; ajones@ventanamicro.com; JeeHeng Sia > <jeeheng.sia@starfivetech.com> > Cc: linux-riscv@lists.infradead.org; linux-kernel@vger.kernel.org; Song Shuai <songshuaishuai@tinylab.org> > 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 <suagrfillet@gmail.com> > Signed-off-by: Song Shuai <songshuaishuai@tinylab.org> > --- > 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
Hey, On Fri, May 19, 2023 at 11:14:27AM +0000, JeeHeng Sia wrote: > > 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 <suagrfillet@gmail.com> > > Signed-off-by: Song Shuai <songshuaishuai@tinylab.org> BTW, why the two email addresses? The tinylab one here seems entirely redundant - unless it is your employer, in which case should it be the only SoB address & also in the author field? Also, Fixes tag? > > --- > > 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. If that's a review, then please either give an R-b or A-b tag :) Thanks, Conor.
On Fri, May 19, 2023 at 12:28:07PM +0100, Conor Dooley wrote: > Hey, > > On Fri, May 19, 2023 at 11:14:27AM +0000, JeeHeng Sia wrote: > > > > 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. It took me embarrassingly long to wrap my head around the control flow here again. I'm not sure that I agree with you that splitting the calls between asm & c is cleaner, but whatever: Reviewed-by: Conor Dooley <conor.dooley@microchip.com> > > > > > > Signed-off-by: Song Shuai <suagrfillet@gmail.com> > > > Signed-off-by: Song Shuai <songshuaishuai@tinylab.org> > > BTW, why the two email addresses? The tinylab one here seems entirely > redundant - unless it is your employer, in which case should it be the > only SoB address & also in the author field? Deja vu with my questioning your email address, but does your tinylab address actually repeat "shuai"? > Also, Fixes tag? > > > > --- > > > 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. > > If that's a review, then please either give an R-b or A-b tag :) > > Thanks, > Conor.
> -----Original Message----- > From: Conor Dooley <conor@kernel.org> > Sent: Saturday, May 20, 2023 4:07 AM > To: Conor Dooley <conor.dooley@microchip.com> > Cc: JeeHeng Sia <jeeheng.sia@starfivetech.com>; Song Shuai <suagrfillet@gmail.com>; paul.walmsley@sifive.com; > palmer@dabbelt.com; aou@eecs.berkeley.edu; Mason Huo <mason.huo@starfivetech.com>; Leyfoon Tan > <leyfoon.tan@starfivetech.com>; ajones@ventanamicro.com; linux-riscv@lists.infradead.org; linux-kernel@vger.kernel.org; Song > Shuai <songshuaishuai@tinylab.org> > Subject: Re: [PATCH] riscv: hibernation: Remove duplicate call of suspend_restore_csrs > > On Fri, May 19, 2023 at 12:28:07PM +0100, Conor Dooley wrote: > > Hey, > > > > On Fri, May 19, 2023 at 11:14:27AM +0000, JeeHeng Sia wrote: > > > > > > 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. > > It took me embarrassingly long to wrap my head around the control flow > here again. I'm not sure that I agree with you that splitting the calls > between asm & c is cleaner, but whatever: > Reviewed-by: Conor Dooley <conor.dooley@microchip.com> > > > > > > > > > Signed-off-by: Song Shuai <suagrfillet@gmail.com> > > > > Signed-off-by: Song Shuai <songshuaishuai@tinylab.org> > > > > BTW, why the two email addresses? The tinylab one here seems entirely > > redundant - unless it is your employer, in which case should it be the > > only SoB address & also in the author field? > > Deja vu with my questioning your email address, but does your > tinylab address actually repeat "shuai"? > > > Also, Fixes tag? > > > > > > --- > > > > 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. > > > > If that's a review, then please either give an R-b or A-b tag :) Reviewed-by: JeeHeng Sia <jeeheng.sia@starfivetech.com > > > > > Thanks, > > Conor. >
Conor Dooley <conor@kernel.org> 于2023年5月19日周五 20:07写道: > > On Fri, May 19, 2023 at 12:28:07PM +0100, Conor Dooley wrote: > > Hey, > > > > On Fri, May 19, 2023 at 11:14:27AM +0000, JeeHeng Sia wrote: > > > > > > 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. > > It took me embarrassingly long to wrap my head around the control flow > here again. I'm not sure that I agree with you that splitting the calls > between asm & c is cleaner, but whatever: > Reviewed-by: Conor Dooley <conor.dooley@microchip.com> > > > > > > > > > Signed-off-by: Song Shuai <suagrfillet@gmail.com> > > > > Signed-off-by: Song Shuai <songshuaishuai@tinylab.org> > > > > BTW, why the two email addresses? The tinylab one here seems entirely > > redundant - unless it is your employer, in which case should it be the > > only SoB address & also in the author field? > > Deja vu with my questioning your email address, but does your > tinylab address actually repeat "shuai"? > Yes, that's my full name. As you noticed, I'm switching my email from Gmail to Tinylab but did something wrong. Thanks for your correction, I'll re-send this patch with your suggestions applied. > > Also, Fixes tag? > > > > > > --- > > > > 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. > > > > If that's a review, then please either give an R-b or A-b tag :) > > > > Thanks, > > Conor. > >
Hello: This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <palmer@rivosinc.com>: On Fri, 19 May 2023 18:29:08 +0800 you wrote: > 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 <suagrfillet@gmail.com> > Signed-off-by: Song Shuai <songshuaishuai@tinylab.org> > > [...] Here is the summary with links: - riscv: hibernation: Remove duplicate call of suspend_restore_csrs https://git.kernel.org/riscv/c/c6399b893043 You are awesome, thank you!
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 /* Return zero value. */