From: Jeff Chua <jeff.tw.chua@gmail.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: Oliver Neukum <oliver@neukum.org>,
Greg Kroah-Hartman <gregkh@suse.de>,
Frederic Weisbecker <fweisbec@gmail.com>,
petr@vmware.com, Eli Collins <ecollins@vmware.com>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: commit 554f76962d3a6eb5110415f1591aca83f96a84ae hangs USB for vmware 7.0.1
Date: Sat, 6 Mar 2010 06:18:17 +0800 (SGT) [thread overview]
Message-ID: <Pine.LNX.4.64.1003060606480.6040@boston.corp.fedex.com> (raw)
Linux version v2.6.33-5399-gcc7889f with reiser3 and vmware-7.0.1
Starting vmware just hang even before displaying the main GUI. Reverting
554f76962d3a6eb5110415f1591aca83f96a84ae solves the problem.
It seems vmware is trying to access the USB but this commit blocks it.
So, is this a vmware problem or shall this be reverted?
Thanks,
Jeff
commit 554f76962d3a6eb5110415f1591aca83f96a84ae
Author: Oliver Neukum <oliver@neukum.org>
Date: Wed Jan 13 15:30:47 2010 +0100
USB: Remove BKL from poll()
Replace BKL with usbfs_mutex to protect a global counter
and a per file data structure
Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index 355dffc..175529f 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -118,6 +118,7 @@ static const char *format_endpt =
*/
static DECLARE_WAIT_QUEUE_HEAD(deviceconndiscwq);
+/* guarded by usbfs_mutex */
static unsigned int conndiscevcnt;
/* this struct stores the poll state for <mountpoint>/devices pollers */
@@ -156,7 +157,9 @@ static const struct class_info clas_info[] =
void usbfs_conn_disc_event(void)
{
+ mutex_lock(&usbfs_mutex);
conndiscevcnt++;
+ mutex_unlock(&usbfs_mutex);
wake_up(&deviceconndiscwq);
}
@@ -629,42 +632,29 @@ static ssize_t usb_device_read(struct file *file, char __user *buf,
static unsigned int usb_device_poll(struct file *file,
struct poll_table_struct *wait)
{
- struct usb_device_status *st = file->private_data;
+ struct usb_device_status *st;
unsigned int mask = 0;
- lock_kernel();
+ mutex_lock(&usbfs_mutex);
+ st = file->private_data;
if (!st) {
st = kmalloc(sizeof(struct usb_device_status), GFP_KERNEL);
-
- /* we may have dropped BKL -
- * need to check for having lost the race */
- if (file->private_data) {
- kfree(st);
- st = file->private_data;
- goto lost_race;
- }
- /* we haven't lost - check for allocation failure now */
if (!st) {
- unlock_kernel();
+ mutex_unlock(&usbfs_mutex);
return POLLIN;
}
- /*
- * need to prevent the module from being unloaded, since
- * proc_unregister does not call the release method and
- * we would have a memory leak
- */
st->lastev = conndiscevcnt;
file->private_data = st;
mask = POLLIN;
}
-lost_race:
+
if (file->f_mode & FMODE_READ)
poll_wait(file, &deviceconndiscwq, wait);
if (st->lastev != conndiscevcnt)
mask |= POLLIN;
st->lastev = conndiscevcnt;
- unlock_kernel();
+ mutex_unlock(&usbfs_mutex);
return mask;
}
next reply other threads:[~2010-03-05 22:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-05 22:18 Jeff Chua [this message]
2010-03-05 22:40 ` Linus Torvalds
2010-03-06 3:45 ` Petr Vandrovec
[not found] ` <b6a2187b1003052129l7703dee6s6e820b8ca18b9e2d@mail.gmail.com>
2010-03-06 6:46 ` Petr Vandrovec
2010-03-06 9:33 ` Dmitry Torokhov
2010-03-06 11:12 ` Oliver Neukum
2010-03-06 18:48 ` Heinz Diehl
[not found] ` <b6a2187b1003052122w105851abhd54a32f77aef22c4@mail.gmail.com>
2010-03-06 9:03 ` Oliver Neukum
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=Pine.LNX.4.64.1003060606480.6040@boston.corp.fedex.com \
--to=jeff.tw.chua@gmail.com \
--cc=ecollins@vmware.com \
--cc=fweisbec@gmail.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=oliver@neukum.org \
--cc=petr@vmware.com \
--cc=torvalds@linux-foundation.org \
/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®