Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp335712yba; Thu, 18 Apr 2019 02:01:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxDdx8l2D49YpdSBK09y1nqGmnWGZSRCqWxpoE4K+0gMRYEXhmFeULAFjwAcm6x3rj4R44G X-Received: by 2002:a63:2c06:: with SMTP id s6mr87961711pgs.245.1555578102955; Thu, 18 Apr 2019 02:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555578102; cv=none; d=google.com; s=arc-20160816; b=Mo4Hk5CJU51nM3DbTmp2Y1P1WbBKnHEXMs/Of0/WqiPlpD2gSlOcmsdaRDNGzsQsqT BbziyFxXV5h7mw43W9OK5TcTaUi8fL4aJHQAgj5klaS3WlVl1b38ARVsuCwGFo/WUh/V AGsO4ABTxt+6l7D7YL/Gu8yP21qVxoVRFrEG4iwUsUucGMc/ycorB3CBjpgE8zjC3S28 y7KOX9BDUNMTC7HfARtPmlERamWMTeEjNeUve99Q5BYfYTBUm+x4jHUDFTkiLE1MvQzU yGX1Uj2tGDDSX63QP0jzpPgae3OggjQxvcTYkEQqXO3HHl7t9XtuLWH3t8WnT1lcDJUZ OTpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=AR1RP7f6kZifZ7FeB0P9Q2kh0p04YoT/2fg9i6FFRjE=; b=AaXODseS5DVUSLVYce4I8k+rlIiTjRLfXHHQSTTpfOcKsq4tU8gzHigfEwhU3+5FYc verXZ5nE7h5wYcSNwKw+LauYLjxdHJssLnc0fbdlDsJsi8WjgPpwQzc21g6TNvj5vuyL eCkkkULZaAaUJJSZbkE6QwfZzFhlEDYlNB1+BVH8bTH0FtNQvRI6PNJa02p0gjAXNyJ3 uJkVkotDLfQU1Z5+9ez0QsPsjuHswQfKqbrxXhXsDliCncCfBQr2EhPbBSyWJ1deuxjI AfYH7gTXIXC/5e5qaeRltLG+BzrzXW3PvoMVlep5Icaj5PMnHXpVCrnufYhy3W2bIGkc 6mEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=d45XVkiB; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3si1526681plq.400.2019.04.18.02.01.27; Thu, 18 Apr 2019 02:01: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=@gmail.com header.s=20161025 header.b=d45XVkiB; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388323AbfDRJAV (ORCPT + 99 others); Thu, 18 Apr 2019 05:00:21 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:38427 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728074AbfDRJAV (ORCPT ); Thu, 18 Apr 2019 05:00:21 -0400 Received: by mail-pg1-f195.google.com with SMTP id j26so892578pgl.5 for ; Thu, 18 Apr 2019 02:00:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=AR1RP7f6kZifZ7FeB0P9Q2kh0p04YoT/2fg9i6FFRjE=; b=d45XVkiBIHj4d50vGS6UL25afAP+GwNkW1AT4uquixx64Bkbkxtg+qchQxRY0yfcib WnEQAf+YRh2PP/StgKkC++L2w3Dn8uzkN6tpKKlE44ZQk6gDmg22ebPBEWl47M/wkVMd R926WMDAUrwrJTGVNGcevasOORF6WfPbThgZ0SmKYVqIiY5eW78q718X7woBxj+Xc/J0 rdDEvFYgsKdymHxppa9sncmUU3lvXXP2XqfM+FuYr1IQS0RiR5LGUE+kHA+lRB5QGV1b BGwqPU2TGLcr8QSdWBl1562TJkl+sxaD77CZXH/Uqwu29q/+/6cZ43e2zb7v0p8Zka9w rvFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=AR1RP7f6kZifZ7FeB0P9Q2kh0p04YoT/2fg9i6FFRjE=; b=m0c8y9dPf5iB/bjhamMOaUPpsXD9JdhwRtCWCZrhKE4xBzMD+eky5E19xMMbH6PNlX OS6XYIbDLZ2xbNCZOLqCYTeQJebE6+UlzzK/NKBnq8VLqjGJf5mVizFSdt+F5YyWuhbc umZ1GxPTX0ziQn5xB3OaTGEtk2lsDh5D36blU2dOzhjwdvLTk1sCTLpa4SnAu1Eff9Ps D2P6ZC1GkMVIJhgglwY45NOAQWX2lWThsZVaY0XrCh2LTMIyxDDG4yJSNy7cB6xgpodI NfYyxdc4VgOjEMsZu9yNI1G/UuUx11LMP59xvGX9AbTQP0G8CFZlVBAz1vMC+VmuM3Jn F3Ng== X-Gm-Message-State: APjAAAWmLuGWuLwdfPOLdAQuBCg8aRbrXcX4SlE9x5poUF8MvQAmuMPE HMBP+rDBgeCKI2dfDCsNYfY= X-Received: by 2002:a63:c104:: with SMTP id w4mr88228953pgf.409.1555578020180; Thu, 18 Apr 2019 02:00:20 -0700 (PDT) Received: from Asurada (c-98-248-47-108.hsd1.ca.comcast.net. [98.248.47.108]) by smtp.gmail.com with ESMTPSA id y8sm2377070pgk.20.2019.04.18.02.00.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Apr 2019 02:00:19 -0700 (PDT) Date: Thu, 18 Apr 2019 02:00:12 -0700 From: Nicolin Chen To: "S.j. Wang" 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 Message-ID: <20190418090011.GA4028@Asurada> References: <1555558152-32196-1-git-send-email-shengjiu.wang@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1555558152-32196-1-git-send-email-shengjiu.wang@nxp.com> User-Agent: Mutt/1.5.22 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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? > will be lost. So the driver need to enter runtime suspend state in > suspend. > 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. > -static int fsl_esai_suspend(struct device *dev) > - regcache_cache_only(esai->regmap, true); > - regcache_mark_dirty(esai->regmap); > +static int fsl_esai_runtime_resume(struct device *dev) > regcache_cache_only(esai->regmap, false); > + regcache_mark_dirty(esai->regmap); 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.)