public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
To: Aaron Ma <aaron.ma@canonical.com>,
	Oder Chiou <oder_chiou@realtek.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, linux-kernel@vger.kernel.org
Cc: Shuming Fan <shumingf@realtek.com>
Subject: Re: [PATCH] ASoC: rt1320-sdw: don't poll PDE state on power-down
Date: Tue, 28 Apr 2026 22:10:19 +0200	[thread overview]
Message-ID: <69a3d80d-c9aa-459f-8522-c07e225bd5d9@linux.dev> (raw)
In-Reply-To: <20260428073726.1611777-1-aaron.ma@canonical.com>

On 4/28/26 09:37, Aaron Ma wrote:
> rt1320_pde23_event(PRE_PMD) writes REQ_POWER_STATE=PS3 then polls
> ACTUAL_POWER_STATE. DAPM fires PRE_PMD while the SoundWire data port
> is still streaming — the codec cannot reach PS3 until the port stops,
> so the poll always times out during playback. This blocks
> snd_ctl_elem_write() for 2-3s making mute unresponsive.
> 
> Remove the poll from PRE_PMD in rt1320_pde23_event() and
> rt1320_pde11_event(). The codec transitions to PS3 on its own once the
> data port becomes inactive. Keep the POST_PMU poll — on power-up the
> domain must reach PS0 before audio can flow.
> 
> Fixes: f465d10cd731 ("ASoC: rt1320: Add support for version C")
> Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
> ---
>  sound/soc/codecs/rt1320-sdw.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/sound/soc/codecs/rt1320-sdw.c b/sound/soc/codecs/rt1320-sdw.c
> index 192faa431b5e9..e42e8b6de853e 100644
> --- a/sound/soc/codecs/rt1320-sdw.c
> +++ b/sound/soc/codecs/rt1320-sdw.c
> @@ -2000,7 +2000,6 @@ static int rt1320_pde11_event(struct snd_soc_dapm_widget *w,
>  		regmap_write(rt1320->regmap,
>  			SDW_SDCA_CTL(FUNC_NUM_MIC, RT1320_SDCA_ENT_PDE11,
>  				RT1320_SDCA_CTL_REQ_POWER_STATE, 0), ps3);
> -		rt1320_pde_transition_delay(rt1320, FUNC_NUM_MIC, RT1320_SDCA_ENT_PDE11, ps3);
>  		break;
>  	default:
>  		break;
> @@ -2028,7 +2027,6 @@ static int rt1320_pde23_event(struct snd_soc_dapm_widget *w,
>  		regmap_write(rt1320->regmap,
>  			SDW_SDCA_CTL(FUNC_NUM_AMP, RT1320_SDCA_ENT_PDE23,
>  				RT1320_SDCA_CTL_REQ_POWER_STATE, 0), ps3);
> -		rt1320_pde_transition_delay(rt1320, FUNC_NUM_AMP, RT1320_SDCA_ENT_PDE23, ps3);

no, sorry, that's clearly wrong.

When we touch the requested power state, we *shall* wait for the power state to be reached.
removing the transition delay is silly.

You would really need to find out why streaming still occurs when you get a DAPM event. That doesn't seem right in the first place.


>  		break;
>  	default:
>  		break;


  reply	other threads:[~2026-04-28 20:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28  7:37 [PATCH] ASoC: rt1320-sdw: don't poll PDE state on power-down Aaron Ma
2026-04-28 20:10 ` Pierre-Louis Bossart [this message]
2026-04-29  4:12   ` Aaron Ma
2026-04-30  8:07     ` Pierre-Louis Bossart
2026-04-30  8:45       ` Aaron Ma
2026-04-30 19:58         ` Pierre-Louis Bossart
2026-05-01 12:23           ` Aaron Ma
2026-05-04  8:55             ` Pierre-Louis Bossart
2026-05-05  3:10               ` Shuming [范書銘]

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=69a3d80d-c9aa-459f-8522-c07e225bd5d9@linux.dev \
    --to=pierre-louis.bossart@linux.dev \
    --cc=aaron.ma@canonical.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=oder_chiou@realtek.com \
    --cc=perex@perex.cz \
    --cc=shumingf@realtek.com \
    --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