All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Arina Kharlamova" <arina.kharlamova@mbzuai.ac.ae>
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH 2/2] ASoC: tas2552: Disable supplies on component remove
Date: Tue, 01 Dec 2026 19:36:56 +0000	[thread overview]
Message-ID: <sashiko-outbox-244093@kernel.org> (raw)
In-Reply-To: <20261201-tas2552-rpm-v1-2-2bac34f9f68f@mbzuai.ac.ae>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] ASoC: tas2552: supplies disabled before suspend in
  tas2552_component_remove()
--

commit e52927e0e6aa3bc7040718bcc4161bf26af6fdee
Author: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>

ASoC: tas2552: Disable supplies on component remove

This commit disables the tas2552 regulator supplies in
tas2552_component_remove() to balance the regulator_bulk_enable() call in
tas2552_component_probe().

> diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c
> index 0f0c6f1afde78..88b40154530ec 100644
> --- a/sound/soc/codecs/tas2552.c
> +++ b/sound/soc/codecs/tas2552.c
> @@ -644,6 +644,9 @@ static void tas2552_component_remove(struct snd_soc_component *component)
>  	pm_runtime_put(component->dev);
>  
>  	gpiod_set_value_cansleep(tas2552->enable_gpio, 0);
> +
> +	regulator_bulk_disable(ARRAY_SIZE(tas2552->supplies),
> +			       tas2552->supplies);
>  };

[Severity: Medium]
Does disabling tas2552->supplies right after pm_runtime_put() cut power
to the chip before runtime suspend runs?

tas2552_probe() enables runtime PM autosuspend with a 1000 ms delay, so
pm_runtime_put() returns while the device is still active.  When
tas2552_runtime_suspend() runs later, it calls tas2552_sw_shutdown() over
I2C before enabling regcache_cache_only(), writing to the unpowered chip.

Once autosuspend completes and marks the regcache dirty, unbinding the
codec calls __device_release_driver() -> pm_runtime_get_sync(), which
runs tas2552_runtime_resume() and regcache_sync() over I2C with the
supplies still disabled.  Conversely, if the card is rebound before the
1000 ms autosuspend delay expires, the device stays RPM_ACTIVE across the
regulator power cycle, so pm_runtime_resume_and_get() in
tas2552_component_probe() skips tas2552_runtime_resume() and leaves the
reset hardware registers out of sync with the regcache.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201-tas2552-rpm-v1-0-2bac34f9f68f@mbzuai.ac.ae?part=2

      reply	other threads:[~2026-12-01 19:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 19:24 [PATCH 0/2] ASoC: tas2552: Fix runtime PM and supply refcounting Arina Kharlamova
2026-12-01 19:24 ` Arina Kharlamova via B4 Relay
2026-12-01 19:24 ` [PATCH 1/2] ASoC: tas2552: Fix runtime PM usage count underflow in probe Arina Kharlamova
2026-12-01 19:24   ` Arina Kharlamova via B4 Relay
2026-12-01 19:24 ` [PATCH 2/2] ASoC: tas2552: Disable supplies on component remove Arina Kharlamova
2026-12-01 19:24   ` Arina Kharlamova via B4 Relay
2026-12-01 19:36   ` sashiko-bot [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=sashiko-outbox-244093@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=arina.kharlamova@mbzuai.ac.ae \
    --cc=linux-sound@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.