From: "Holalu Yogendra, Niranjan" <niranjan.hy@ti.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: "linux-sound@vger.kernel.org" <linux-sound@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"broonie@kernel.org" <broonie@kernel.org>,
"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
"perex@perex.cz" <perex@perex.cz>,
"tiwai@suse.com" <tiwai@suse.com>,
"cezary.rojewski@intel.com" <cezary.rojewski@intel.com>,
"peter.ujfalusi@linux.intel.com" <peter.ujfalusi@linux.intel.com>,
"yung-chuan.liao@linux.intel.com"
<yung-chuan.liao@linux.intel.com>,
"ranjani.sridharan@linux.intel.com"
<ranjani.sridharan@linux.intel.com>,
"kai.vehmanen@linux.intel.com" <kai.vehmanen@linux.intel.com>,
"Xu, Baojun" <baojun.xu@ti.com>,
"Ding, Shenghao" <shenghao-ding@ti.com>,
"Kasargod, Sandeep" <sandeepk@ti.com>,
"Hampiholi, Vallabha" <v-hampiholi@ti.com>
Subject: RE: [EXTERNAL] Re: [PATCH v9 1/4] ASoC: SDCA: Add PDE verification reusable helper
Date: Mon, 20 Apr 2026 14:03:35 +0000 [thread overview]
Message-ID: <077a8adcced94ea18116ce9a167cc846@ti.com> (raw)
In-Reply-To: <6832da94-39cc-4cfd-ad1c-0c4bfea8c79c@linux.dev>
On 16:57-20260420, Pierre-Louis Bossart wrote:
> Sent: Monday, April 20, 2026 4:57 PM
> Subject: Re: [PATCH v9 1/4] ASoC: SDCA: Add PDE verification reusable helper
>
> On 4/20/26 12:35, Charles Keepax wrote:
> > On Mon, Apr 20, 2026 at 11:49:00AM +0200, Pierre-Louis Bossart wrote:
> >> On 4/17/26 15:13, Niranjan H Y wrote:
> >>> + * The caller is responsible for writing REQUESTED_PS before invoking this
> function.
> >>
> >> Erm, why not dealing with the write to REQUESTED_PS in this
> >> helper? You have all the 'to' and 'from' information in the
> >> parameters.
> >
> > I have no objections to moving that into the helper as well.
Ok, I did not want to disturb the widget's event handler in this patch.
I will add this in the next patch.
> >
> >>> + static const int polls = 100;
> >>> + static const int default_poll_us = 1000;
> >>> + unsigned int reg, val;
> >>> + int i, poll_us = default_poll_us;
> >>> + int ret;
> >>> +
> >>> + if (pde_delays && num_delays > 0) {
> >>> + for (i = 0; i < num_delays; i++) {
> >>> + if (pde_delays[i].from_ps == from_ps &&
> pde_delays[i].to_ps == to_ps) {
> >>> + poll_us = pde_delays[i].us / polls;
> >>> + break;
> >>> + }
> >>> + }
> >>> + }
> >>> +
> >>> + reg = SDW_SDCA_CTL(function_id, entity_id,
> SDCA_CTL_PDE_ACTUAL_PS, 0);
> >>> +
> >>> + for (i = 0; i < polls; i++) {
> >>> + if (i)
> >>> + fsleep(poll_us);
> >>
> >> This solution will loop for up to 100 times, and the sleep
> >> duration could be questionable.
> >
> > The duration doesn't have to be precise here, as long as the
> > result is longer than the requested time everything is fine.
> >
> >> Say for example you have a 10ms transition, do you really want
> >> to read ACTUAL_PS every 100us?
> >
> > Quite potentially, I imagine it will be fairly common for parts
> > to change PS a lot faster than the actual timeouts they provide,
> > due to corner cases and people just being conservative in the
> > DisCo. So its quite possible something that says 10mS typically
> > switches in a couple 100uS.
> >
> >> If the pde_delay is 1ms then a read every 10us makes no sense,
> >> the SoundWire command protocol would not be able to handle
> >> such reads.
> >>
> >> A minimum threshold on poll_us would make sense IMHO.
> >
> > I guess you do reach a point where the soundwire command makes
> > the delay effectively meaningless. What would you suggest for a
>
> yep, that was the main point.
>
> > minimum? Something like 100uS feels kinda reasonable to me,
> > I would lean towards quite a small value here. Other options
> > might be to look at some sort of exponential back off, doing the
> > first few polls faster than later ones.
> >
> > This is definitely one of those situations where SDCA is a little
> > too vague for its own good. But I would also say making a change
> > like this should at a minimum be a separate patch rather than
> > part of this one. And I am not convinced we need to block this
> > series on updating it, although if we just wanted to go with a
> > simple minimum that seems easy enough to add.
>
> A minimum of 100us would be fine, we can always optimize for long delays
> later.
Understood, I will change it to 100us and send new patch.
I realized that at @4.8MHz to 6MHz, 50x10, I think the read
itself takes roughly ~42us to 50us.
And with 100us it is 10ms before timeout happens
(practically maybe it is roughly 15ms).
Regards
Niranjan
next prev parent reply other threads:[~2026-04-20 14:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 13:13 [PATCH v9 1/4] ASoC: SDCA: Add PDE verification reusable helper Niranjan H Y
2026-04-17 13:13 ` [PATCH v9 2/4] ASoC: tac5xx2-sdw: add soundwire based codec driver Niranjan H Y
2026-04-20 10:10 ` Pierre-Louis Bossart
2026-04-20 16:18 ` Holalu Yogendra, Niranjan
2026-04-21 16:10 ` Pierre-Louis Bossart
2026-04-17 13:14 ` [PATCH v9 3/4] ASoC: sdw_utils: TI amp utility for tac5xx2 family Niranjan H Y
2026-04-17 13:14 ` [PATCH v9 4/4] ASoC: tac5xx2-sdw: ACPI match for intel mtl platform Niranjan H Y
2026-04-20 9:49 ` [PATCH v9 1/4] ASoC: SDCA: Add PDE verification reusable helper Pierre-Louis Bossart
2026-04-20 10:35 ` Charles Keepax
2026-04-20 11:26 ` Pierre-Louis Bossart
2026-04-20 14:03 ` Holalu Yogendra, Niranjan [this message]
2026-04-20 9:57 ` Charles Keepax
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=077a8adcced94ea18116ce9a167cc846@ti.com \
--to=niranjan.hy@ti.com \
--cc=baojun.xu@ti.com \
--cc=broonie@kernel.org \
--cc=cezary.rojewski@intel.com \
--cc=ckeepax@opensource.cirrus.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.dev \
--cc=ranjani.sridharan@linux.intel.com \
--cc=sandeepk@ti.com \
--cc=shenghao-ding@ti.com \
--cc=tiwai@suse.com \
--cc=v-hampiholi@ti.com \
--cc=yung-chuan.liao@linux.intel.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