public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
	alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>,
	Yong Zhi <yong.zhi@intel.com>
Subject: [PATCH AUTOSEL 5.4 113/266] ASoC: max98373: reorder max98373_reset() in resume
Date: Wed, 17 Jun 2020 21:13:58 -0400	[thread overview]
Message-ID: <20200618011631.604574-113-sashal@kernel.org> (raw)
In-Reply-To: <20200618011631.604574-1-sashal@kernel.org>

From: Yong Zhi <yong.zhi@intel.com>

[ Upstream commit 1a446873d7dd3a450f685928ce7f1907bde4583d ]

During S3 test, the following error was observed:

[ 726.174237] i2c_designware i2c_designware.0: platform_pm_resume+0x0/0x3d returned 0 after 0 usecs
[ 726.184187] max98373 i2c-MX98373:00: calling max98373_resume+0x0/0x30 [snd_soc_max98373] @ 12698, parent: i2c-11
[ 726.195589] max98373 i2c-MX98373:00: Reset command failed. (ret:-16)

When calling regmap_update_bits(), since map->reg_update_bits is NULL,
_regmap_read() is entered with the following logic:

	if (!map->cache_bypass) {
		ret = regcache_read(map, reg, val);
		if (ret == 0)
			return 0;
	}

	if (map->cache_only)
		return -EBUSY;

regcache_read() hits -EINVAL because MAX98373_R2000_SW_RESET is volatile,
as map->cache_only is set by codec suspend, thus -EBUSY is returned.
Fix by moving max98373_reset() after cache_only set to false in max98373_resume().

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Link: https://lore.kernel.org/r/1588376661-29799-1-git-send-email-yong.zhi@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/max98373.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/max98373.c b/sound/soc/codecs/max98373.c
index cae1def8902d..96718e3a1ad0 100644
--- a/sound/soc/codecs/max98373.c
+++ b/sound/soc/codecs/max98373.c
@@ -850,8 +850,8 @@ static int max98373_resume(struct device *dev)
 {
 	struct max98373_priv *max98373 = dev_get_drvdata(dev);
 
-	max98373_reset(max98373, dev);
 	regcache_cache_only(max98373->regmap, false);
+	max98373_reset(max98373, dev);
 	regcache_sync(max98373->regmap);
 	return 0;
 }
-- 
2.25.1


  parent reply	other threads:[~2020-06-18  1:40 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200618011631.604574-1-sashal@kernel.org>
2020-06-18  1:12 ` [PATCH AUTOSEL 5.4 003/266] ASoC: tegra: tegra_wm8903: Support nvidia, headset property Sasha Levin
2020-06-18  1:12 ` [PATCH AUTOSEL 5.4 005/266] ASoC: SOF: imx8: Fix randbuild error Sasha Levin
2020-06-18  1:12 ` [PATCH AUTOSEL 5.4 010/266] ASoC: fsl_esai: Disable exception interrupt before scheduling tasklet Sasha Levin
2020-06-18  1:12 ` [PATCH AUTOSEL 5.4 013/266] ASoC: davinci-mcasp: Fix dma_chan refcnt leak when getting dma type Sasha Levin
2020-06-18  1:12 ` [PATCH AUTOSEL 5.4 019/266] ALSA: hda/realtek - Introduce polarity for micmute LED GPIO Sasha Levin
2020-06-18  1:12 ` [PATCH AUTOSEL 5.4 020/266] ALSA: isa/wavefront: prevent out of bounds write in ioctl Sasha Levin
2020-06-18  1:12 ` [PATCH AUTOSEL 5.4 041/266] ASoC: SOF: Do nothing when DSP PM callbacks are not set Sasha Levin
2020-06-18  1:13 ` [PATCH AUTOSEL 5.4 067/266] ASoC: qcom: q6asm-dai: kCFI fix Sasha Levin
2020-06-18  1:13 ` [PATCH AUTOSEL 5.4 079/266] ASoC: meson: add missing free_irq() in error path Sasha Levin
2020-06-18  1:13 ` [PATCH AUTOSEL 5.4 101/266] ALSA: usb-audio: Improve frames size computation Sasha Levin
2020-06-18  1:13 ` [PATCH AUTOSEL 5.4 102/266] ALSA: usb-audio: Fix racy list management in output queue Sasha Levin
2020-06-18  1:13 ` [PATCH AUTOSEL 5.4 106/266] slimbus: ngd: get drvdata from correct device Sasha Levin
2020-06-18  1:13 ` Sasha Levin [this message]
2020-06-18  1:13 ` [PATCH AUTOSEL 5.4 114/266] soundwire: slave: don't init debugfs on device registration error Sasha Levin
2020-06-18  1:14 ` [PATCH AUTOSEL 5.4 127/266] ALSA: firewire-lib: fix invalid assignment to union data for directional parameter Sasha Levin
2020-06-18  1:14 ` [PATCH AUTOSEL 5.4 130/266] ASoC: SOF: core: fix error return code in sof_probe_continue() Sasha Levin
2020-06-18  1:14 ` [PATCH AUTOSEL 5.4 134/266] SoC: rsnd: add interrupt support for SSI BUSIF buffer Sasha Levin
2020-06-18  1:14 ` [PATCH AUTOSEL 5.4 135/266] ASoC: ux500: mop500: Fix some refcounted resources issues Sasha Levin
2020-06-18  1:14 ` [PATCH AUTOSEL 5.4 136/266] ASoC: ti: omap-mcbsp: Fix an error handling path in 'asoc_mcbsp_probe()' Sasha Levin
2020-06-18  1:14 ` [PATCH AUTOSEL 5.4 145/266] ALSA: usb-audio: Add duplex sound support for USB devices using implicit feedback Sasha Levin
2020-06-18  1:14 ` [PATCH AUTOSEL 5.4 157/266] ASoC: Intel: bytcr_rt5640: Add quirk for Toshiba Encore WT8-A tablet Sasha Levin
2020-06-18  1:15 ` [PATCH AUTOSEL 5.4 190/266] ASoC: fix incomplete error-handling in img_i2s_in_probe Sasha Levin
2020-06-18  1:15 ` [PATCH AUTOSEL 5.4 209/266] ASoC: fsl_asrc_dma: Fix dma_chan leak when config DMA channel failed Sasha Levin
2020-06-18  1:16 ` [PATCH AUTOSEL 5.4 250/266] ASoC: core: only convert non DPCM link to DPCM link Sasha Levin
2020-06-18  1:16 ` [PATCH AUTOSEL 5.4 251/266] ASoC: SOF: nocodec: conditionally set dpcm_capture/dpcm_playback flags Sasha Levin
2020-06-18  1:16 ` [PATCH AUTOSEL 5.4 252/266] ASoC: Intel: bytcr_rt5640: Add quirk for Toshiba Encore WT10-A tablet Sasha Levin
2020-06-18  1:16 ` [PATCH AUTOSEL 5.4 253/266] ASoC: rt5645: Add platform-data for Asus T101HA Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200618011631.604574-113-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=yong.zhi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox