diff mbox series

[RFC,2/4] ALSA: hda: hdac_stream: reset assigned_key in stream_release()

Message ID 20210924192417.169243-3-pierre-louis.bossart@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series ALSA: hda: potential hdac_stream locking issues? | expand

Commit Message

Pierre-Louis Bossart Sept. 24, 2021, 7:24 p.m. UTC
The 'assigned_key' field is set in assign() and never reset. For
symmetry set to zero in release().

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/hda/hdac_stream.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Takashi Iwai Sept. 28, 2021, 6:10 a.m. UTC | #1
On Fri, 24 Sep 2021 21:24:15 +0200,
Pierre-Louis Bossart wrote:
> 
> The 'assigned_key' field is set in assign() and never reset. For
> symmetry set to zero in release().

This is intentional behavior.  We want to assign to the same stream
persistently unless it has to be reassigned to another.


thanks,

Takashi

> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---
>  sound/hda/hdac_stream.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c
> index 9867555883c3..3ae23c50d505 100644
> --- a/sound/hda/hdac_stream.c
> +++ b/sound/hda/hdac_stream.c
> @@ -333,6 +333,7 @@ void snd_hdac_stream_release(struct hdac_stream *azx_dev)
>  	spin_lock_irq(&bus->reg_lock);
>  	azx_dev->opened = 0;
>  	azx_dev->running = 0;
> +	azx_dev->assigned_key = 0;
>  	azx_dev->substream = NULL;
>  	spin_unlock_irq(&bus->reg_lock);
>  }
> -- 
> 2.25.1
>
diff mbox series

Patch

diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c
index 9867555883c3..3ae23c50d505 100644
--- a/sound/hda/hdac_stream.c
+++ b/sound/hda/hdac_stream.c
@@ -333,6 +333,7 @@  void snd_hdac_stream_release(struct hdac_stream *azx_dev)
 	spin_lock_irq(&bus->reg_lock);
 	azx_dev->opened = 0;
 	azx_dev->running = 0;
+	azx_dev->assigned_key = 0;
 	azx_dev->substream = NULL;
 	spin_unlock_irq(&bus->reg_lock);
 }