mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Binding <sbinding@opensource.cirrus.com>
To: Zhang Heng <zhangheng@kylinos.cn>,
	david.rhodes@cirrus.com, rf@opensource.cirrus.com,
	perex@perex.cz, tiwai@suse.com
Cc: linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
	linux-kernel@vger.kernel.org, paul@mirliton.io,
	stable@vger.kernel.org
Subject: Re: [PATCH] ALSA: hda: cs35l41: Fix errors caused by software reset
Date: Mon, 2 Mar 2026 16:06:17 +0000	[thread overview]
Message-ID: <fb78b03e-8b8d-41b2-999f-3e7c327391d7@opensource.cirrus.com> (raw)
In-Reply-To: <20260302121106.66805-1-zhangheng@kylinos.cn>

Hi,

I don't think this is necessarily the correct solution to this issue.
The software resets were added intentionally, so making them conditional may cause issues.

I've commented on the original BugZilla to get more information.

Thanks,

Stefan

On 02/03/2026 12:11, Zhang Heng wrote:
> Performing software reset again after hardware reset is redundant
> and may result in errors. Software reset should be performed when
> hardware reset is not possible.
>
> [  +0.013038] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Calibration applied: R0=10476
> [  +0.010741] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Firmware Loaded - Type: spk-prot, Gain: 19
> [  +0.012471] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Failed waiting for OTP_BOOT_DONE
> [  +0.000002] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: PM: dpm_run_callback(): cs35l41_system_resume [snd_hda_scodec_cs35l41] returns -110
> [  +0.000011] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: PM: failed to restore: error -110
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=221161
> Fixes: 2ee06ff5d7cf ("ALSA: hda: cs35l41: Force a software reset after hardware reset")
> Cc: stable@vger.kernel.org
> Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
> ---
>  sound/hda/codecs/side-codecs/cs35l41_hda.c | 18 ++++++++----------
>  1 file changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/sound/hda/codecs/side-codecs/cs35l41_hda.c b/sound/hda/codecs/side-codecs/cs35l41_hda.c
> index b64890006bb7..c546a42754bb 100644
> --- a/sound/hda/codecs/side-codecs/cs35l41_hda.c
> +++ b/sound/hda/codecs/side-codecs/cs35l41_hda.c
> @@ -1023,15 +1023,13 @@ static int cs35l41_system_resume(struct device *dev)
>  		gpiod_set_value_cansleep(cs35l41->reset_gpio, 0);
>  		usleep_range(2000, 2100);
>  		gpiod_set_value_cansleep(cs35l41->reset_gpio, 1);
> +		usleep_range(2000, 2100);
> +	} else {
> +		regmap_write(cs35l41->regmap, CS35L41_SFT_RESET, CS35L41_SOFTWARE_RESET);
> +		usleep_range(2000, 2100);
>  	}
> -
> -	usleep_range(2000, 2100);
> -
>  	regcache_cache_only(cs35l41->regmap, false);
>  
> -	regmap_write(cs35l41->regmap, CS35L41_SFT_RESET, CS35L41_SOFTWARE_RESET);
> -	usleep_range(2000, 2100);
> -
>  	ret = cs35l41_wait_boot_done(cs35l41);
>  	if (ret)
>  		return ret;
> @@ -1973,12 +1971,12 @@ int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int i
>  		gpiod_set_value_cansleep(cs35l41->reset_gpio, 0);
>  		usleep_range(2000, 2100);
>  		gpiod_set_value_cansleep(cs35l41->reset_gpio, 1);
> +		usleep_range(2000, 2100);
> +	} else {
> +		regmap_write(cs35l41->regmap, CS35L41_SFT_RESET, CS35L41_SOFTWARE_RESET);
> +		usleep_range(2000, 2100);
>  	}
>  
> -	usleep_range(2000, 2100);
> -	regmap_write(cs35l41->regmap, CS35L41_SFT_RESET, CS35L41_SOFTWARE_RESET);
> -	usleep_range(2000, 2100);
> -
>  	ret = cs35l41_wait_boot_done(cs35l41);
>  	if (ret)
>  		goto err;

      reply	other threads:[~2026-03-02 16:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02 12:11 Zhang Heng
2026-03-02 16:06 ` Stefan Binding [this message]

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=fb78b03e-8b8d-41b2-999f-3e7c327391d7@opensource.cirrus.com \
    --to=sbinding@opensource.cirrus.com \
    --cc=david.rhodes@cirrus.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=paul@mirliton.io \
    --cc=perex@perex.cz \
    --cc=rf@opensource.cirrus.com \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.com \
    --cc=zhangheng@kylinos.cn \
    /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®