# Re: \[PATCH 45/50\] sound: usb: usx2y: spin\_lock in complete() cleanup

- From: Sergei Shtylyov \<hidden\>
- Date: 2013-07-11 13:08:34 
- List: netdev
- Page: https://ratatoskr.run/netdev/2013/07/8368779
- Thread: https://ratatoskr.run/linux-input/2013/07/8368719/t.md

```text
On 11-07-2013 13:06, Ming Lei wrote:

> Complete() will be run with interrupt enabled, so change to
> spin_lock_irqsave().

   Changelog doesn't match the patch.

> Cc: Jaroslav Kysela <perex@perex.cz>
> Cc: Takashi Iwai <redacted>
> Cc: <redacted>
> Signed-off-by: Ming Lei <redacted>
> ---
>   sound/usb/usx2y/usbusx2yaudio.c |    4 ++++
>   1 file changed, 4 insertions(+)

> diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c
> index 4967fe9..e2ee893 100644
> --- a/sound/usb/usx2y/usbusx2yaudio.c
> +++ b/sound/usb/usx2y/usbusx2yaudio.c
> @@ -273,7 +273,11 @@ static void usX2Y_clients_stop(struct usX2Ydev *usX2Y)
>   		struct snd_usX2Y_substream *subs = usX2Y->subs[s];
>   		if (subs) {
>   			if (atomic_read(&subs->state) >= state_PRERUNNING) {
> +				unsigned long flags;
> +
> +				local_irq_save(flags);
>   				snd_pcm_stop(subs->pcm_substream, SNDRV_PCM_STATE_XRUN);
> +				local_irq_restore(flags);
>   			}

WBR, Sergei
```
