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 B5107C433FE for ; Wed, 8 Dec 2021 02:42:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239551AbhLHCqU (ORCPT ); Tue, 7 Dec 2021 21:46:20 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:44402 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S233825AbhLHCqS (ORCPT ); Tue, 7 Dec 2021 21:46:18 -0500 X-UUID: 47673cb92a834b3582ee9b1b27660b6f-20211208 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=4JAxauduVQ8yA1sTjjPd8IjqzkeB2Li6o0fP33s9P3Q=; b=SOxo7LLXXjX9l6dCzZpK+gNdLBkX5cxmNd05ygg4Hq0Za2vgH3pak/7Hk3OJ7NK9FJgkmj/9CELmgwxVle2/wJHNV5LGoI0Z1zw3V2QCA65L5irbwiWByeZo2Z7d2C53wO7vlUPjqr04Xu2FnlESfIyrzydnOlcciij7+zd+170=; X-UUID: 47673cb92a834b3582ee9b1b27660b6f-20211208 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1820108748; Wed, 08 Dec 2021 10:42:43 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.3; Wed, 8 Dec 2021 10:42:42 +0800 Received: from mhfsdcap04 (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 8 Dec 2021 10:42:41 +0800 Message-ID: <581d847ede5ce917762e2c5734e23dcd693fef32.camel@mediatek.com> Subject: Re: [PATCH 3/4] memory: mtk-smi: Add sleep ctrl function From: Yong Wu To: AngeloGioacchino Del Regno , Krzysztof Kozlowski CC: Krzysztof Kozlowski , Joerg Roedel , Will Deacon , Robin Murphy , "Tomasz Figa" , , , , , , , , , , , , Rob Herring , "Matthias Brugger" Date: Wed, 8 Dec 2021 10:42:36 +0800 In-Reply-To: <85ef182a-8ebe-7dbb-aa95-35e77cbb072c@collabora.com> References: <20211203064027.14993-1-yong.wu@mediatek.com> <20211203064027.14993-4-yong.wu@mediatek.com> <47c30f6f-ce9d-9ea7-283c-9026ae9ed1c0@collabora.com> <85ef182a-8ebe-7dbb-aa95-35e77cbb072c@collabora.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gVHVlLCAyMDIxLTEyLTA3IGF0IDEzOjE2ICswMTAwLCBBbmdlbG9HaW9hY2NoaW5vIERlbCBS ZWdubyB3cm90ZToNCj4gSWwgMDcvMTIvMjEgMTM6MTAsIFlvbmcgV3UgaGEgc2NyaXR0bzoNCj4g PiBPbiBUdWUsIDIwMjEtMTItMDcgYXQgMDk6NTYgKzAxMDAsIEFuZ2Vsb0dpb2FjY2hpbm8gRGVs IFJlZ25vDQo+ID4gd3JvdGU6DQo+ID4gPiBJbCAwNy8xMi8yMSAwNzoyNCwgWW9uZyBXdSBoYSBz Y3JpdHRvOg0KPiA+ID4gPiBIaSBBbmdlbG9HaW9hY2NoaW5vLA0KPiA+ID4gPiANCj4gPiA+ID4g VGhhbmtzIGZvciB5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