Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4147089pxb; Mon, 27 Sep 2021 10:20:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8Jj94JwdmEChC326T2CjN3XkTk1W5r0uBE8JB57P05ZsYvmyK3YIogPJFUNs/JU3wdxNX X-Received: by 2002:a05:6a00:ac8:b029:320:a6bb:880d with SMTP id c8-20020a056a000ac8b0290320a6bb880dmr769343pfl.41.1632763237151; Mon, 27 Sep 2021 10:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632763237; cv=none; d=google.com; s=arc-20160816; b=YJ/BPzCm2A0ZnapUETWfc+97wobctw4TX87RcdWZ2gVMtQiZb5nMEEfGVVhCFCHteh i3G4SPUM03LYcVVmfIJyeAuEcthuwyg0C0GsR64qMkVSQG/4iri8KO0xSwhhFxkGpXEt qiDhmo2gKvHy8aeKhw9UrbHwIsmtp8QwgySWojzTVTm+B+ZjMNpmoU6d07hFezKtHjLw zkd3XM1oNV3qDUPYk5EHYOTx6VzU9qyHDzt5j4j4JX4z/jjCRU/8mfIG2QQNBuqNR/4R zKbtnvJh2CIWJKelSXoIHahmVi3Dx/o745BOx9C7dbY/TjrXcFq6o1IMYIaGeCa4Nya7 y2uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=b/7iVhvzTG2tS4OA+8tvGgq8Op5O71I7BmeKUK2lDF8=; b=MdzcIOo3JchRA1EMU7ZpCSona1K/BVIZ337NWRf2sJiGo7aBameb7VqcrVVseOE4cJ f9TEd+sh9tHRF6zJYTRBqs2eG0zd2dmAukyy/G0BEF2EEdU9UoLwEW3hVqbxGQwcNl5T iHHuqweWqx3S8KwyZJ4jora5VMsE9eVpu41rY5rZ1SUddnb6RMWTnKn9BwFA8fk3XoG1 UeLvro6d1sWKUutbpyp4Gw1iI5gZJ/rHobz2oxbA6r3YPDYL8iTYNbgELFZhmUGh2ixM j98zw5MGkxFhiSGCYF5w4DXrtBoPWDLJtBGl4kcZccmmlm8cJE/9s0W7yQ0xZM2/AOjS 74dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bQpDrq44; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y11si22362050pff.18.2021.09.27.10.20.23; Mon, 27 Sep 2021 10:20:37 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bQpDrq44; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236130AbhI0RVK (ORCPT + 99 others); Mon, 27 Sep 2021 13:21:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:56430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236702AbhI0RQC (ORCPT ); Mon, 27 Sep 2021 13:16:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4496161206; Mon, 27 Sep 2021 17:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632762681; bh=YIj1ttTgSoJXrNem4LCwjOWEjR6amIHkBClahFPqxCk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bQpDrq44YdtHSTvkRChK+pqC47EzUI7ZnD4oL00JGKT33Qh/Pkbvl4z2RdNK62AKc YeJ1pY7WhZckso1550bSxgeLJ0r7PDhOG4pPgctajdWKxELzDyh36ficRuBkmqEidE h6kLnYXUj0M91IT9atxCCR8Vs6ZZdViovIKstvJLRfcewf/0p+1/yaec79p8vqQA93 wddJnDJH7KEBkTLLVYdZbU8xOh7J8ex/lrGw0IRVtMrS3YUpQ/1H0Ntpa6e4EU0onP lkC4SeM+xHLEXecYQkh4cqlhptFqOs1T8vGZXvfUaZrKFwbKCGt9UfwBGv6SVvV7yc giILeUx6mEyvQ== Date: Mon, 27 Sep 2021 18:10:33 +0100 From: Mark Brown To: Pierre-Louis Bossart Cc: Ryan Lee , "lgirdwood@gmail.com" , "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" , "sathya.prakash.m.r@intel.com" , "ryan.lee.maxim@gmail.com" Subject: Re: [EXTERNAL] Re: [PATCH] ASoC: max98373: Mark cache dirty before entering sleep Message-ID: <20210927171033.GF4199@sirena.org.uk> 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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="vA66WO2vHvL/CRSR" Content-Disposition: inline In-Reply-To: <7b8c3875-3f12-f3cb-7da8-4e850e59ee2b@linux.intel.com> X-Cookie: 98% lean. User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --vA66WO2vHvL/CRSR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Sep 27, 2021 at 11:48:56AM -0500, Pierre-Louis Bossart wrote: > On 9/27/21 11:06 AM, Mark Brown wrote: > > More specifically what it does is make the invalidation of the register > > cache unconditional. It doesn't really matter if the invalidation is > > done on suspend or resume, so long as it happens before we attempt to > > resync - this could also be done by deleting the first_hw_init check. > Mark, that's exactly my point: if the amp rejoins the bus, we will > *always* mark the cache as dirty, before the resync is done in the > resume sequence. Ah, yes - I see. > I am really trying to figure out if we have a major flaw in the resume > sequence and why things are different in the case of the Maxim amp. > 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... --vA66WO2vHvL/CRSR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmFR+wgACgkQJNaLcl1U h9A6bgf/cTWeKoYgzRvwlZJiKiKpOgHaFh+QmrmyBmmUJXA6VH6m0Fze8+zv238K RxgyPpu8fmSAZ+7QuLhbVl6G9dUKV1WSQM7QirWFidSndmUBEUmHfrkREVMn0N7I vWYkFVrWqlbxCPbh8s4H3bwFKZCbz4HQDnhKJH/Q5VhAMVSKEt22ybcZDUEvCzrB z+fu8ayfDdfbUeJ+/mQJIUdOm9vC9/iHZz5K2EU7Jh1JFQyOsKM7h+pVh51DMe5e p+GuZtmivYRLr7OA74wKxRMwstKwPJ0oZClBxdKvMZfZ4j3n+BET+28YxSMZMZXB yUa/XvmUfCcybDNwVsFuVnqVjug5aQ== =gqsX -----END PGP SIGNATURE----- --vA66WO2vHvL/CRSR--