public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] staging: usbip: refine the lock
@ 2013-01-08  5:49 Harvey Yang
  2013-01-08  5:49 ` [PATCH 1/2] staging: usbip: use interrupt safe spinlock to avoid potential deadlock Harvey Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Harvey Yang @ 2013-01-08  5:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Matt Mooney, linux-usb; +Cc: linux-kernel, Harvey Yang

This patchset refines some spinlocks which maybe not used properly.  

[PATCH 1/2]: The function 'usbip_event_add()' may be called in interrupt context on the stub side: 
'stub_complete'->'stub_enqueue_ret_unlink'->'usbip_event_add'.
In this function it tries to get the lock 'ud->lock', so we should disable irq when we get this lock in process context.

[PATCH 2/2]: On the client side, we have a virtual hcd driver, there actually no hardware interrupts, so we do not need worry about race conditions caused by irq. To achieve a good performance there is no need to use the interrupt safe spinlock. Just replace them with a non interrupt safe version.


Harvey Yang (2):
  staging: usbip: use interrupt safe spinlock to avoid potential
    deadlock.
  staging: usbip: replace the interrupt safe spinlocks with common
    ones.

 drivers/staging/usbip/stub_dev.c    |   34 ++++++++--------
 drivers/staging/usbip/stub_rx.c     |    4 +-
 drivers/staging/usbip/usbip_event.c |    6 ++-
 drivers/staging/usbip/vhci_hcd.c    |   76 +++++++++++++++--------------------
 drivers/staging/usbip/vhci_rx.c     |   10 ++---
 drivers/staging/usbip/vhci_tx.c     |   14 +++----
 6 files changed, 65 insertions(+), 79 deletions(-)


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

end of thread, other threads:[~2013-01-08  5:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-08  5:49 [PATCH 0/2] staging: usbip: refine the lock Harvey Yang
2013-01-08  5:49 ` [PATCH 1/2] staging: usbip: use interrupt safe spinlock to avoid potential deadlock Harvey Yang
2013-01-08  5:51   ` Greg Kroah-Hartman
2013-01-08  5:49 ` [PATCH 2/2] staging: usbip: replace the interrupt safe spinlocks with common ones Harvey Yang
2013-01-08  5:52 ` [PATCH 0/2] staging: usbip: refine the lock Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox