mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
To: "Liao, Bard" <bard.liao@intel.com>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	"linux-sound@vger.kernel.org" <linux-sound@vger.kernel.org>,
	"vkoul@kernel.org" <vkoul@kernel.org>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"tiwai@suse.de" <tiwai@suse.de>
Cc: "vinod.koul@linaro.org" <vinod.koul@linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"peter.ujfalusi@linux.intel.com" <peter.ujfalusi@linux.intel.com>
Subject: Re: [PATCH 0/3] ASoC/soundwire: remove ghost peripherals from the mach table
Date: Sun, 18 Oct 2026 10:25:32 +0200	[thread overview]
Message-ID: <795ed7a1-0610-4215-a0f5-398dbf558704@linux.dev> (raw)
In-Reply-To: <SJ2PR11MB8424CCF92DD83A5E890E9C39FF9F2@SJ2PR11MB8424.namprd11.prod.outlook.com>


>> Well, you've got two problems here.
>>
>> a) there's a difference between generations. Starting with ACE2.0, the
>> SoundWire bus is started much earlier than in previous generations,
>> where the SoundWire bus was started after firmware download.
>>
>> In other words, the timing to sync and report as attached differs by
>> orders of magnitude. I am worried that this code might break stuff on
>> older platforms.
> 
> The commits will not check the existence of the peripherals for the
> ACE2.0- platforms. So it should be fine.

ok

>> b) there's nothing in the MIPI spec that says how much time a device
>> should take to report as ATTACHED. A well-intended implementation
>> following Recommendation {2121} would e.g. try to find the sync word
>> with a default frame shape of 48x2, which isn't used at all by Intel.
> 
> Can't we rely on reading device 0 to know whether all peripherals are
> enumerated? Is it possible that a peripheral can be attached after some
> time when all other peripherals on the same bus are attached?

yes that's entirely possible. A peripheral may be extra cautious to
avoid synchronizing on a wrong pattern, and take extra time to report as
Device 0.

> Will it trigger another interrupt in that case? My assumption is that
> a bus will only get one attached interrupt when it starts. And we will
> keep reading the device 0 and programing the device number nutil there
> is no device 0.

yes that's the problem. Worst case you would get N interrupts for each
of the N peripherals.

>> If you want to keep the code above, you absolutely need to record the
>> time at which the bus started and wait TBD ms before signaling
>> enumeration_complete(). You would also need to deal with a case where
>> another device shows up with a delay, would you throw another
>> complete_all() then?
>>
> 
> Can we add a peripheral property to indicate a waiting time and wait the
> largest waiting time of the peripherals?

that would be ideal, but it's not easy to get this sort of information.
This could depend on the clock base and frame shape as well which is
system dependent.

It's probably easier to introduce a default at the bus level and a
kernel parameter to bump that value up in case of problems.

You should also flag the case with a dev_err in case of a second
interrupt, that'd be a clear evidence of the delay not being large enough.

Keeping track of the time since the bus reset completed would help as well.

It's all small potatoes but it'd help harden your solution.


      reply	other threads:[~2026-10-18  8:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15 13:13 Bard Liao
2026-09-15 13:13 ` [PATCH 1/3] soundwire: allow drivers to check whether the peripheral is present Bard Liao
2026-09-15 17:32   ` Cezary Rojewski
2026-09-15 18:31     ` Pierre-Louis Bossart
2026-09-16  2:50       ` Liao, Bard
2026-09-15 13:13 ` [PATCH 2/3] soundwire: change sdw_show_ping_status type to int Bard Liao
2026-09-15 13:13 ` [PATCH 3/3] ASoC: SOF: Intel: wait and verifies the presence of SoundWire peripherals Bard Liao
2026-09-15 19:08 ` [PATCH 0/3] ASoC/soundwire: remove ghost peripherals from the mach table Pierre-Louis Bossart
2026-09-16  4:08   ` Liao, Bard
2026-10-07  2:25     ` Liao, Bard
2026-10-07 16:37       ` Pierre-Louis Bossart
2026-10-08  3:14         ` Liao, Bard
2026-10-08 17:09           ` Pierre-Louis Bossart
2026-10-12 14:46             ` Liao, Bard
2026-10-18  8:25               ` Pierre-Louis Bossart [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=795ed7a1-0610-4215-a0f5-398dbf558704@linux.dev \
    --to=pierre-louis.bossart@linux.dev \
    --cc=bard.liao@intel.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@linaro.org \
    --cc=vkoul@kernel.org \
    --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

all inboxes | Powered by JetHome®