Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7085910rwl; Wed, 22 Mar 2023 21:57:24 -0700 (PDT) X-Google-Smtp-Source: AK7set/uBasvYip+0Z0vXLZRsu2qFQA08ssJV7NSzNs+gHI2VQvo+SFNyD7EZ0+ArVKlu1rsqCm+ X-Received: by 2002:a17:906:5815:b0:932:9303:76b9 with SMTP id m21-20020a170906581500b00932930376b9mr8468738ejq.26.1679547443831; Wed, 22 Mar 2023 21:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679547443; cv=none; d=google.com; s=arc-20160816; b=fBChIAYrwn1dLj6Bj63ZbsnNquR893rchl+qXPgsiYrHgSW1xnt0xBTe1B+x1U4GBH 6HK3/zjv08ryugu/ytuRqdISuNb5vwZQVQkH/ORZL72x3Gv5yvXLoRTolERtf5xoPpBt mBngKBef4BK5q7XTkYppArLZUr2jvMbUqfNIdmxaZKyyLzu1xIuxvPOgW1xKX0KngzFz 4ODPc/ua68bPQeAcsF+caGCxBdMoWzMWv9oMYRgp/QoDmrCyaevNcUbYdPRydFdcWcJp Wz3I7wu9nScb0pUsodQz7qTXC6m4EjQHVszL65LlTIDJjVrmizBNaEE9GHJ8YXYUeglx dRmQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=LIPynq+UD7yHVtIBIKyHq3JZd0fLe2fsIGuBVVeQuuo=; b=Ls3+7mdMzIuHs4QnubGKLmVUSNpQZirLb1Tt6HPQ/K0zpnb8CbUA9axnve8EyFbkIl 7KJvmh0w/n6+KeswXhDJWBxpYyG7PoKyuGVXZGJw2PCxSfGc/C5n4tL6DXLb18yywMIQ r2TIw6NglAQ9KH6ncGVTgggfPlEl8i4VopEZfLwmYq8JInHOiqli9RD1lgHQUg9NIGqL Xn3Sas2RXngZhp8Y80eLF9FDRt6hnS7ADnuaIrAX42VcDlLUdSShtvv/uNDKCkLdLKzg YcNC9F8YSoWPXsKHj+Dav+8caF8wwZgPoO4TgjeuzqJs4uGxrWGmnQyR867VxQ34xU1o kULg== 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 jz24-20020a17090775f800b008d518d4bf7dsi16071517ejc.562.2023.03.22.21.57.00; Wed, 22 Mar 2023 21:57:23 -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 S229839AbjCWE4Y convert rfc822-to-8bit (ORCPT + 99 others); Thu, 23 Mar 2023 00:56:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbjCWE4W (ORCPT ); Thu, 23 Mar 2023 00:56:22 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02D172A162 for ; Wed, 22 Mar 2023 21:56:18 -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 ex01.ufhost.com (Postfix) with ESMTP id B573D24E1DB; Thu, 23 Mar 2023 12:56:16 +0800 (CST) Received: from EXMBX066.cuchost.com (172.16.7.66) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 23 Mar 2023 12:56:16 +0800 Received: from jsia-virtual-machine.localdomain (202.188.176.82) by EXMBX066.cuchost.com (172.16.6.66) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 23 Mar 2023 12:56:13 +0800 From: Sia Jee Heng To: , , CC: , , , , , Conor Dooley , Andrew Jones Subject: [PATCH v7 1/4] RISC-V: Change suspend_save_csrs and suspend_restore_csrs to public function Date: Thu, 23 Mar 2023 12:56:01 +0800 Message-ID: <20230323045604.536099-2-jeeheng.sia@starfivetech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230323045604.536099-1-jeeheng.sia@starfivetech.com> References: <20230323045604.536099-1-jeeheng.sia@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [202.188.176.82] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX066.cuchost.com (172.16.6.66) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 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 Reviewed-by: Andrew Jones --- 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..67e047445662 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 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