Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5770647rwl; Sun, 8 Jan 2023 22:33:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXtk6+EohrWl77wzgWKphFmrI2U6yP4rPUXicuCJcU6ue3U+n1mbvLt45Rqc9wm00Zguz5F9 X-Received: by 2002:a17:907:cb84:b0:836:e8a6:f6f5 with SMTP id un4-20020a170907cb8400b00836e8a6f6f5mr55957025ejc.66.1673246002814; Sun, 08 Jan 2023 22:33:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673246002; cv=none; d=google.com; s=arc-20160816; b=DhFyfjt10MTUaoORTzTw+8yBRaknlXj2WW4TX0Ux+ff0TZjUWuREtSQ8aK2WMkC2IR uuhUSk04nLk/ScTluzfz4XwXV/o/kfX8JvJsbbAtCYqWq1i9+WTBq2AdYNluqDaoU3BA PqwKmp3hvvPUWVm9hGfc92bNMOj2Lf1XMmNeFdcjpAVa9XXeOHQVfEOMMKOLG8u5Yhfb LG9AWdyT1T1oHnOd2+U8UiMUZWji1qgY55jrwDxJuGb7IzlezbIvjPP2AP3i4af4rae2 qVeTgCutCBunfQEngAuJCT3/zG0b/qo8U81ua8PqD44fEO2j5RFs1o7Alx/2QyZ/W7uG 6D2w== 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=8tD6XVBYIrdB1rXsVbv3PFTqO12NGsVNAj1/vrSNP78=; b=n/xJeu+DhfTWKGvEpFu/pW8nzA6c2qXXKQ9zQBjiAS82veZeUtz6EpMpOTFFvHjh4v lD18fWLV+HDebXR8eVy5vJL2ph9+cw5fO8q2sHxfxEYIUN8CN2pCGjP5shTp1wF/BwKB fB5T/FFGDZAeSRTygYXYoOOjHw4/mgdbjBMpLeY+f1M/mbKo7pK4f2WgvYRcD1LJvUXT 8IEYoczkeyx1WPqza0G8NS+o5aU0FKD5ENe1txzbUsb6+/xeKogk7OnGij499d7fdSbW 3ggdIT/o1GkZ613beMmQsogGXApT+nIRtlnOxRO+yBOMIWowm5L6PN74p2OwcqGrXHZL 6s+A== 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 ss2-20020a170907c00200b007c1600359d9si7354173ejc.451.2023.01.08.22.33.08; Sun, 08 Jan 2023 22:33:22 -0800 (PST) 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 S234023AbjAIGYw convert rfc822-to-8bit (ORCPT + 55 others); Mon, 9 Jan 2023 01:24:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230491AbjAIGYY (ORCPT ); Mon, 9 Jan 2023 01:24:24 -0500 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86077BE14 for ; Sun, 8 Jan 2023 22:24:23 -0800 (PST) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id 048C724E1E8; Mon, 9 Jan 2023 14:24:21 +0800 (CST) Received: from EXMBX066.cuchost.com (172.16.7.66) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 9 Jan 2023 14:24:21 +0800 Received: from jsia-virtual-machine.localdomain (60.49.128.133) by EXMBX066.cuchost.com (172.16.6.66) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 9 Jan 2023 14:24:17 +0800 From: Sia Jee Heng To: , , CC: , , , , Subject: [PATCH v2 1/3] RISC-V: Change suspend_save_csrs and suspend_restore_csrs to public function Date: Mon, 9 Jan 2023 14:24:05 +0800 Message-ID: <20230109062407.3235-2-jeeheng.sia@starfivetech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230109062407.3235-1-jeeheng.sia@starfivetech.com> References: <20230109062407.3235-1-jeeheng.sia@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [60.49.128.133] 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=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 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 --- 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 */ +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