Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp5139003pxb; Tue, 28 Sep 2021 11:19:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwx4a3DdECwv3RchqUGX3JgfIqvm7nQ8iqwhyCzlm6G86wLVcVZv4mFpuLdJdKpKIq8HkER X-Received: by 2002:a17:906:640f:: with SMTP id d15mr8615683ejm.419.1632853169142; Tue, 28 Sep 2021 11:19:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632853169; cv=none; d=google.com; s=arc-20160816; b=ISC6FJPjcHN9mdYCHuBtf+pujt+ia7jeGmOIzVPtvq6oUZtdqzgnrQISXFsuqhBIEg JL43PMibZi9Z+UIY68m/rlkwc8gOUKgD6dEbCBEBTZ3a4W1+L9eIEk1DcjyqBI0cOGVD iDWrDsadCF44+Cm6szEBplxvRw4WVfFZe7sdix3gw/EV8uuGqsI0VJsT2l2skqQre6vt NbVeB1zF/y1KJbrTQsbr486VCekTdZt+IoFV3pihqnq9a6obkfbLUXS077kGAUfRcGn/ B1eERENe3ieXGyVn2/hma1EVMTw+l0k3rPEgpS4ngw7+6mJe/IoHc7ic/jMH3e9ixImn KXmA== 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=gOCdWt/Eux0mnbzHr5ykIPzUrx3QWeC6aREPf0zyBRA=; b=r6de7EA34jSdZ2cmOVVM/YK1s6KTd5eL4ZemtsRg7e7mSWE2x/IPaFwI5pu8PM505o di/mO8hFe18OMwG4soFzSeiEKZQRcNL5rZMu5rS/pWsZNNanFBLb1wM7spCORyOF4xIx ToBOUKOuJtV/opyp2FsWF4xXuEobXcK05V9bhu5l+bhD110D+eg4+lgnBHoI2DzPOar5 4uwjoqgvcyggWXYiRL3r0FvRg7gs7yuFDEtPe8sfErfvzMUHgxdgQritS9cnNZ45Zuvy 6gUk4x3njk+C7vK4Oh0M+h8vca0lKQnqgmBzMRlYcJ3UKcN9tcDdQZkfnTwpOUPSdj+u vsqg== 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 k2si22589489ejo.293.2021.09.28.11.19.01; Tue, 28 Sep 2021 11:19:29 -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 S241915AbhI1SRP (ORCPT + 99 others); Tue, 28 Sep 2021 14:17:15 -0400 Received: from mga03.intel.com ([134.134.136.65]:9111 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241547AbhI1SRP (ORCPT ); Tue, 28 Sep 2021 14:17:15 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10121"; a="224843734" X-IronPort-AV: E=Sophos;i="5.85,330,1624345200"; d="scan'208";a="224843734" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2021 11:15:35 -0700 X-IronPort-AV: E=Sophos;i="5.85,330,1624345200"; d="scan'208";a="438174376" Received: from ppahwa-mobl1.amr.corp.intel.com (HELO [10.212.48.236]) ([10.212.48.236]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2021 11:15:34 -0700 Subject: Re: [EXTERNAL] Re: [PATCH] ASoC: max98373: Mark cache dirty before entering sleep To: Ryan Lee , Mark Brown Cc: "guennadi.liakhovetski@linux.intel.com" , "alsa-devel@alsa-project.org" , "ryan.lee.maxim@gmail.com" , "tiwai@suse.com" , "lgirdwood@gmail.com" , "linux-kernel@vger.kernel.org" , "sathya.prakash.m.r@intel.com" , "yung-chuan.liao@linux.intel.com" References: <20210924221305.17886-1-ryans.lee@maximintegrated.com> <1b21bbf1-12c7-726d-bff8-76ec88ff8635@linux.intel.com> <20210927160622.GE4199@sirena.org.uk> <7b8c3875-3f12-f3cb-7da8-4e850e59ee2b@linux.intel.com> <20210927171033.GF4199@sirena.org.uk> <0af258d4-e33c-15ec-5dcc-a1c9961c0740@linux.intel.com> From: Pierre-Louis Bossart Message-ID: Date: Tue, 28 Sep 2021 13:15:31 -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: 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 >>>> Instead of changing the suspend sequence, can we please try to modify >>>> the max98373_io_init() routine to unconditionally flag the cache as >>>> dirty, maybe this points to a problem with the management of the >>>> max98373->first_hw_init flag. >>> >>> A quick survey of other drivers suggests that this pattern should be >>> factored out into some helpers as it looks like there's several ways >>> of implementing it that look very similar but not quite the same... >> >> No disagreement here, we tried really hard to enforce a common pattern for >> suspend-resume, but i just noticed that the maxim amp driver is different on >> suspend (resume is consistent with the rest). > > OK. I believe it was similar before. But it looks like 'regcache_mark_dirty' is being > disappeared on suspend function. Not sure what you are trying to say? > static int __maybe_unused rt5682_dev_suspend(struct device *dev) > { > struct rt5682_priv *rt5682 = dev_get_drvdata(dev); > > if (!rt5682->hw_init) > return 0; > > cancel_delayed_work_sync(&rt5682->jack_detect_work); > > regcache_cache_only(rt5682->regmap, true); > regcache_mark_dirty(rt5682->regmap); > > return 0; > } That last line is also not needed. If you look at rt5682-sdw.c, you'll see a regcache_mark_dirty() when the device is re-initialized. But now I am starting to wonder if this is due to Chrome kernel differences and possibly a missing backport patch? I no longer believe in coincidences, these two devices are ONLY used in Chromebooks so far...