From: Lars-Peter Clausen <lars@metafoo.de>
To: Arnaud Pouliquen <arnaud.pouliquen@st.com>,
Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com
Subject: Re: [PATCH v2 5/9] ASoC: sti: Add platform driver
Date: Wed, 27 May 2015 14:06:20 +0200 [thread overview]
Message-ID: <5565B33C.2000300@metafoo.de> (raw)
In-Reply-To: <556584C4.3080004@st.com>
On 05/27/2015 10:48 AM, Arnaud Pouliquen wrote:
[...]
>>> +static int sti_platform_engine_probe(struct platform_device *pdev)
>>> +{
>>> + /*
>>> + * Driver can not use snd_dmaengine_pcm_register.
>>> + * Reason is that DMA needs to load a firmware.
>>> + * This firmware is loaded on request_channel from file system.
>>> + * So can not be done in probe while alsa card enumerated before
>>> + * file system is mounted
>>> + */
>>
>> This is not the only driver with similar needs, the Intel drivers use
>> firmwares as well (all the DMA is done by the DSP which needs firmware)
>> and even if it were we should be able to arrange for this to work rather
>> than having to open code things. That might mean having the dmaengine
>> driver requesting firmware with _nowait() and then waiting until the
>> firmware appears before registering as a DMA controller for example. We
>> may also be able to have the DMA engine only load the firmware when it's
>> used rather than at probe (that might allow us to keep the DMA
>> controller powered off for longer which would be a power win if possible).
>>
>> It's not just restricted to audio either.
>>
>
> Move dmaengine_pcm_request_chan from register to open could be a good
> compromise with (i hope) no impact on drivers that already use
> soc_generic_dma_engine. This is the implementation already proposed in of
> pcm_dmaengine.c
> Another issue i'm facing, is that i have one DMA channel per CPU_DAI
> instance. As simple card imposes to define CPU_DAIs in one platform device,
> i need to define specific DMA name per CPU_DAI.
> What is your recommendation on this point:
> Do you want that i use snd_dmaengine_pcm_register and propose
> soc_gebneric_dmaengine driver patches?
> or simply reuse pcm_dmaengine helper functions as much as possible.
You really want to request the DMA channels in the probe callback of the
driver (and also use the the generic-dmaengine-pcm driver). This makes sure
that you have proper support for probe deferral, etc. The DMA driver should
probably not request the firmware inside the channel_request() callback. As
Mark sad this will not only affect audio, but all usecases that involve
DMAengine.
Btw. what is the DMA driver you are using, is it already upstream?
- Lars
next prev parent reply other threads:[~2015-05-27 12:06 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-18 12:12 [PATCH v2 0/9] asoc: Add audio for sti platforms Arnaud Pouliquen
2015-05-18 12:12 ` [PATCH v2 1/9] ASoC: sti: add binding for ASoc driver Arnaud Pouliquen
2015-05-22 12:43 ` Mark Brown
2015-05-22 13:24 ` Arnaud Pouliquen
2015-05-25 12:14 ` Mark Brown
2015-05-18 12:12 ` [PATCH v2 2/9] ASoC: sti: Add uniperipheral header file Arnaud Pouliquen
2015-05-18 12:12 ` [PATCH v2 3/9] ASoC: sti: Add CPU DAI driver for playback Arnaud Pouliquen
2015-05-25 12:37 ` Mark Brown
2015-05-26 13:51 ` Arnaud Pouliquen
2015-05-18 12:12 ` [PATCH v2 4/9] ASoC: sti: Add CPU DAI driver for capture Arnaud Pouliquen
2015-05-25 12:39 ` Mark Brown
2015-05-18 12:12 ` [PATCH v2 5/9] ASoC: sti: Add platform driver Arnaud Pouliquen
2015-05-25 12:50 ` Mark Brown
2015-05-27 8:48 ` Arnaud Pouliquen
2015-05-27 12:06 ` Lars-Peter Clausen [this message]
2015-05-18 12:12 ` [PATCH v2 6/9] ASoC: Add ability to build sti drivers Arnaud Pouliquen
2015-05-25 12:50 ` Mark Brown
2015-05-18 12:12 ` [PATCH v2 7/9] ASoC: Codec: Add sti platform codec Arnaud Pouliquen
2015-05-25 13:01 ` Mark Brown
2015-06-01 17:41 ` Arnaud Pouliquen
2015-06-02 19:12 ` Mark Brown
2015-05-18 12:12 ` [PATCH v2 8/9] ASoC: sti: Add clock adjustement control Arnaud Pouliquen
2015-05-25 14:37 ` Mark Brown
2015-05-18 12:12 ` [PATCH v2 9/9] ASoC: sti: Add IEC control Arnaud Pouliquen
2015-05-25 14:36 ` 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=5565B33C.2000300@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=arnaud.pouliquen@st.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.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).