public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, andriy.shevchenko@intel.com,
	Daniel Baluta <daniel.baluta@gmail.com>,
	liam.r.girdwood@linux.intel.com, vkoul@kernel.org,
	broonie@kernel.org, Alan Cox <alan@linux.intel.com>,
	sound-open-firmware@alsa-project.org
Subject: Re: [Sound-open-firmware] [PATCH v3 05/14] ASoC: SOF: Add PCM operations support
Date: Wed, 12 Dec 2018 09:29:23 -0600	[thread overview]
Message-ID: <0e727a47-26b1-7772-1a8c-ca49a0e805af@linux.intel.com> (raw)
In-Reply-To: <s5hd0q7uq5l.wl-tiwai@suse.de>


On 12/12/18 2:04 AM, Takashi Iwai wrote:
> On Tue, 11 Dec 2018 22:23:09 +0100,
> Pierre-Louis Bossart wrote:
>> +	/* number of pages should be rounded up */
>> +	if (runtime->dma_bytes % PAGE_SIZE)
>> +		pcm.params.buffer.pages = (runtime->dma_bytes / PAGE_SIZE) + 1;
>> +	else
>> +		pcm.params.buffer.pages = runtime->dma_bytes / PAGE_SIZE;
> There is likely some nice macro for this :)
Yes, will fix.
>
>> +	/* firmware already configured host stream */
>> +	ret = snd_sof_pcm_platform_hw_params(sdev,
>> +					     substream,
>> +					     params,
>> +					     &pcm.params);
>> +	dev_dbg(sdev->dev, "stream_tag %d", pcm.params.stream_tag);
> This error can be ignored?
will double-check.
>
>> +	/* send IPC to the DSP */
>> +	ret = sof_ipc_tx_message(sdev->ipc, pcm.hdr.cmd, &pcm, sizeof(pcm),
>> +				 &ipc_params_reply, sizeof(ipc_params_reply));
> This error value isn't evaluated immediately but passed until the
> last.  Is it intentional?
Not sure, will double-check. Now that I read the code again this looks 
odds, and if it was intentional then we need an explicit comment. Thanks 
for the sighting.
>
>> +	/* validate offset */
>> +	posn_offset = ipc_params_reply.posn_offset;
>> +
>> +	/* check if offset is overflow or it is not aligned */
>> +	if (posn_offset > sdev->stream_box.size ||
>> +	    posn_offset % sizeof(struct sof_ipc_stream_posn) != 0) {
>> +		dev_err(sdev->dev, "error: got wrong posn offset 0x%x for PCM %d\n",
>> +			posn_offset, ret);
>> +		return ret;
> Here you return an error after checking more things.
>
>> +	}
>> +	spcm->posn_offset[substream->stream] =
>> +		sdev->stream_box.offset + posn_offset;
>> +
>> +	/* save pcm hw_params */
>> +	memcpy(&spcm->params[substream->stream], params, sizeof(*params));
>> +
>> +	return ret;
> Even here returns an error after saving as if done properly.
will double-check this entire sequence.
>
>
>> +static int sof_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
>> +{
> ....
>> +	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
>> +
>> +		/* check if the stream hw_params needs to be restored */
>> +		if (spcm->restore_stream[substream->stream]) {
>> +
>> +			/* restore hw_params */
>> +			ret = sof_restore_hw_params(substream, spcm, sdev);
> This calls the hw_params that is supposed to be non-atomic.
>
>> +	snd_sof_pcm_platform_trigger(sdev, substream, cmd);
>> +
>> +	/* send IPC to the DSP */
>> +	ret = sof_ipc_tx_message(sdev->ipc, stream.hdr.cmd, &stream,
>> +				 sizeof(stream), &reply, sizeof(reply));
>> +
>> +	return ret;
> ... so the whole trigger action is non-atomic PCM only?
Not sure if I fully understand your point here. The trigger does indeed 
need an IPC to proceed, but the front-ends are marked as such with the 
.nonatomic field set to true. Not sure how different this is from 
existing atom/sst or Skylake drivers.

  parent reply	other threads:[~2018-12-12 15:29 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11 21:23 [PATCH v3 00/14] Sound Open Firmware (SOF) core Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 01/14] ASoC: SOF: Add Sound Open Firmware driver core Pierre-Louis Bossart
2018-12-11 22:20   ` Andy Shevchenko
2018-12-11 23:20     ` Pierre-Louis Bossart
2018-12-12  7:51   ` Takashi Iwai
2018-12-12 14:53     ` Pierre-Louis Bossart
2018-12-12 20:42   ` Daniel Baluta
2018-12-12 22:35     ` Pierre-Louis Bossart
2019-01-29 16:49   ` Daniel Baluta
2019-01-30 16:12     ` Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 02/14] ASoC: SOF: Add Sound Open Firmware KControl support Pierre-Louis Bossart
2018-12-11 22:23   ` Andy Shevchenko
2018-12-11 22:48     ` Pierre-Louis Bossart
2018-12-11 23:25       ` Andy Shevchenko
2018-12-12 20:18     ` Pierre-Louis Bossart
2018-12-12  7:35   ` Takashi Iwai
2018-12-12 15:01     ` Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 03/14] ASoC: SOF: Add driver debug support Pierre-Louis Bossart
2018-12-11 22:32   ` Andy Shevchenko
2018-12-11 23:29     ` Pierre-Louis Bossart
2019-01-09 19:40   ` Mark Brown
2019-01-10 20:47     ` Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 04/14] ASoC: SOF: Add support for IPC IO between DSP and Host Pierre-Louis Bossart
2018-12-11 22:57   ` Andy Shevchenko
2018-12-11 23:38     ` Pierre-Louis Bossart
2018-12-12  8:17   ` Takashi Iwai
2018-12-12 15:19     ` Pierre-Louis Bossart
2018-12-12 15:34       ` Takashi Iwai
2018-12-13  5:24       ` Keyon Jie
2018-12-13  7:48         ` Takashi Iwai
2018-12-13  9:13           ` Keyon Jie
2018-12-13  8:06         ` Keyon Jie
2018-12-13  8:59           ` rander.wang
2019-01-09 20:37   ` Mark Brown
2019-01-10 20:11     ` Pierre-Louis Bossart
2019-01-22 19:04       ` Mark Brown
2019-01-22 21:05         ` Pierre-Louis Bossart
2019-01-22 21:13           ` Mark Brown
2019-01-23  5:51           ` [Sound-open-firmware] " Keyon Jie
2019-01-14 15:10   ` Daniel Baluta
2019-01-14 17:39     ` Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 05/14] ASoC: SOF: Add PCM operations support Pierre-Louis Bossart
2018-12-12  8:04   ` Takashi Iwai
2018-12-12 13:12     ` Andy Shevchenko
2018-12-12 15:29     ` Pierre-Louis Bossart [this message]
2018-12-12 15:43       ` [Sound-open-firmware] " Takashi Iwai
2018-12-12 16:10         ` Pierre-Louis Bossart
2018-12-12 22:09   ` Daniel Baluta
2018-12-11 21:23 ` [PATCH v3 06/14] ASoC: SOF: Add support for loading topologies Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 07/14] ASoC: SOF: Add DSP firmware logger support Pierre-Louis Bossart
2018-12-11 23:21   ` Andy Shevchenko
2018-12-11 23:43     ` Pierre-Louis Bossart
2018-12-12  6:44       ` Takashi Iwai
2018-12-12 11:11   ` Takashi Iwai
2018-12-12 16:04     ` [Sound-open-firmware] " Pierre-Louis Bossart
2018-12-12 16:12       ` Takashi Iwai
2018-12-12 17:01         ` Pierre-Louis Bossart
2019-01-09 20:44   ` Mark Brown
2019-01-09 21:39     ` Pierre-Louis Bossart
2019-01-22 18:57       ` Mark Brown
2019-01-22 20:33         ` Pierre-Louis Bossart
2019-01-22 20:41           ` Mark Brown
2019-01-22 20:52             ` Pierre-Louis Bossart
2019-01-22 21:08               ` Mark Brown
2019-01-22 21:13                 ` Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 08/14] ASoC: SOF: Add DSP HW abstraction operations Pierre-Louis Bossart
2018-12-11 23:16   ` Andy Shevchenko
2018-12-11 23:45     ` Pierre-Louis Bossart
2019-01-09 20:51   ` Mark Brown
2019-01-09 21:37     ` Pierre-Louis Bossart
2019-01-22 18:56       ` Mark Brown
2018-12-11 21:23 ` [PATCH v3 09/14] ASoC: SOF: Add firmware loader support Pierre-Louis Bossart
2018-12-11 22:38   ` Andy Shevchenko
2018-12-11 23:54     ` Pierre-Louis Bossart
2019-01-09 20:55       ` Mark Brown
2018-12-12 11:23   ` Takashi Iwai
2018-12-12 16:06     ` [Sound-open-firmware] " Pierre-Louis Bossart
2019-01-09 21:02   ` Mark Brown
2019-01-09 21:24     ` Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 10/14] ASoC: SOF: Add userspace ABI support Pierre-Louis Bossart
2018-12-21 11:10   ` Daniel Baluta
2018-12-21 14:59     ` [Sound-open-firmware] " Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 11/14] ASoC: SOF: Add PM support Pierre-Louis Bossart
2018-12-12 11:32   ` Takashi Iwai
2018-12-12 16:08     ` Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 12/14] ASoC: SOF: Add Nocodec machine driver support Pierre-Louis Bossart
2018-12-11 21:23 ` [PATCH v3 13/14] ASoC: SOF: Add xtensa support Pierre-Louis Bossart
2018-12-11 23:08   ` Andy Shevchenko
2018-12-12  0:00     ` Pierre-Louis Bossart
     [not found]       ` <93aff9af-c693-c951-4821-e9e334133ed0@linux.intel.com>
2018-12-13  9:58         ` [Sound-open-firmware] " rander.wang
2018-12-17 13:45           ` Takashi Iwai
2018-12-17 14:24             ` Mark Brown
2018-12-11 21:23 ` [PATCH v3 14/14] ASoC: SOF: Add utils Pierre-Louis Bossart
2018-12-11 23:06   ` Andy Shevchenko
2018-12-12  0:06     ` 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=0e727a47-26b1-7772-1a8c-ca49a0e805af@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alan@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@gmail.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=sound-open-firmware@alsa-project.org \
    --cc=tiwai@suse.de \
    --cc=vkoul@kernel.org \
    /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