All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>,
	Stephen Warren <swarren@nvidia.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Michael Wei Hong Sit <michael.wei.hong.sit@intel.com>
Subject: Re: [PATCH] ASoC: dmaengine: Document support for TX only or RX only streams
Date: Fri, 9 Oct 2020 13:31:24 +0300	[thread overview]
Message-ID: <20201009103124.GT4077@smile.fi.intel.com> (raw)
In-Reply-To: <20201009102751.GS4077@smile.fi.intel.com>

On Fri, Oct 09, 2020 at 01:27:51PM +0300, Andy Shevchenko wrote:
> On Thu, Oct 08, 2020 at 05:11:05PM +0100, Mark Brown wrote:
> > We intentionally do not return an error if we get a permanent failure
> > from dma_request_chan() in order to support systems which have TX only
> > or RX only channels. Add a comment documenting this.

> > --- a/sound/soc/soc-generic-dmaengine-pcm.c
> > +++ b/sound/soc/soc-generic-dmaengine-pcm.c
> > @@ -386,6 +386,11 @@ static int dmaengine_pcm_request_chan_of(struct dmaengine_pcm *pcm,
> >  			name = config->chan_names[i];
> >  		chan = dma_request_chan(dev, name);
> >  		if (IS_ERR(chan)) {
> > +			/*
> > +			 * Only report probe deferral errors, channels
> > +			 * might not be present for devices that
> > +			 * support only TX or only RX.
> > +			 */
> >  			if (PTR_ERR(chan) == -EPROBE_DEFER)
> >  				return -EPROBE_DEFER;
> >  			pcm->chan[i] = NULL;

Now I would like to continue discussion from this point.

What is the best way for individual ASoC drivers to be sure that at load time
they have or have not DMA resources available?

Now, seems the approach is to check dma-names property present and thus, try to
switch to DMA mode, otherwise PIO. But this seems to me a bit fragile. Why ASoC
core can't simple recognize DMA resources as optional (for the drivers that
want to know if they available or not)?

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2020-10-09 10:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-08 16:11 [PATCH] ASoC: dmaengine: Document support for TX only or RX only streams Mark Brown
2020-10-09 10:27 ` Andy Shevchenko
2020-10-09 10:31   ` Andy Shevchenko [this message]
2020-10-12 13:37     ` Mark Brown
2020-10-12 13:55       ` Andy Shevchenko
2020-10-12 15:48         ` Mark Brown
2020-10-12 16:31           ` Andy Shevchenko
2020-10-12 18:26             ` Mark Brown
2020-10-13 13:02               ` Andy Shevchenko
2020-10-09 15:01 ` 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=20201009103124.GT4077@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=michael.wei.hong.sit@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=swarren@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.