Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp405231yba; Thu, 18 Apr 2019 03:22:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhu6ie0yFdRS3Jtp0/H3tx6/Wc/evOpRwM4Rjzjt/nVE1i9Z1Do8GhpwqGusxEmTcnnpCW X-Received: by 2002:a17:902:bd96:: with SMTP id q22mr3083528pls.162.1555582962292; Thu, 18 Apr 2019 03:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555582962; cv=none; d=google.com; s=arc-20160816; b=OefRepZekAWIyS+mN9XjSFI21d5tJRjYzYX2FxM+rIZ6e7m5unMwepmNwOy0VNWedM L1CsamrSplpfe7RLJCkUF+uAO1qPAOKL3NHkqsmU0cxyrvMa7v5OT1N1ceTs/cUdivGE Ix2zDGvom1IyD6q1GMjH9aqDWIl9invV00Tl3EGOl3KLzIihr9SWpES32r6xXM/RHPN5 RvhXVna3TZUvkU+0+pWCAUT24GVDw2oI10T+OyiZS/AQ/ZjDbHXK2/VsLiT2rRIiJgVz j4t8SORkkx/Bx1GEwNgjrG4N03CTs6T2vh2crDNnBqAx8vZahJsN+U50CurZ/oIW2P0l MW0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=dvrZKE6oqhTtG7dz6vO8lh782qKBDVIXZzlmyB4ujA8=; b=a6E+SCVTnAeyaUuHoIqd56bv5J6qItInarcBjiykfww4mkl+BwDJ70wn8vW4hqlOzV TnVPf5NdVap5HrOV4WXaO+mFCIqxSUyqC4TSlTyYbhi8HSer/hufbFm0MAWhGgEv+gxf 6+cJCS1V6DQdEfVkvYhIAUN3W4fnlLlb60QFOUyrZdR/xX6+qODIUUdQb7M3xtVq73rt aoQIwNSphFrbNvVm2C1jfrK/tPsmAsPECihTQHaYFpvjPQM8a204muaED7QYt0uL0BNf cMyzPyOxMJmJDGGP+41daKUhnCpjcCM3zQxdTieMj3y2UxqOZoGYK7G5WM6tMdXUE8/9 snWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=NQArxpMu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l10si1560740pgm.20.2019.04.18.03.22.27; Thu, 18 Apr 2019 03:22:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=NQArxpMu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388624AbfDRKVP (ORCPT + 99 others); Thu, 18 Apr 2019 06:21:15 -0400 Received: from mail-eopbgr50055.outbound.protection.outlook.com ([40.107.5.55]:58787 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388301AbfDRKVO (ORCPT ); Thu, 18 Apr 2019 06:21:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dvrZKE6oqhTtG7dz6vO8lh782qKBDVIXZzlmyB4ujA8=; b=NQArxpMuYMRIM1JjHEvw+zPxj4i9UOZLYTngypUpGaXraSOo4qs8mVc+ABTA81DGRygNyBX57AIYUiX78S2+gzf2pRLSgFZDGMRUwMoMUi1OfY/nbO7VB5HOdt4tqXg+K82m4Md73m//d5NFPxMmwUdMDHbQ8yCvpZpm2SoNDog= Received: from VE1PR04MB6479.eurprd04.prod.outlook.com (20.179.233.80) by VE1PR04MB6558.eurprd04.prod.outlook.com (20.179.234.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.12; Thu, 18 Apr 2019 10:21:11 +0000 Received: from VE1PR04MB6479.eurprd04.prod.outlook.com ([fe80::6c03:86ad:729d:e311]) by VE1PR04MB6479.eurprd04.prod.outlook.com ([fe80::6c03:86ad:729d:e311%7]) with mapi id 15.20.1813.013; Thu, 18 Apr 2019 10:21:11 +0000 From: "S.j. Wang" To: Nicolin Chen CC: "timur@kernel.org" , "Xiubo.Lee@gmail.com" , "festevam@gmail.com" , "broonie@kernel.org" , "alsa-devel@alsa-project.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] ASoC: fsl_esai: Add pm runtime function Thread-Topic: [PATCH] ASoC: fsl_esai: Add pm runtime function Thread-Index: AdT1z8in+mpZLskHQHWuJHAthNAolw== Date: Thu, 18 Apr 2019 10:21:11 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shengjiu.wang@nxp.com; x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8cde20c3-fb2b-4eb9-a447-08d6c3e7947f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:VE1PR04MB6558; x-ms-traffictypediagnostic: VE1PR04MB6558: x-microsoft-antispam-prvs: x-forefront-prvs: 0011612A55 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(136003)(366004)(39860400002)(396003)(346002)(189003)(199004)(186003)(66066001)(102836004)(6436002)(4326008)(5660300002)(97736004)(6506007)(52536014)(26005)(68736007)(81156014)(8936002)(256004)(14444005)(55016002)(33656002)(9686003)(486006)(81166006)(8676002)(1411001)(476003)(2906002)(305945005)(74316002)(7696005)(53936002)(6116002)(3846002)(7736002)(6916009)(6246003)(14454004)(229853002)(316002)(86362001)(478600001)(99286004)(54906003)(71200400001)(71190400001)(25786009);DIR:OUT;SFP:1101;SCL:1;SRVR:VE1PR04MB6558;H:VE1PR04MB6479.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: VPMKpp/waRZjgsbiUpm3v8NVZl8fp6TUE2B2995UFy35scXPgXEAFGqM4gD+rPfSc2rLQ0j6Mt7ZWzNFiLfr/mv1f3n1RcfYv+R1HTL+eaHFk4/IYtHEBTmNC/Cv/5Lo5P2ASYJmDUHo1Ec8+X9/IK4lOt05GSkP63mJ+k07JTLQKYVNCHmnCbd3f0qDH8iJijayp1lUqoiEX9Q5WpX0DBJBV0VxZlNmkW9c0IrgAIRvteqCWUFX+7homsIUQs2m0/3Rfisva1nmUJEpFn7q5zpe1IE4U1CQfGjS8B4Gps4OrP5sN9XI4rSncQqV1aCSUc6ph03aMDMSM11BS2X+hz9UPecwTvl75ci5QWhiDMAozGKHfaeZxVtgHVK8cKWLM+op7unBlp4Q2SOW4ebORirT0oJM+2MJEVLw4XzNWyY= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cde20c3-fb2b-4eb9-a447-08d6c3e7947f X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2019 10:21:11.5218 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6558 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi >=20 >=20 > On Thu, Apr 18, 2019 at 03:29:09AM +0000, S.j. Wang wrote: > > In imx8 when systerm enter suspend state, the power of subsystem will > > be off, the clock enable state will be lost and register configuration >=20 > Just for curiosity, we had similar situation on imx6sx, so we added > suspend/resume with regcache. Why will the clock enable state be lost too= ? > Does CCM on imx8 (might not be called CCM > though) have any difference? What about clock rate settings? >=20 > > will be lost. So the driver need to enter runtime suspend state in > > suspend. >=20 > > With this implementation the suspend function almost same as runtime > > suspend function, so remove the suspend function, just use > > pm_runtime_force_suspend instead, and same for the resume function. > > > > And also need to move clock enablement to runtime resume and clock > > disablement to runtime suspend. >=20 >=20 > > -static int fsl_esai_suspend(struct device *dev) > > - regcache_cache_only(esai->regmap, true); > > - regcache_mark_dirty(esai->regmap); >=20 > > +static int fsl_esai_runtime_resume(struct device *dev) > > regcache_cache_only(esai->regmap, false); > > + regcache_mark_dirty(esai->regmap); >=20 > Why move the regcache_mark_dirty from suspend to resume? > (I am not saying it's wrong but wondering if this is the preferable way.= ) Seems I should not do this change. I will remain regcache_mark_dirty(esai->regmap); at its old place. Best regards Wang shengjiu=20