From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Vinod Koul <vkoul@kernel.org>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Sanyog Kale <sanyog.r.kale@intel.com>,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Banajit Goswami <bgoswami@quicinc.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org,
linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org
Subject: Re: [PATCH 1/2] ASoC: qcom: Add helper for allocating Soundwire stream runtime
Date: Wed, 29 Nov 2023 10:46:52 -0600 [thread overview]
Message-ID: <598015b0-68e1-434c-96d3-571040a3814e@linux.intel.com> (raw)
In-Reply-To: <5ffed1e6-ac60-42e1-8322-4f5e419ef86d@linaro.org>
On 11/29/23 10:35, Krzysztof Kozlowski wrote:
> On 28/11/2023 18:39, Pierre-Louis Bossart wrote:
>>
>>> +int qcom_snd_sdw_startup(struct snd_pcm_substream *substream)
>>> +{
>>> + struct snd_soc_pcm_runtime *rtd = substream->private_data;
>>> + struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
>>> + struct sdw_stream_runtime *sruntime;
>>> + struct snd_soc_dai *codec_dai;
>>> + int ret, i;
>>> +
>>> + sruntime = sdw_alloc_stream(cpu_dai->name);
>>> + if (!sruntime)
>>> + return -ENOMEM;
>>> +
>>> + for_each_rtd_codec_dais(rtd, i, codec_dai) {
>>> + ret = snd_soc_dai_set_stream(codec_dai, sruntime,
>>> + substream->stream);
>>> + if (ret < 0 && ret != -ENOTSUPP) {
>>
>> I know this is existing code moved into a helper, but out of curiosity
>> why is -ENOTSUPP ignored? Isn't this problematic?
>
> This is for all DAI links, so if some don't have set_stream callback, we
> assume it is not needed. For example few codecs do not need it because
> they are not on Soundwire bus at all and they don't care about the stream.
Humm, it was my understanding that the substream is mapped 1:1 with a
dailink, so not sure how SoundWire and non-SoundWire DAIs could be part
of the same dailink?
I am not saying this test is silly, just wondering if there is any case
where this error code is returned. Worst-case it's always false but
harmless.
>>
>>> + dev_err(rtd->dev, "Failed to set sdw stream on %s\n",
>>> + codec_dai->name);
>>> + goto err_set_stream;
>>> + }
>>> + }
>>
>> Also should the CPU DAIs also be used to set the stream information?
>> it's not clear to me why only the CODEC DAIs are used.
>
> I don't know, we never did. As you pointed out, I am just moving things
> around, so I don't really know the original intention.
Fair enough, I've been in your shoes :-)
Not always easy to grade 3+ yr code as 'miss', 'bug', 'optimization' or
'feature'...
next prev parent reply other threads:[~2023-11-29 18:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-28 16:56 [PATCH 1/2] ASoC: qcom: Add helper for allocating Soundwire stream runtime Krzysztof Kozlowski
2023-11-28 16:56 ` [PATCH 2/2] ASoC: qcom: Move Soundwire runtime stream alloc to soundcards Krzysztof Kozlowski
2023-11-28 16:59 ` Krzysztof Kozlowski
2023-11-28 17:49 ` Pierre-Louis Bossart
2023-11-28 17:47 ` Pierre-Louis Bossart
2023-11-28 17:39 ` [PATCH 1/2] ASoC: qcom: Add helper for allocating Soundwire stream runtime Pierre-Louis Bossart
2023-11-29 16:35 ` Krzysztof Kozlowski
2023-11-29 16:46 ` Pierre-Louis Bossart [this message]
2023-11-30 11:23 ` Mark Brown
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=598015b0-68e1-434c-96d3-571040a3814e@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=agross@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=andersson@kernel.org \
--cc=bgoswami@quicinc.com \
--cc=broonie@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=sanyog.r.kale@intel.com \
--cc=srinivas.kandagatla@linaro.org \
--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;
as well as URLs for NNTP newsgroup(s).