[RFC PATCH 0/2] staging: usbip: refine the spinlock
From: Harvey Yang
Date: Fri Nov 23 2012 - 04:42:22 EST
This patchset refine some spinlocks which I think not used properly. Maybe my 'refine' make the code broken, so any comments will be appreciated.
patch1: 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 shoud disable irq when we get this lock in process context.
patch2: On the client side, we have a virtual hcd driver so there actually no hardware interrupts. Maybe 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 spinlock because no
hardware interrupt exists.
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 | 75 +++++++++++++++--------------------
drivers/staging/usbip/vhci_rx.c | 10 ++---
drivers/staging/usbip/vhci_tx.c | 14 +++----
6 files changed, 65 insertions(+), 78 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/