linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] UVC: use GFP_ATOMIC under spin lock.
@ 2012-11-19 21:34 Cyril Roelandt
  2012-11-22  8:09 ` walter harms
  0 siblings, 1 reply; 6+ messages in thread
From: Cyril Roelandt @ 2012-11-19 21:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-usb, gregkh, balbi, laurent.pinchart, kernel-janitors,
	Cyril Roelandt

Found using the following semantic patch:
<spml>
@@
@@
spin_lock_irqsave(...);
... when != spin_unlock_irqrestore(...);
* GFP_KERNEL
</spml>

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
---
 drivers/usb/gadget/uvc_video.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/uvc_video.c b/drivers/usb/gadget/uvc_video.c
index b0e53a8..79b4132 100644
--- a/drivers/usb/gadget/uvc_video.c
+++ b/drivers/usb/gadget/uvc_video.c
@@ -309,7 +309,7 @@ uvc_video_pump(struct uvc_video *video)
 		video->encode(req, video, buf);
 
 		/* Queue the USB request */
-		if ((ret = usb_ep_queue(video->ep, req, GFP_KERNEL)) < 0) {
+		if ((ret = usb_ep_queue(video->ep, req, GFP_ATOMIC)) < 0) {
 			printk(KERN_INFO "Failed to queue request (%d)\n", ret);
 			usb_ep_set_halt(video->ep);
 			spin_unlock_irqrestore(&video->queue.irqlock, flags);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] UVC: use GFP_ATOMIC under spin lock.
  2012-11-19 21:34 [PATCH] UVC: use GFP_ATOMIC under spin lock Cyril Roelandt
@ 2012-11-22  8:09 ` walter harms
  2012-11-22 12:22   ` Felipe Balbi
  2012-11-25  1:58   ` [PATCH v2] " Cyril Roelandt
  0 siblings, 2 replies; 6+ messages in thread
From: walter harms @ 2012-11-22  8:09 UTC (permalink / raw)
  To: Cyril Roelandt
  Cc: linux-kernel, linux-usb, gregkh, balbi, laurent.pinchart,
	kernel-janitors



Am 19.11.2012 22:34, schrieb Cyril Roelandt:
> Found using the following semantic patch:
> <spml>
> @@
> @@
> spin_lock_irqsave(...);
> ... when != spin_unlock_irqrestore(...);
> * GFP_KERNEL
> </spml>
> 
> Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
> ---
>  drivers/usb/gadget/uvc_video.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/uvc_video.c b/drivers/usb/gadget/uvc_video.c
> index b0e53a8..79b4132 100644
> --- a/drivers/usb/gadget/uvc_video.c
> +++ b/drivers/usb/gadget/uvc_video.c
> @@ -309,7 +309,7 @@ uvc_video_pump(struct uvc_video *video)
>  		video->encode(req, video, buf);
>  
>  		/* Queue the USB request */
> -		if ((ret = usb_ep_queue(video->ep, req, GFP_KERNEL)) < 0) {
> +		if ((ret = usb_ep_queue(video->ep, req, GFP_ATOMIC)) < 0) {
>  			printk(KERN_INFO "Failed to queue request (%d)\n", ret);
>  			usb_ep_set_halt(video->ep);
>  			spin_unlock_irqrestore(&video->queue.irqlock, flags);


IMHO, this should be two lines, aka:

ret = usb_ep_queue(video->ep, req, GFP_KERNEL);
if (ret<0)

just my two cents,

re,
 wh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] UVC: use GFP_ATOMIC under spin lock.
  2012-11-22  8:09 ` walter harms
@ 2012-11-22 12:22   ` Felipe Balbi
  2012-11-22 12:38     ` Laurent Pinchart
  2012-11-25  1:58   ` [PATCH v2] " Cyril Roelandt
  1 sibling, 1 reply; 6+ messages in thread
From: Felipe Balbi @ 2012-11-22 12:22 UTC (permalink / raw)
  To: walter harms
  Cc: Cyril Roelandt, linux-kernel, linux-usb, gregkh, balbi,
	laurent.pinchart, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1298 bytes --]

On Thu, Nov 22, 2012 at 09:09:57AM +0100, walter harms wrote:
> 
> 
> Am 19.11.2012 22:34, schrieb Cyril Roelandt:
> > Found using the following semantic patch:
> > <spml>
> > @@
> > @@
> > spin_lock_irqsave(...);
> > ... when != spin_unlock_irqrestore(...);
> > * GFP_KERNEL
> > </spml>
> > 
> > Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
> > ---
> >  drivers/usb/gadget/uvc_video.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/usb/gadget/uvc_video.c b/drivers/usb/gadget/uvc_video.c
> > index b0e53a8..79b4132 100644
> > --- a/drivers/usb/gadget/uvc_video.c
> > +++ b/drivers/usb/gadget/uvc_video.c
> > @@ -309,7 +309,7 @@ uvc_video_pump(struct uvc_video *video)
> >  		video->encode(req, video, buf);
> >  
> >  		/* Queue the USB request */
> > -		if ((ret = usb_ep_queue(video->ep, req, GFP_KERNEL)) < 0) {
> > +		if ((ret = usb_ep_queue(video->ep, req, GFP_ATOMIC)) < 0) {
> >  			printk(KERN_INFO "Failed to queue request (%d)\n", ret);
> >  			usb_ep_set_halt(video->ep);
> >  			spin_unlock_irqrestore(&video->queue.irqlock, flags);
> 
> 
> IMHO, this should be two lines, aka:
> 
> ret = usb_ep_queue(video->ep, req, GFP_KERNEL);
> if (ret<0)

correct, please resend with the fix.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] UVC: use GFP_ATOMIC under spin lock.
  2012-11-22 12:22   ` Felipe Balbi
@ 2012-11-22 12:38     ` Laurent Pinchart
  0 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2012-11-22 12:38 UTC (permalink / raw)
  To: balbi
  Cc: walter harms, Cyril Roelandt, linux-kernel, linux-usb, gregkh,
	kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1446 bytes --]

