Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4027971pxb; Mon, 27 Sep 2021 07:55:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsknI2zTFRK/528ywb/yTe+u2LrA3Nq6o82MkSSbrVHd+hpYT+K+xInr8rsKlkTtUgBFPt X-Received: by 2002:a17:902:ed94:b0:138:ca3a:425d with SMTP id e20-20020a170902ed9400b00138ca3a425dmr23353526plj.78.1632754544636; Mon, 27 Sep 2021 07:55:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632754544; cv=none; d=google.com; s=arc-20160816; b=jSbpF42rnnFgOSupiPaWn4D7pSkTowJtZ9D/B54QCU8KCAnwVr3VqIqct6l7dpwqui Xh14T/0jAs46DQaV5soliYD2WjNTJhqyhkXfQTKf/O7Zo6KOpvnYzG21l1RRbA6XocRP SvCnm2KTs/XFgC0MMrxOKGgcEBFoBns7DMm260S2rCT3WIblqOGqbUwLeMwsO+h7j6sN EHDszQaWK0X4xpY8r5TJ744/Sl+26PiBYjfAHv8A3zXAr+1seSX7ogC37jPaOZh2rzo0 5ZsVi3YzwDaydEfhoyBqEU96f6h9qCeWDbv29Bfrm75/jufhWhc0XEMvRIYT1pzBwfi+ zQWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=aHLHhD22h1BoUVrCtysKwaXYxXehRbQbgBPiRW6D/2w=; b=ciSV0OoP023JR+rWbZVfDTEmBBNi5TWYdE/dL7fIARFw9ZLu7XDC+HmXMa7d35l+uS ShYI6mOgTvV/yJC9V5H1k6MREh5FU5uDU9Ggw8qFZJ6047aNU1IBkMwS56JCSpa6xWOF eW5WWj+nfkSsJulXJnmmFYpd5Frm867MQY4JrP9qs00l46PHBstxP9I59GGOQbBe6yFx HpuOjbcy9s9PWqNIkK9tqlq6mgLcDXJufJzogVK93ym0EdodFidT65+dGqlql9KznZos p+WF8TnacDVi+2MaH8F2jhDaDfzo25L7TnPG0R0fUKStM9bTA25Y9ZlmR2njzPh00AM3 8yag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t15si25863472pjf.50.2021.09.27.07.55.32; Mon, 27 Sep 2021 07:55:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234841AbhI0O4Z (ORCPT + 99 others); Mon, 27 Sep 2021 10:56:25 -0400 Received: from mga07.intel.com ([134.134.136.100]:33287 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234782AbhI0O4Y (ORCPT ); Mon, 27 Sep 2021 10:56:24 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10120"; a="288150364" X-IronPort-AV: E=Sophos;i="5.85,326,1624345200"; d="scan'208";a="288150364" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2021 07:54:46 -0700 X-IronPort-AV: E=Sophos;i="5.85,326,1624345200"; d="scan'208";a="486172557" Received: from asen4-mobl2.amr.corp.intel.com (HELO [10.212.27.2]) ([10.212.27.2]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2021 07:54:45 -0700 Subject: Re: [PATCH] ASoC: max98373: Mark cache dirty before entering sleep To: Ryan Lee , lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, yung-chuan.liao@linux.intel.com, guennadi.liakhovetski@linux.intel.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: sathya.prakash.m.r@intel.com, ryan.lee.maxim@gmail.com References: <20210924221305.17886-1-ryans.lee@maximintegrated.com> From: Pierre-Louis Bossart Message-ID: <1b21bbf1-12c7-726d-bff8-76ec88ff8635@linux.intel.com> Date: Mon, 27 Sep 2021 09:54:42 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210924221305.17886-1-ryans.lee@maximintegrated.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/24/21 5:13 PM, Ryan Lee wrote: > Amp lose its register values in case amp power loss or > 'ForceReset' over Soundwire SCP_ctrl register(0x0044) or > HW_RESET pin control during the audio suspend and resume. > Mark cache dirty before audio suspension to restore > existing values when audio resume. > > Signed-off-by: Ryan Lee > --- > sound/soc/codecs/max98373-sdw.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/sound/soc/codecs/max98373-sdw.c b/sound/soc/codecs/max98373-sdw.c > index dc520effc61c..a7e4a6e880b0 100644 > --- a/sound/soc/codecs/max98373-sdw.c > +++ b/sound/soc/codecs/max98373-sdw.c > @@ -259,6 +259,7 @@ static __maybe_unused int max98373_suspend(struct device *dev) > regmap_read(max98373->regmap, max98373->cache[i].reg, &max98373->cache[i].val); > > regcache_cache_only(max98373->regmap, true); > + regcache_mark_dirty(max98373->regmap); We already do the following sequence in max98373_io_init() when the amplifier re-attaches: if (max98373->first_hw_init) { regcache_cache_bypass(max98373->regmap, false); regcache_mark_dirty(max98373->regmap); } I don't see what marking the cache as dirty on suspend might do, we will do a sync only in the resume step. IIRC this is a patch that we've seen before and removed since it wasn't aligned with any other codec driver. Does this actually improve anything?