mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mukunda,Vijendar" <vijendar.mukunda@amd.com>
To: Mark Brown <broonie@kernel.org>,
	Andrey Golovko <andrey.golovko@gmail.com>
Cc: Shenghao Ding <shenghao-ding@ti.com>, Kevin Lu <kevin-lu@ti.com>,
	Baojun Xu <baojun.xu@ti.com>, Sen Wang <sen@ti.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	"Holalu Yogendra, Niranjan" <niranjan.hy@ti.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
	Antoine Monnet <antoine@montane.tech>,
	Robin Everaars <robineveraars@pm.me>,
	Ville Saarinen <wiza@saarinenkoti.fi>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Dommati, Sunil-kumar" <Sunil-kumar.Dommati@amd.com>
Subject: Re: [PATCH] ASoC: tas2783-sdw: power the Function up before preparing the port
Date: Thu, 13 Aug 2026 21:30:14 +0530	[thread overview]
Message-ID: <44f8d013-cb85-4d88-9742-4fb3e34d4267@amd.com> (raw)
In-Reply-To: <213117c2-02d0-4e94-be2f-c172ebedcfe4@sirena.org.uk>

On 13/08/26 18:52, Mark Brown wrote:
> On Thu, Aug 13, 2026 at 12:28:10AM +0300, Andrey Golovko wrote:
>
>> A Data Port cannot complete channel preparation while the SDCA Function
>> is powered down: the peripheral raises the channel's bit in
>> DPn_PrepareStatus and never clears it.
> ...
>
>> Power the Function up in the PRE_PREP callback, immediately before the
>> PrepareCtrl write it already performs, so that preparation has what it
>> needs on every path that prepares a port.
>>  	case SDW_OPS_PORT_PRE_PREP:
>> +		/*
>> +		 * The Function has to be powered before the port can complete
>> +		 * channel preparation.  hw_params() does that when a stream is
>> +		 * set up, but a stream that is only re-prepared - as userspace
>> +		 * does after the peripheral lost power in S0i3 - does not go
>> +		 * through hw_params() again, and the peripheral is back at its
>> +		 * PS3 reset default.  Power it up here, where it is needed.
>> +		 */
>> +		scoped_guard(mutex, &tas_dev->pde_lock)
>> +			ret = regmap_write(tas_dev->regmap,
>> +					   SDW_SDCA_CTL(1, TAS2783_SDCA_ENT_PDE23,
>> +							TAS2783_SDCA_CTL_REQ_POW_STATE, 0),
>> +					   TAS2783_SDCA_POW_STATE_ON);
>> +		if (ret) {
>> +			dev_err(dev, "power up failed for port %d, err=%d\n",
>> +				prep_ch->num, ret);
>> +			return ret;
>> +		}
> Does this DTRT if userspace restartss the stream by directly calling
> SNDRV_PCM_IOCTL_RESUME (AMD adverise SNDR_PCM_INFO_RESUME...)?
> Similarly we can suspend while prepared.  Either something needs to
> force us to prepare again or this needs to be moved somewhere that's
> always called.
I agree with Mark's observation. For drivers advertising SNDRV_PCM_INFO_RESUME,
userspace may resume a stream via SNDRV_PCM_IOCTL_RESUME without going through
a new prepare cycle. Similarly, a stream may be suspended while already
prepared and later resumed without re-running PRE_PREP.
If those paths do not guarantee port preparation is executed again, we either
need to force a re-prepare after power loss or move the power-up sequence to a
callback that is always hit before data transfer resumes.

>
>> +
>>  		ret = sdw_write_no_pm(slave, addr, prep_ch->ch_mask);
>>  		if (ret)
>>  			dev_err(dev, "prep failed for port %d, err=%d\n",
>>
>> base-commit: 6f6fb37f9f9a8ae88faa1b5b1978e57381488502
>> -- 
>> 2.53.0
>>


  reply	other threads:[~2026-08-13 16:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 21:28 Andrey Golovko
2026-08-13 13:22 ` Mark Brown
2026-08-13 16:00   ` Mukunda,Vijendar [this message]
2026-08-13 16:45   ` Andrey Golovko
2026-08-13 21:19     ` Robin Everaars
2026-08-14  6:50       ` Andrey Golovko
2026-08-13 15:22 ` Robin Everaars

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=44f8d013-cb85-4d88-9742-4fb3e34d4267@amd.com \
    --to=vijendar.mukunda@amd.com \
    --cc=Sunil-kumar.Dommati@amd.com \
    --cc=andrey.golovko@gmail.com \
    --cc=antoine@montane.tech \
    --cc=baojun.xu@ti.com \
    --cc=broonie@kernel.org \
    --cc=kevin-lu@ti.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=niranjan.hy@ti.com \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=robineveraars@pm.me \
    --cc=sen@ti.com \
    --cc=shenghao-ding@ti.com \
    --cc=tiwai@suse.com \
    --cc=wiza@saarinenkoti.fi \
    /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®