From: Harvey Yang <harvey.huawei.yang@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Matt Mooney <mfm@muteddisk.com>,
linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Harvey Yang <harvey.huawei.yang@gmail.com>
Subject: [RFC PATCH 0/2] staging: usbip: refine the spinlock
Date: Fri, 23 Nov 2012 17:46:34 +0800 [thread overview]
Message-ID: <1353663996-11455-1-git-send-email-harvey.huawei.yang@gmail.com> (raw)
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(-)
next reply other threads:[~2012-11-23 9:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-23 9:46 Harvey Yang [this message]
2012-11-23 9:46 ` [RFC PATCH 1/2] staging: usbip: use interrupt safe spinlock to avoid potential deadlock Harvey Yang
2012-11-23 9:46 ` [RFC PATCH 2/2] staging: usbip: replace the interrupt safe spinlock because no hardware interrupt exists Harvey Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1353663996-11455-1-git-send-email-harvey.huawei.yang@gmail.com \
--to=harvey.huawei.yang@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mfm@muteddisk.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®