All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Vinod Koul <vinod.koul@intel.com>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org, alan@linux.intel.com,
	Harsha Priya <priya.harsha@intel.com>,
	lrg@slimlogic.co.uk
Subject: Re: [PATCH 2/4] ASoC sst: Add mid platform driver
Date: Sun, 2 Jan 2011 13:41:34 +0000	[thread overview]
Message-ID: <20110102134134.GD4935@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1293707573-8340-1-git-send-email-vinod.koul@intel.com>

On Thu, Dec 30, 2010 at 04:42:53PM +0530, Vinod Koul wrote:

> +	case SNDRV_PCM_TRIGGER_START:
> +		pr_debug("sst: Trigger Start\n");
> +		ret_val = stream->sstdrv_ops->control_set(
> +						SST_SND_START, &str_id);
> +		if (ret_val)
> +			return ret_val;
> +		stream->stream_status = RUNNING;
> +		stream->stream_info.mad_substream = substream;
> +		break;

You've no locking in the rest of the driver protecting the variables
you're updating here.

> +
> +	stream = substream->runtime->private_data;
> +	if (stream->stream_status == INIT)
> +		return 0;
> +	str_info = &stream->stream_info;
> +	ret_val = stream->sstdrv_ops->control_set(
> +				SST_SND_BUFFER_POINTER, &str_info);
> +	if (ret_val) {
> +		pr_err("sst: error code = 0x%x\n", ret_val);
> +		return ret_val;
> +	}
> +
> +	return stream->stream_info.buffer_ptr;

I suspect you need to return bytes_to_frames() of this...

> +	pr_debug("intelmid_platform_probe called\n");
> +	ret = snd_soc_register_platform(&pdev->dev, &intelmid_soc_platform_drv);
> +	if (ret) {
> +		pr_err("registering soc platform failed\n");
> +		return ret;
> +	}
> +	return snd_soc_register_dais(&pdev->dev,
> +				mfld_dai, ARRAY_SIZE(mfld_dai));

You're not unwinding the platform register if the DAI registration
fail.s

> +MODULE_LICENSE("GPL v2");
> +MODULE_ALIAS("mid-platform");

Same issue as with the CODEC driver here.

> +int snd_intelmad_alloc_stream(struct snd_pcm_substream *substream);
> +int snd_intelmad_init_stream(struct snd_pcm_substream *substream);

Why are these exposed here?

> +enum mid_drv_status {
> +	INIT = 1,
> +	STARTED,
> +	RUNNING,
> +	PAUSED,
> +	DROPPED,
> +};

Namespacing.

  reply	other threads:[~2011-01-02 13:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-30 11:12 [PATCH 2/4] ASoC sst: Add mid platform driver Vinod Koul
2011-01-02 13:41 ` Mark Brown [this message]
2011-01-03  5:33   ` Koul, Vinod
2011-01-03 15:28     ` Mark Brown
2011-01-03 15:37       ` Koul, Vinod

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=20110102134134.GD4935@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alan@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=priya.harsha@intel.com \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@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.