From: Cezary Rojewski <cezary.rojewski@intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
Vinod Koul <vkoul@kernel.org>
Cc: <linux-sound@vger.kernel.org>, <broonie@kernel.org>,
<tiwai@suse.com>, <perex@perex.cz>, <amade@asmblr.net>,
<linux-kernel@vger.kernel.org>, <yung-chuan.liao@linux.intel.com>
Subject: Re: [PATCH v2 0/7] ASoC: Intel: avs: Soundwire support
Date: Wed, 4 Nov 2026 22:02:42 +0100 [thread overview]
Message-ID: <54b9b19e-7513-49cb-8367-8ef7711ac918@intel.com> (raw)
In-Reply-To: <259d0c79-2a36-4a36-8e7c-fa24137a02bd@linux.dev>
On 11/4/2026 9:20 PM, Pierre-Louis Bossart wrote:
> On 11/4/26 15:31, Cezary Rojewski wrote:
>> On 11/4/2026 2:33 PM, Vinod Koul wrote:
>>> On 04-11-26, 12:52, Pierre-Louis Bossart wrote:
>>>> On 11/4/26 10:14, Cezary Rojewski wrote:
>>>>> On 11/3/2026 6:20 PM, Pierre-Louis Bossart wrote:
>>>>>>
>>>>>>> Also, the existing code fetches the PDIs based on pre-defined "dai_id".
>>>>>>> That's not the case for the avs-driver. It simply asks: "is any PDI
>>>>>>> free?" and assigns it for the substream if one is found.
>>>>>>> No predefining. Again, this aligns with how HDAudio streaming is done.
>>>>>> Yeah but at the end of the day there's a 1:1 mapping between cpu_dai and
>>>>>> PDI, no?
>>>>>>
>>>>>> All PDIs are created equal, a dynamic mapping doesn't make things more
>>>>>> efficient. It just makes things more complex to debug since you don't
>>>>>> have a fixed mapping between dailinks/stream/cpu_dai/PDI.
>>>>>>
>>>>>> Put differently, couldn't the AVS driver work around that fixed mapping
>>>>>> to avoid changes to legacy platforms that have shipped many moons ago?
>>>>>
>>>>> Kind disagree on the debugging part. Having SDW streaming follow
>>>>> closely to what is done for HDAudio from the beginning (no hardcodes)
>>>>> makes it easier for a developer to debug stuff. OTOH if one of these
>>>>> two follows a completely different path, the developer has to have such
>>>>> hardcodes in mind when debugging the PCM code or even when looking at
>>>>> the topology.
>>>>>
>>>>> At the same time, I'm not going anywhere and I do intend to work with
>>>>> Peter and Kai to update the common code. Simply put, such a refactor
>>>>> would be routed through SOF GH first.
>>>> The machine driver selects the first available cpu_dai when creating a
>>>> dailink. It doesn't really add much value to add a second level of
>>>> freedom to select PDIs, since in practice it'll select the first as
>>>> well. PDIs have no moral equivalent in HDaudio, it's a Cadence-specific IP.
>>>>
>>>> Also there is already a degree of freedom in the allocation of
>>>> stream_tag, which is used for DMA support. That one makes sense since
>>>> DMAs may be used for non-SoundWire things (HDMI, trace, probe, etc).
>>>>
>>>> That's 2 degrees of freedom on 3 levels, do you really need full
>>>> configurability?
>>
>> I'm not following this "level of freedom" notion. What's part of this
>> set is a basic allocation - driver (a user of the soundwire-lib) comes
>> and ask for a free resource (PDI). If there is one, it gets assigned.
>> Very standard, how many expect resources are redistributed.
>
> You're missing a level. The platform driver exposes a set of DAIs, and
> then the machine driver will decide which dai it needs for a specific
> dailink/stream. That's the part that really matters IMHO.
>
> The choice of the PDI is done only internally in the Intel platform
> driver, and it really doesn't matter how you map cpu_dais to PDIs. A
> fixed mapping is just as good as a dynamic approach - same results,
> maybe less elegant but the performance is identical.
While I'm still missing why the machine driver layer is mentioned here,
I guess we agree on the fact that basic allocation approach is more
elegant. Never claimed performance is better.
>>> I dont see any gain from this approach. I would reconsider and see if we
>>> can reuse things
>>>
>>
>> I'm not sure which way the last message goes.
>>
>> However, I find it easier to move from hardcodes to the basic allocation
>> approach (seen here, in this very patchset) than the other way around.
>> The change would consist of updating intel_hw_params() so the PDI
>> allocation is no longer done there.
>
> Change is risky, especially when this touches platforms all the way to
> CNL across at least 3 generations of Intel hardware since 2018, for no
> tangible benefit.
Well, that's why I don't want to mix the 2 patchsets. However, I'm of
those who is not afraid of editing code that touches older platform - my
intention wouldn't be to level the code, obviously. From functional
perspective it should reach status quo. And both teams have their CIs.
Now, I assume most of the discussion touches on patch 2/7, the one with
sdw_cdns_assign_pdi()/release_pdi(). The main suspect:
intel_hw_params(dai)
alloc_pdi()
config_pdi()
params_hook()
is a DAI operation, represents dai->hw_params(). The params hook is
there to give SOF some location to send IPC from. If intel_hw_params()
is split, there is no need for hooks. Such hooks are certainly not elegant.
I believe the way forward is to convert DAI ops present in intel.c to
library-type functions. Let platform components call these. Frankly,
except for our friend, intel_hw_params(), one could say they already are
- perhaps the whole intel_pcm_dai_ops could be dropped.
Kind regards,
Czarek
next prev parent reply other threads:[~2026-11-04 21:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 13:49 Cezary Rojewski
2026-11-03 13:49 ` [PATCH v2 1/7] soundwire: intel: Define stubs when library is disabled Cezary Rojewski
2026-11-03 13:49 ` [PATCH v2 2/7] soundwire: intel: Allow for dynamic assignment of PDIs Cezary Rojewski
2026-11-03 13:49 ` [PATCH v2 3/7] soundwire: intel: Split PDIs and DAIs initialization Cezary Rojewski
2026-11-03 13:49 ` [PATCH v2 4/7] ASoC: Intel: avs: Pass irq to dsp_interrupt callback Cezary Rojewski
2026-11-03 13:49 ` [PATCH v2 5/7] ASoC: Intel: avs: SoundWire support Cezary Rojewski
2026-11-03 13:49 ` [PATCH v2 6/7] ASoC: Intel: avs: Expose common PCM functions Cezary Rojewski
2026-11-03 13:49 ` [PATCH v2 7/7] ASoC: Intel: avs: SoundWire PCM BE operations Cezary Rojewski
2026-11-03 17:20 ` [PATCH v2 0/7] ASoC: Intel: avs: Soundwire support Pierre-Louis Bossart
2026-11-04 9:14 ` Cezary Rojewski
2026-11-04 11:52 ` Pierre-Louis Bossart
2026-11-04 13:33 ` Vinod Koul
2026-11-04 14:31 ` Cezary Rojewski
2026-11-04 20:20 ` Pierre-Louis Bossart
2026-11-04 21:02 ` Cezary Rojewski [this message]
2026-11-05 9:01 ` Pierre-Louis Bossart
2026-11-05 9:52 ` Cezary Rojewski
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=54b9b19e-7513-49cb-8367-8ef7711ac918@intel.com \
--to=cezary.rojewski@intel.com \
--cc=amade@asmblr.net \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.dev \
--cc=tiwai@suse.com \
--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®