[patch] [media] davinci: vpif: missing unlocks on error

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[patch] [media] davinci: vpif: missing unlocks on error

Dan Carpenter
We recently changed some locking around so we need some new unlocks on
the error paths.

Signed-off-by: Dan Carpenter <[hidden email]>
---
Please review this one carefully.  I don't know if the unlock should go
before or after the list_for_each_entry_safe() loop.

diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index a7ed164..2c08fbd 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -265,6 +265,8 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
  return 0;
 
 err:
+ spin_unlock_irqrestore(&common->irqlock, flags);
+
  list_for_each_entry_safe(buf, tmp, &common->dma_queue, list) {
  list_del(&buf->list);
  vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
index 5bb085b..b7b2bdf 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -229,6 +229,8 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
  return 0;
 
 err:
+ spin_unlock_irqrestore(&common->irqlock, flags);
+
  list_for_each_entry_safe(buf, tmp, &common->dma_queue, list) {
  list_del(&buf->list);
  vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [patch] [media] davinci: vpif: missing unlocks on error

Lad, Prabhakar
Hi Dan,

Thanks for the patch.

On Wed, Jun 11, 2014 at 8:31 AM, Dan Carpenter <[hidden email]> wrote:
> We recently changed some locking around so we need some new unlocks on
> the error paths.
>
> Signed-off-by: Dan Carpenter <[hidden email]>
> ---
> Please review this one carefully.  I don't know if the unlock should go
> before or after the list_for_each_entry_safe() loop.
>
Yes the unlock should go after the list_for_each_entry_safe() loop
please respin another version fixing it.

Thanks,
--Prabhakar Lad

> diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
> index a7ed164..2c08fbd 100644
> --- a/drivers/media/platform/davinci/vpif_capture.c
> +++ b/drivers/media/platform/davinci/vpif_capture.c
> @@ -265,6 +265,8 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
>         return 0;
>
>  err:
> +       spin_unlock_irqrestore(&common->irqlock, flags);
> +
>         list_for_each_entry_safe(buf, tmp, &common->dma_queue, list) {
>                 list_del(&buf->list);
>                 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
> diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
> index 5bb085b..b7b2bdf 100644
> --- a/drivers/media/platform/davinci/vpif_display.c
> +++ b/drivers/media/platform/davinci/vpif_display.c
> @@ -229,6 +229,8 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
>         return 0;
>
>  err:
> +       spin_unlock_irqrestore(&common->irqlock, flags);
> +
>         list_for_each_entry_safe(buf, tmp, &common->dma_queue, list) {
>                 list_del(&buf->list);
>                 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[patch v2] [media] davinci: vpif: missing unlocks on error

Dan Carpenter
We recently changed some locking around so we need some new unlocks on
the error paths.

Signed-off-by: Dan Carpenter <[hidden email]>
---
v2: move the unlock so the list_for_each_entry_safe() loop is protected

diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index a7ed164..1e4ec69 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -269,6 +269,7 @@ err:
  list_del(&buf->list);
  vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
  }
+ spin_unlock_irqrestore(&common->irqlock, flags);
 
  return ret;
 }
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
index 5bb085b..b431b58 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -233,6 +233,7 @@ err:
  list_del(&buf->list);
  vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
  }
+ spin_unlock_irqrestore(&common->irqlock, flags);
 
  return ret;
 }
_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [patch v2] [media] davinci: vpif: missing unlocks on error

Lad, Prabhakar
On Thu, Jun 12, 2014 at 8:01 AM, Dan Carpenter <[hidden email]> wrote:
> We recently changed some locking around so we need some new unlocks on
> the error paths.
>
> Signed-off-by: Dan Carpenter <[hidden email]>

Applied!

Thanks,
--Prabhakar Lad

