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 7810AC6FA8E for ; Mon, 27 Feb 2023 03:11:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229794AbjB0DLv (ORCPT ); Sun, 26 Feb 2023 22:11:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229641AbjB0DLt (ORCPT ); Sun, 26 Feb 2023 22:11:49 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EF12D300 for ; Sun, 26 Feb 2023 19:11:44 -0800 (PST) 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 3C0A524E398; Mon, 27 Feb 2023 11:11:43 +0800 (CST) Received: from EXMBX061.cuchost.com (172.16.6.61) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 27 Feb 2023 11:11:43 +0800 Received: from EXMBX066.cuchost.com (172.16.7.66) by EXMBX061.cuchost.com (172.16.6.61) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 27 Feb 2023 11:11:42 +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; Mon, 27 Feb 2023 11:11:42 +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 v4 4/4] RISC-V: Add arch functions to support hibernation/suspend-to-disk Thread-Topic: [PATCH v4 4/4] RISC-V: Add arch functions to support hibernation/suspend-to-disk Thread-Index: AQHZRZ0zqkG7/pRhhEiAX6gFjug0Aa7dheoAgASUe8A= Date: Mon, 27 Feb 2023 03:11:42 +0000 Message-ID: <74bf1f43091345fcb59119d4d53e20bb@EXMBX066.cuchost.com> References: <20230221023523.1498500-1-jeeheng.sia@starfivetech.com> <20230221023523.1498500-5-jeeheng.sia@starfivetech.com> <4119a2dd-e598-ec22-0872-e352898fa660@ghiti.fr> In-Reply-To: <4119a2dd-e598-ec22-0872-e352898fa660@ghiti.fr> 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 IDxhbGV4QGdoaXRpLmZyPg0KPiBTZW50OiBGcmlkYXksIDI0IEZlYnJ1YXJ5LCAyMDIzIDg6Mjkg UE0NCj4gVG86IEplZUhlbmcgU2lhIDxqZWVoZW5nLnNpYUBzdGFyZml2ZXRlY2guY29tPjsgcGF1 bC53YWxtc2xleUBzaWZpdmUuY29tOyBwYWxtZXJAZGFiYmVsdC5jb207IGFvdUBlZWNzLmJlcmtl bGV5LmVkdQ0KPiBDYzogbGludXgtcmlzY3ZAbGlzdHMuaW5mcmFkZWFkLm9yZzsgbGludXgta2Vy bmVsQHZnZXIua2VybmVsLm9yZzsgTGV5Zm9vbiBUYW4gPGxleWZvb24ud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