Alsa-Devel Archive on lore.kernel.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, broonie@kernel.org,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>
Subject: Re: [PATCH 8/8] ASoC: SOF: Intel: add .ack support for HDaudio platforms
Date: Mon, 12 Jul 2021 16:30:58 -0500	[thread overview]
Message-ID: <de5e91c6-5f0e-9866-a1c2-0943b4342359@linux.intel.com> (raw)
In-Reply-To: <s5h35tm5ij5.wl-tiwai@suse.de>



>> +/* update SPIB register with appl position */
>> +int hda_dsp_pcm_ack(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream)
>> +{
>> +	struct hdac_stream *hstream = substream->runtime->private_data;
>> +	struct hdac_ext_stream *stream = stream_to_hdac_ext_stream(hstream);
>> +	struct snd_pcm_runtime *runtime = substream->runtime;
>> +	ssize_t appl_pos, buf_size;
>> +	u32 spib;
>> +
>> +	if (!hda_disable_rewinds)
>> +		return 0;
>> +
>> +	/*
>> +	 * paranoia check: if a rewind request took place after the RUN bits were programmed,
>> +	 * deny it since hardware only supports monotonic (modulo) increments for SPIB.
>> +	 */
>> +	if (hstream->running) {
>> +		if (runtime->control->appl_ptr < stream->old_appl_ptr)
>> +			return -EINVAL;
> 
> This condition won't be enough when the appl_ptr overlap the buffer
> boundary.  It's still possible on 32bit architecture.

And I missed this feedback as well...I only replied at the comments on module parameters/KConfig/controls/new API.

Takashi, is this saying that on 32-bit architectures there's no way to make the difference in the .ack implementation between
- regular rewind and forward after the buffer max boundary
- regular forward and rewind before the buffer zero boundary

If that was the case, the proposal made in this patch to validate the rewind with the .ack wouldn't work, we would have to go back to a filter in snd_pcm_rewind similar to what was initially suggested in [1]

[1] https://lore.kernel.org/alsa-devel/1494896518-23399-2-git-send-email-subhransu.s.prusty@intel.com/

  reply	other threads:[~2021-07-12 21:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 20:53 [PATCH 0/8] ASoC: SOF: power optimizations for HDaudio platforms Pierre-Louis Bossart
2021-06-10 20:53 ` [PATCH 1/8] ASoC: SOF: Intel: Kconfig: clarify DMI L1 option description Pierre-Louis Bossart
2021-06-10 20:53 ` [PATCH 2/8] ASoC: SOF: Intel: simplify logic for DMI_L1 handling Pierre-Louis Bossart
2021-06-10 20:53 ` [PATCH 3/8] ASoC: SOF: pcm: add mechanisms to disable ALSA pause_push/release Pierre-Louis Bossart
2021-06-10 20:53 ` [PATCH 4/8] ASoC: SOF: Intel: add kernel parameter to set DMI L1 configuration Pierre-Louis Bossart
2021-06-10 20:53 ` [PATCH 5/8] ASoC: SOF: Intel: enable DMI L1 when pause is not supported Pierre-Louis Bossart
2021-06-10 20:53 ` [PATCH 6/8] ALSA: pcm: conditionally avoid mmap of control data Pierre-Louis Bossart
2021-06-13  7:28   ` Takashi Iwai
2021-07-12 20:56     ` Pierre-Louis Bossart
2021-07-13  6:17       ` Takashi Iwai
2021-07-13 12:39         ` Pierre-Louis Bossart
2021-06-10 20:53 ` [PATCH 7/8] ASOC: SOF: pcm: add .ack callback support Pierre-Louis Bossart
2021-06-10 20:53 ` [PATCH 8/8] ASoC: SOF: Intel: add .ack support for HDaudio platforms Pierre-Louis Bossart
2021-06-13  7:29   ` Takashi Iwai
2021-07-12 21:30     ` Pierre-Louis Bossart [this message]
2021-06-11  7:58 ` [PATCH 0/8] ASoC: SOF: power optimizations " Takashi Iwai
2021-06-11  9:02   ` Jaroslav Kysela
2021-06-11 14:32     ` Pierre-Louis Bossart
2021-06-11 15:37       ` Jaroslav Kysela
2021-06-11 16:30         ` Pierre-Louis Bossart
2021-06-13  7:25           ` Takashi Iwai

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=de5e91c6-5f0e-9866-a1c2-0943b4342359@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=tiwai@suse.de \
    /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