All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] staging: gdm724x: use GFP_ATOMIC under spin lock
@ 2013-07-26  2:15 Wei Yongjun
  2013-07-26  7:32 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2013-07-26  2:15 UTC (permalink / raw)
  To: gregkh, wonkang, joe; +Cc: yongjun_wei, devel, linux-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

A spin lock is taken here so we should use GFP_ATOMIC.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/staging/gdm724x/gdm_mux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/gdm724x/gdm_mux.c b/drivers/staging/gdm724x/gdm_mux.c
index f570bc0..7becf5c 100644
--- a/drivers/staging/gdm724x/gdm_mux.c
+++ b/drivers/staging/gdm724x/gdm_mux.c
@@ -410,7 +410,7 @@ static int gdm_mux_send(void *priv_dev, void *data, int len, int tty_index,
 			  gdm_mux_send_complete,
 			  t);
 
-	ret = usb_submit_urb(t->urb, GFP_KERNEL);
+	ret = usb_submit_urb(t->urb, GFP_ATOMIC);
 
 	spin_unlock_irqrestore(&mux_dev->write_lock, flags);
 


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

* Re: [PATCH -next] staging: gdm724x: use GFP_ATOMIC under spin lock
  2013-07-26  2:15 [PATCH -next] staging: gdm724x: use GFP_ATOMIC under spin lock Wei Yongjun
@ 2013-07-26  7:32 ` Dan Carpenter
  2013-07-26 22:04   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2013-07-26  7:32 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: gregkh, wonkang, joe, devel, yongjun_wei, linux-kernel

On Fri, Jul 26, 2013 at 10:15:55AM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> A spin lock is taken here so we should use GFP_ATOMIC.
> 

Acked-by: Dan Carpenter <dan.carpenter@oracle.com>

But the locking here is really odd and pointless.  usb_submit_urb()
returns asynchronously before the data has been sent, so there is
almost no point in locking around it.

regards,
dan carpenter


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

* Re: [PATCH -next] staging: gdm724x: use GFP_ATOMIC under spin lock
  2013-07-26  7:32 ` Dan Carpenter
@ 2013-07-26 22:04   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2013-07-26 22:04 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Wei Yongjun, devel, linux-kernel, yongjun_wei, wonkang, joe

On Fri, Jul 26, 2013 at 10:32:33AM +0300, Dan Carpenter wrote:
> On Fri, Jul 26, 2013 at 10:15:55AM +0800, Wei Yongjun wrote:
> > From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> > 
> > A spin lock is taken here so we should use GFP_ATOMIC.
> > 
> 
> Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> But the locking here is really odd and pointless.  usb_submit_urb()
> returns asynchronously before the data has been sent, so there is
> almost no point in locking around it.

There's no guarantee it will return before the complete() call is made,
so the data could be sent and then received before the call returns.

Not to say that the locking doesn't seem wrong, I agree with that...

thanks,

greg k-h

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

end of thread, other threads:[~2013-07-26 22:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-26  2:15 [PATCH -next] staging: gdm724x: use GFP_ATOMIC under spin lock Wei Yongjun
2013-07-26  7:32 ` Dan Carpenter
2013-07-26 22:04   ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.