From: "Holalu Yogendra, Niranjan" <niranjan.hy@ti.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"broonie@kernel.org" <broonie@kernel.org>,
"ckeepax@opensource.cirrus.com" <ckeepax@opensource.cirrus.com>,
"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>,
"linux-sound@vger.kernel.org" <linux-sound@vger.kernel.org>,
"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: [PATCH v14 2/4] ASoC: tac5xx2-sdw: add soundwire based codec driver
Date: Mon, 4 May 2026 09:35:51 +0000 [thread overview]
Message-ID: <392b3f5d49ee4b0b928959a27a712363@ti.com> (raw)
In-Reply-To: <1ad635b4-4641-4244-b07b-26e414df79ec@linux.dev>
> On 01:54-20260501, Pierre-Louis Bossart wrote:
> Subject: Re: [PATCH v14 2/4] ASoC: tac5xx2-sdw: add soundwire based codec driver
>
> > +static s32 tac_component_probe(struct snd_soc_component *component)
> > +{
> > + struct tac5xx2_prv *tac_dev =
> > + snd_soc_component_get_drvdata(component);
> > + struct device *dev = tac_dev->dev;
> > + struct sdw_slave *slave = tac_dev->sdw_peripheral;
> > + unsigned long time;
> > + int ret;
> > +
> > + /* Wait for SoundWire hw initialization to complete */
> > + time = wait_for_completion_timeout(&slave->initialization_complete,
> > +
> msecs_to_jiffies(TAC5XX2_PROBE_TIMEOUT_MS));
> > + if (!time) {
> > + dev_warn(dev, "%s: hw initialization timeout\n", __func__);
> > + return -ETIMEDOUT;
> > + }
>
> are you sure this is needed? Or if this even works, if the card creation happens
> after the bus goes to clock-stop, then you will always timeout here.
>
> If you look at commit 011e397 "ASoC: codecs: soundwire: call
> pm_runtime_resume() in component probe" it's simpler to force the bus+codec
> to resume, no?
Thanks. I will adopt this fix which you've added for other drivers.
>
> > +
> > + if (!tac_has_uaj_support(tac_dev))
> > + goto done_comp_probe;
>
> Is this really the case that you only have controls+routes for the UAJ function?
At this place, I do not see problem. But, interrupt handler needs fix to handle
interrupts only when UAJ is supported. Right now it reads uaj interrupts
regardless of whether UAJ is supported or not. I will fix it
> +static s32 tac5xx2_sdca_dev_resume(struct device *dev)
> +{
...
> > +
> > + had_unattached = true;
> > + t = wait_for_completion_timeout(&slave->initialization_complete,
> > +
> msecs_to_jiffies(TAC5XX2_PROBE_TIMEOUT_MS));
> > + if (!t) {
> > + dev_err(&slave->dev, "resume: initialization timed out\n");
> > + sdw_show_ping_status(slave->bus, true);
> > + return -ETIMEDOUT;
> > + }
> > + slave->unattach_request = 0;
> > +
...
> > +
> > +regmap_sync:
> > + regcache_cache_only(tac_dev->regmap, false);
> > + if (!had_unattached) {
> > + regcache_mark_dirty(tac_dev->regmap);
> > + ret = regcache_sync(tac_dev->regmap);
> > + if (ret < 0)
> > + dev_warn(dev, "Failed to sync regcache: %d\n", ret);
> > + }
>
> can you explain why you have this extra test with had_unattached and if this is
> really useful?
> I don't recall having seen this before on any other driver.
This was supposed to be a small optimization, but I realized that this will lead to
bug that regcache not being called if device was not detached for the suspend -> resume scenario.
I will drop this check
Regards
Niranjan
next prev parent reply other threads:[~2026-05-04 9:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 14:45 [PATCH v14 0/4] ASoC: Add TI TAC5XX2 SoundWire codec driver support Niranjan H Y
2026-04-30 14:45 ` [PATCH v14 1/4] ASoC: SDCA: Add PDE verification reusable helper Niranjan H Y
2026-04-30 14:45 ` [PATCH v14 2/4] ASoC: tac5xx2-sdw: add soundwire based codec driver Niranjan H Y
2026-04-30 20:24 ` Pierre-Louis Bossart
2026-05-04 9:35 ` Holalu Yogendra, Niranjan [this message]
2026-04-30 14:45 ` [PATCH v14 3/4] ASoC: sdw_utils: TI amp utility for tac5xx2 family Niranjan H Y
2026-04-30 14:45 ` [PATCH v14 4/4] ASoC: tac5xx2-sdw: ACPI match for intel mtl platform Niranjan H Y
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=392b3f5d49ee4b0b928959a27a712363@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