From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: Pengpeng Hou <pengpeng@iscas.ac.cn>,
David Rhodes <david.rhodes@cirrus.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: codecs: cs42l42-sdw: Propagate regcache_sync() errors
Date: Mon, 6 Jul 2026 09:37:39 +0100 [thread overview]
Message-ID: <fdec406d-d9fe-4717-ab57-0c2bf510d1c2@opensource.cirrus.com> (raw)
In-Reply-To: <20260704072712.91035-1-pengpeng@iscas.ac.cn>
On 04/07/2026 8:27 am, Pengpeng Hou wrote:
> cs42l42_sdw_runtime_resume() first syncs LATCH_TO_VP and then syncs the
> full regmap, but currently ignores both return values and can report
> success after a failed replay.
>
> Check both sync operations, return the first error, and restore cache-
> only/dirty state on failure.
>
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
> ---
> sound/soc/codecs/cs42l42-sdw.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/codecs/cs42l42-sdw.c b/sound/soc/codecs/cs42l42-sdw.c
> index ad1256910a18..b61ca74dcf0b 100644
> --- a/sound/soc/codecs/cs42l42-sdw.c
> +++ b/sound/soc/codecs/cs42l42-sdw.c
> @@ -481,10 +481,20 @@ static int cs42l42_sdw_runtime_resume(struct device *dev)
> regcache_cache_only(cs42l42->regmap, false);
>
> /* Sync LATCH_TO_VP first so the VP domain registers sync correctly */
> - regcache_sync_region(cs42l42->regmap, CS42L42_MIC_DET_CTL1, CS42L42_MIC_DET_CTL1);
> - regcache_sync(cs42l42->regmap);
> + ret = regcache_sync_region(cs42l42->regmap, CS42L42_MIC_DET_CTL1, CS42L42_MIC_DET_CTL1);
> + if (ret)
> + goto err_sync;
> +
> + ret = regcache_sync(cs42l42->regmap);
> + if (ret)
> + goto err_sync;
>
> return 0;
> +
> +err_sync:
> + regcache_cache_only(cs42l42->regmap, true);
> + regcache_mark_dirty(cs42l42->regmap);
> + return ret;
> }
>
> static int cs42l42_sdw_resume(struct device *dev)
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
next prev parent reply other threads:[~2026-07-06 8:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-04 7:27 Pengpeng Hou
2026-07-06 8:37 ` Richard Fitzgerald [this message]
2026-07-06 13:03 ` Mark Brown
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=fdec406d-d9fe-4717-ab57-0c2bf510d1c2@opensource.cirrus.com \
--to=rf@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=david.rhodes@cirrus.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=pengpeng@iscas.ac.cn \
--cc=perex@perex.cz \
--cc=tiwai@suse.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
all inboxes | Powered by JetHome®