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 0704CC05027 for ; Wed, 8 Feb 2023 04:44:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230373AbjBHEoG (ORCPT ); Tue, 7 Feb 2023 23:44:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjBHEoD (ORCPT ); Tue, 7 Feb 2023 23:44:03 -0500 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B153C19F2E for ; Tue, 7 Feb 2023 20:43:58 -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 3493924E2D1; Wed, 8 Feb 2023 12:43:45 +0800 (CST) Received: from EXMBX064.cuchost.com (172.16.6.64) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 8 Feb 2023 12:43:45 +0800 Received: from EXMBX066.cuchost.com (172.16.7.66) by EXMBX064.cuchost.com (172.16.6.64) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 8 Feb 2023 12:43:44 +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; Wed, 8 Feb 2023 12:43:44 +0800 From: JeeHeng Sia To: Alexandre Ghiti , "paul.walmsley@sifive.com" , "palmer@dabbelt.com" , "aou@eecs.berkeley.edu" CC: "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Leyfoon Tan , Mason Huo Subject: RE: [PATCH v3 4/4] RISC-V: Add arch functions to support hibernation/suspend-to-disk Thread-Topic: [PATCH v3 4/4] RISC-V: Add arch functions to support hibernation/suspend-to-disk Thread-Index: AQHZMi9ZN0+4F1UUIkevO0NjoPA2067DLC2AgAFYUNA= Date: Wed, 8 Feb 2023 04:43:44 +0000 Message-ID: References: <20230127091051.1465278-1-jeeheng.sia@starfivetech.com> <20230127091051.1465278-5-jeeheng.sia@starfivetech.com> In-Reply-To: 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: [202.188.176.82] x-yovoleruleagent: yovoleflag Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogQWxleGFuZHJlIEdoaXRp IDxhbGV4QGdoaXRpLmZyPg0KPiBTZW50OiBUdWVzZGF5LCA3IEZlYnJ1YXJ5LCAyMDIzIDExOjQ2 IFBNDQo+IFRvOiBKZWVIZW5nIFNpYSA8amVlaGVuZy5zaWFAc3RhcmZpdmV0ZWNoLmNvbT47IHBh dWwud2FsbXNsZXlAc2lmaXZlLmNvbTsgcGFsbWVyQGRhYmJlbHQuY29tOyBhb3VAZWVjcy5iZXJr ZWxleS5lZHUNCj4gQ2M6IGxpbnV4LXJpc2N2QGxpc3RzLmluZnJhZGVhZC5vcmc7IGxpbnV4LWtl cm5lbEB2Z2VyLmtlcm5lbC5vcmc7IExleWZvb24gVGFuIDxsZXlmb29uLnRhbkBzdGFyZml2ZXRl Y2guY29tPjsgTWFzb24gSHVvDQo+IDxtYXNvbi5odW9Ac3RhcmZpdmV0ZWNoLmNvbT4NCj4gU3Vi amVjdDogUmU6IFtQ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