> ---
> v2: move the unlock so the list_for_each_entry_safe() loop is protected
>
> diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
> index a7ed164..1e4ec69 100644
> --- a/drivers/media/platform/davinci/vpif_capture.c
> +++ b/drivers/media/platform/davinci/vpif_capture.c
> @@ -269,6 +269,7 @@ err:
>                 list_del(&buf->list);
>                 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
>         }
> +       spin_unlock_irqrestore(&common->irqlock, flags);
>
>         return ret;
>  }
> diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
> index 5bb085b..b431b58 100644
> --- a/drivers/media/platform/davinci/vpif_display.c
> +++ b/drivers/media/platform/davinci/vpif_display.c
> @@ -233,6 +233,7 @@ err:
>                 list_del(&buf->list);
>                 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
>         }
> +       spin_unlock_irqrestore(&common->irqlock, flags);
>
>         return ret;
>  }
_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [patch v2] [media] davinci: vpif: missing unlocks on error

Hans Verkuil
Prabhakar,

Are you going to make a pull request for this, or shall I take it? Should it be applied
to 3.16?

Regards,

        Hans

On 06/13/2014 08:13 PM, Prabhakar Lad wrote:

> On Thu, Jun 12, 2014 at 8:01 AM, Dan Carpenter <[hidden email]> wrote:
>> We recently changed some locking around so we need some new unlocks on
>> the error paths.
>>
>> Signed-off-by: Dan Carpenter <[hidden email]>
>
> Applied!
>
> Thanks,
> --Prabhakar Lad
>
>> ---
>> v2: move the unlock so the list_for_each_entry_safe() loop is protected
>>
>> diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
>> index a7ed164..1e4ec69 100644
>> --- a/drivers/media/platform/davinci/vpif_capture.c
>> +++ b/drivers/media/platform/davinci/vpif_capture.c
>> @@ -269,6 +269,7 @@ err:
>>                 list_del(&buf->list);
>>                 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
>>         }
>> +       spin_unlock_irqrestore(&common->irqlock, flags);
>>
>>         return ret;
>>  }
>> diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
>> index 5bb085b..b431b58 100644
>> --- a/drivers/media/platform/davinci/vpif_display.c
>> +++ b/drivers/media/platform/davinci/vpif_display.c
>> @@ -233,6 +233,7 @@ err:
>>                 list_del(&buf->list);
>>                 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
>>         }
>> +       spin_unlock_irqrestore(&common->irqlock, flags);
>>
>>         return ret;
>>  }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to [hidden email]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [patch v2] [media] davinci: vpif: missing unlocks on error

Lad, Prabhakar
Hi Hans,

On Mon, Jun 16, 2014 at 10:48 AM, Hans Verkuil <[hidden email]> wrote:
> Prabhakar,
>
> Are you going to make a pull request for this, or shall I take it? Should it be applied
> to 3.16?
>
As this is not a critical bug, I was planning to wait for v3.17 as
v3.16 is almost closed.

Regards,
--Prabhakar Lad

> Regards,
>
>         Hans
>
> On 06/13/2014 08:13 PM, Prabhakar Lad wrote:
>> On Thu, Jun 12, 2014 at 8:01 AM, Dan Carpenter <[hidden email]> wrote:
>>> We recently changed some locking around so we need some new unlocks on
>>> the error paths.
>>>
>>> Signed-off-by: Dan Carpenter <[hidden email]>
>>
>> Applied!
>>
>> Thanks,
>> --Prabhakar Lad
>>
>>> ---
>>> v2: move the unlock so the list_for_each_entry_safe() loop is protected
>>>
>>> diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
>>> index a7ed164..1e4ec69 100644
>>> --- a/drivers/media/platform/davinci/vpif_capture.c
>>> +++ b/drivers/media/platform/davinci/vpif_capture.c
>>> @@ -269,6 +269,7 @@ err:
>>>                 list_del(&buf->list);
>>>                 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
>>>         }
>>> +       spin_unlock_irqrestore(&common->irqlock, flags);
>>>
>>>         return ret;
>>>  }
>>> diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
>>> index 5bb085b..b431b58 100644
>>> --- a/drivers/media/platform/davinci/vpif_display.c
>>> +++ b/drivers/media/platform/davinci/vpif_display.c
>>> @@ -233,6 +233,7 @@ err:
>>>                 list_del(&buf->list);
>>>                 vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
>>>         }
>>> +       spin_unlock_irqrestore(&common->irqlock, flags);
>>>
>>>         return ret;
>>>  }
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-media" in
>> the body of a message to [hidden email]
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
_______________________________________________
Davinci-linux-open-source mailing list
[hidden email]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
Loading...