Re: commit 554f76962d3a6eb5110415f1591aca83f96a84ae hangs USB for vmware 7.0.1

Heinz Diehl
2010-03-06T18:48:28Z

On 06.03.2010, Oliver Neukum wrote:

> From: Oliver Neukum <oliver@neukum.org>
> Date: Sat, 6 Mar 2010 12:09:41 +0100
> Subject: [PATCH] usb: usbfs: Fix deadlock of khubd
>
> The caller of usbfs_conn_disc_event() already holds usbfs_mutex.
> Don't take it again.
>
> Signed-off-by: Oliver Neukum <neukum@b1-systems.de>
> ---
> drivers/usb/core/devices.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
> index c83c975..08def6b 100644
> --- a/drivers/usb/core/devices.c
> +++ b/drivers/usb/core/devices.c
> @@ -155,11 +155,10 @@ static const struct class_info clas_info[] =
>
> /*****************************************************************/
>
> +/* the caller holds usbfs_mutex */
> void usbfs_conn_disc_event(void)
> {
> - mutex_lock(&usbfs_mutex);
> conndiscevcnt++;
> - mutex_unlock(&usbfs_mutex);
> wake_up(&deviceconndiscwq);
> }

I had a bug on my system which occured when I connected an USB mp3
player more than once:

When plugged in the first time, the device worked as expected. After
pulling it, it didn't get recognized again when plugged it.
Only a reboot did help. 2.6.33 final is fine, 2.6.33-gitX isn't.

Your patch, applied to -git11, did fix this.

Thanks,
Heinz.