Re: [PATCH v1 43/49] media: usb: em28xx: prepare for enabling irq in complete()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat 17 August 2013 18:25:08 Ming Lei wrote:
> Complete() will be run with interrupt enabled, so add local_irq_save()
> before acquiring the lock without irqsave().
> 
> Cc: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>
> Cc: linux-media@xxxxxxxxxxxxxxx
> Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxxxxx>

Acked-by: Hans Verkuil <hans.verkuil@xxxxxxxxx>

Regards,

	Hans

> ---
>  drivers/media/usb/em28xx/em28xx-audio.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c
> index 2fdb66e..7fd1b2a 100644
> --- a/drivers/media/usb/em28xx/em28xx-audio.c
> +++ b/drivers/media/usb/em28xx/em28xx-audio.c
> @@ -113,6 +113,7 @@ static void em28xx_audio_isocirq(struct urb *urb)
>  		stride = runtime->frame_bits >> 3;
>  
>  		for (i = 0; i < urb->number_of_packets; i++) {
> +			unsigned long flags;
>  			int length =
>  			    urb->iso_frame_desc[i].actual_length / stride;
>  			cp = (unsigned char *)urb->transfer_buffer +
> @@ -134,7 +135,7 @@ static void em28xx_audio_isocirq(struct urb *urb)
>  				       length * stride);
>  			}
>  
> -			snd_pcm_stream_lock(substream);
> +			snd_pcm_stream_lock_irqsave(substream, flags);
>  
>  			dev->adev.hwptr_done_capture += length;
>  			if (dev->adev.hwptr_done_capture >=
> @@ -150,7 +151,7 @@ static void em28xx_audio_isocirq(struct urb *urb)
>  				period_elapsed = 1;
>  			}
>  
> -			snd_pcm_stream_unlock(substream);
> +			snd_pcm_stream_unlock_irqrestore(substream, flags);
>  		}
>  		if (period_elapsed)
>  			snd_pcm_period_elapsed(substream);
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux