Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2351444rwd; Fri, 19 May 2023 04:45:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ46dLh7tcKmyhSjA2WLk6vRwWkwdtN5aJcZp7P/l3w9pg3/95Y0vdRWXy5n9schZ2OpZgXO X-Received: by 2002:a05:6a00:188e:b0:64d:3227:b800 with SMTP id x14-20020a056a00188e00b0064d3227b800mr2997523pfh.16.1684496744489; Fri, 19 May 2023 04:45:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684496744; cv=none; d=google.com; s=arc-20160816; b=LU6zOafqYQxNxtYLW/visgIphFq5uoiU5f+X9bLmx2WiwKKLw63p3TpckxqDaZ4t/P tyFyV5nVNclQLuhVObQVYOkmmEuUoguQSDbipgc7eCZn3x4JfggbdnFksIhbgy/bWuPe GXmpyc+EsHsZOT6NffwGvoXczsIqv67UJg9mviQ2Q9NrA8qf7h4C3I6TpoXnjxA+BxSx Z6H0OxxfJhjuo8cPyUS6Dkyc7FLfBrJGnC5BEJkP3a5hJqRWQ3fn06Gxy/tTDyU6UD/l Wt/NolIl/rB1prH5ysMvubEI4BMBM2rkWXDG6f8kYgZl79naDeFepaQrgX3KwT6tPWsx i6Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=kgR46NSFmor2o4Dp9djpt1Mh+GnGR559hGbIc9j5vkg=; b=rgjuj7t7DWi8WarQu14vwzjWb++yQsZg1MS3dy5AvVZfZQbNNIK0feDAstQqUmMmsG KSXVcTvynIB7V0blEoDI56SFzwu2W+a38d/A0neElUKAqIObBcw6sKC/Qk9eq+aYINgd vu+MRMzCSVAcOb2+4DyDrIln9THw+pzgiGuXVUuAu3pKdsKNgoYrs4h0gYUEdqDyZnJM n4eSw/ZL0BLRPY2LuCA5q/6I4EKYmR45ZfyIbAQFk6iadVOhmitr1VacUEfCtGhSo8ua t2UgXEmhyUCl3H+4FpBKsLs5hu7R9SHKPPTfZpDUL+nCkFj8F469A0pfVSmjyFq3Gx/0 UlWA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d2-20020a637342000000b0050bea5bf413si3773345pgn.705.2023.05.19.04.45.28; Fri, 19 May 2023 04:45:44 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230527AbjESLOh convert rfc822-to-8bit (ORCPT + 99 others); Fri, 19 May 2023 07:14:37 -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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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: 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