All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Liao, Bard" <bard.liao@intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Bard liao <yung-chuan.liao@linux.intel.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	 "tiwai@suse.de" <tiwai@suse.de>
Cc: "liam.r.girdwood@linux.intel.com"
	<liam.r.girdwood@linux.intel.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"kuninori.morimoto.gx@renesas.com"
	<kuninori.morimoto.gx@renesas.com>
Subject: Re: [alsa-devel] [PATCH RFC v2 4/4] ASoC: add warning if the function is not support multi cpu yet.
Date: Thu, 16 Jan 2020 07:42:11 +0000	[thread overview]
Message-ID: <0dbffd0c1b904a1eb57045ff3b5e40b2@intel.com> (raw)
In-Reply-To: <35fbbfcf-8741-ac4c-56b1-2fd7e19e1a7d@linux.intel.com>



> -----Original Message-----
> From: Pierre-Louis Bossart [mailto:pierre-louis.bossart@linux.intel.com]
> Sent: Thursday, January 16, 2020 9:50 AM
> To: Bard liao <yung-chuan.liao@linux.intel.com>; broonie@kernel.org;
> tiwai@suse.de
> Cc: liam.r.girdwood@linux.intel.com; alsa-devel@alsa-project.org; Liao, Bard
> <bard.liao@intel.com>; kuninori.morimoto.gx@renesas.com
> Subject: Re: [alsa-devel] [PATCH RFC v2 4/4] ASoC: add warning if the function is
> not support multi cpu yet.
> 
> 
> 
> On 1/14/20 11:51 AM, Bard liao wrote:
> > Multi cpu is not supported by all functions yet. Add a warning message
> > to warn it.
> 
> Shouldn't we be consistent and return an error when we have an unexpected
> number of cpu dais? see below
> 
> >
> > Suggested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com>
> > ---
> >   sound/soc/soc-compress.c              |  7 ++++---
> >   sound/soc/soc-generic-dmaengine-pcm.c | 12 ++++++++++++
> >   sound/soc/soc-pcm.c                   | 12 ++++++++++++
> >   3 files changed, 28 insertions(+), 3 deletions(-)
> >
> > diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index
> > 223cd045719e..bf9d6a21bcd9 100644
> > --- a/sound/soc/soc-compress.c
> > +++ b/sound/soc/soc-compress.c
> > @@ -810,10 +810,11 @@ int snd_soc_new_compress(struct
> snd_soc_pcm_runtime *rtd, int num)
> >   	int playback = 0, capture = 0;
> >   	int i;
> >
> > -	if (rtd->num_codecs > 1) {
> > +	if (rtd->num_cpus > 1 ||
> > +	    rtd->num_codecs) {
> >   		dev_err(rtd->card->dev,
> > -			"Compress ASoC: Multicodec not supported\n");
> > -		return -EINVAL;
> > +			"Compress ASoC: Multi CPU/Codec not supported\n");
> > +		return -ENOTSUPP;
> 
> so this is an error...

Changing to -ENOTSUPP will prevent below to return error in
soc_init_pcm_runtime().

/* create compress_device if possible */
ret = snd_soc_dai_compress_new(cpu_dai, rtd, num);
if (ret != -ENOTSUPP) {
	if (ret < 0)
		dev_err(card->dev, "ASoC: can't create compress %s\n",
			dai_link->stream_name);
	return ret;
}

So it is to prevent an error actually. But I agree it is better to return
an error when we have an unexpected number of cpu dais. What do you
think? @Morimoto-san

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2020-01-16  7:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14 17:51 [alsa-devel] [PATCH RFC v2 0/4] ASoC: Add Multi CPU DAI support Bard liao
2020-01-14 17:51 ` [alsa-devel] [PATCH RFC v2 1/4] ASoC: Add initial support for multiple CPU DAIs Bard liao
2020-01-14 17:51 ` [alsa-devel] [PATCH RFC v2 2/4] ASoC: Add multiple CPU DAI support for PCM ops Bard liao
2020-01-16  1:48   ` Pierre-Louis Bossart
2020-01-16  2:05     ` Liao, Bard
2020-01-16  2:25       ` Pierre-Louis Bossart
2020-01-14 17:51 ` [alsa-devel] [PATCH RFC v2 3/4] ASoC: Add multiple CPU DAI support in DAPM Bard liao
2020-01-14 17:51 ` [alsa-devel] [PATCH RFC v2 4/4] ASoC: add warning if the function is not support multi cpu yet Bard liao
2020-01-16  1:49   ` Pierre-Louis Bossart
2020-01-16  7:42     ` Liao, Bard [this message]
2020-01-17  0:45       ` Kuninori Morimoto
2020-01-15  6:11 ` [alsa-devel] [PATCH RFC v2 0/4] ASoC: Add Multi CPU DAI support Kuninori Morimoto
2020-01-15 22:13 ` Pierre-Louis Bossart
2020-01-16  0:47   ` Kuninori Morimoto
2020-01-16  1:20     ` Pierre-Louis Bossart
2020-01-16  1:52 ` Pierre-Louis Bossart

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=0dbffd0c1b904a1eb57045ff3b5e40b2@intel.com \
    --to=bard.liao@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    --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 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.