On Thursday 22 November 2012 14:22:23 Felipe Balbi wrote:
> On Thu, Nov 22, 2012 at 09:09:57AM +0100, walter harms wrote:
> > Am 19.11.2012 22:34, schrieb Cyril Roelandt:
> > > Found using the following semantic patch:
> > > <spml>
> > > @@
> > > @@
> > > spin_lock_irqsave(...);
> > > ... when != spin_unlock_irqrestore(...);
> > > * GFP_KERNEL
> > > </spml>
> > > 
> > > Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
> > > ---
> > > 
> > >  drivers/usb/gadget/uvc_video.c |    2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/usb/gadget/uvc_video.c
> > > b/drivers/usb/gadget/uvc_video.c index b0e53a8..79b4132 100644
> > > --- a/drivers/usb/gadget/uvc_video.c
> > > +++ b/drivers/usb/gadget/uvc_video.c
> > > @@ -309,7 +309,7 @@ uvc_video_pump(struct uvc_video *video)
> > > 
> > >  		video->encode(req, video, buf);
> > >  		
> > >  		/* Queue the USB request */
> > > 
> > > -		if ((ret = usb_ep_queue(video->ep, req, GFP_KERNEL)) < 0) {
> > > +		if ((ret = usb_ep_queue(video->ep, req, GFP_ATOMIC)) < 0) {
> > > 
> > >  			printk(KERN_INFO "Failed to queue request (%d)\n", ret);
> > >  			usb_ep_set_halt(video->ep);
> > >  			spin_unlock_irqrestore(&video->queue.irqlock, flags);
> > 
> > IMHO, this should be two lines, aka:
> > 
> > ret = usb_ep_queue(video->ep, req, GFP_KERNEL);
> > if (ret<0)
> 
> correct, please resend with the fix.

I agree as well.

-- 
Regards,

Laurent Pinchart

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] UVC: use GFP_ATOMIC under spin lock.
  2012-11-22  8:09 ` walter harms
  2012-11-22 12:22   ` Felipe Balbi
@ 2012-11-25  1:58   ` Cyril Roelandt
  2012-11-27 13:14     ` Laurent Pinchart
  1 sibling, 1 reply; 6+ messages in thread
From: Cyril Roelandt @ 2012-11-25  1:58 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-usb, gregkh, balbi, laurent.pinchart, kernel-janitors,
	Cyril Roelandt

Found using the following semantic patch:
<spml>
@@
@@
spin_lock_irqsave(...);
... when != spin_unlock_irqrestore(...);
* GFP_KERNEL
</spml>

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
---
 drivers/usb/gadget/uvc_video.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/uvc_video.c b/drivers/usb/gadget/uvc_video.c
index b0e53a8..cd067a6 100644
--- a/drivers/usb/gadget/uvc_video.c
+++ b/drivers/usb/gadget/uvc_video.c
@@ -309,7 +309,8 @@ uvc_video_pump(struct uvc_video *video)
 		video->encode(req, video, buf);
 
 		/* Queue the USB request */
-		if ((ret = usb_ep_queue(video->ep, req, GFP_KERNEL)) < 0) {
+		ret = usb_ep_queue(video->ep, req, GFP_ATOMIC);
+		if (ret < 0) {
 			printk(KERN_INFO "Failed to queue request (%d)\n", ret);
 			usb_ep_set_halt(video->ep);
 			spin_unlock_irqrestore(&video->queue.irqlock, flags);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] UVC: use GFP_ATOMIC under spin lock.
  2012-11-25  1:58   ` [PATCH v2] " Cyril Roelandt
@ 2012-11-27 13:14     ` Laurent Pinchart
  0 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2012-11-27 13:14 UTC (permalink / raw)
  To: Cyril Roelandt; +Cc: linux-kernel, linux-usb, gregkh, balbi, kernel-janitors

Hi Cyril,

Thank you for the patch.

On Sunday 25 November 2012 02:58:19 Cyril Roelandt wrote:
> Found using the following semantic patch:
> <spml>
> @@
> @@
> spin_lock_irqsave(...);
> ... when != spin_unlock_irqrestore(...);
> * GFP_KERNEL
> </spml>
> 
> Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

and applied to my tree

> ---
>  drivers/usb/gadget/uvc_video.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/uvc_video.c b/drivers/usb/gadget/uvc_video.c
> index b0e53a8..cd067a6 100644
> --- a/drivers/usb/gadget/uvc_video.c
> +++ b/drivers/usb/gadget/uvc_video.c
> @@ -309,7 +309,8 @@ uvc_video_pump(struct uvc_video *video)
>  		video->encode(req, video, buf);
> 
>  		/* Queue the USB request */
> -		if ((ret = usb_ep_queue(video->ep, req, GFP_KERNEL)) < 0) {
> +		ret = usb_ep_queue(video->ep, req, GFP_ATOMIC);
> +		if (ret < 0) {
>  			printk(KERN_INFO "Failed to queue request (%d)\n", ret);
>  			usb_ep_set_halt(video->ep);
>  			spin_unlock_irqrestore(&video->queue.irqlock, flags);
-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-11-27 13:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-19 21:34 [PATCH] UVC: use GFP_ATOMIC under spin lock Cyril Roelandt
2012-11-22  8:09 ` walter harms
2012-11-22 12:22   ` Felipe Balbi
2012-11-22 12:38     ` Laurent Pinchart
2012-11-25  1:58   ` [PATCH v2] " Cyril Roelandt
2012-11-27 13:14     ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).