Re: [PATCH] usb: storage: fix lockdep warning inside usb_stor_pre_reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>  drivers/usb/storage/usb.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
> index c18538e..21b43ba 100644
> --- a/drivers/usb/storage/usb.c
> +++ b/drivers/usb/storage/usb.c
> @@ -197,8 +197,13 @@ int usb_stor_pre_reset(struct usb_interface *iface)
>  
>  	US_DEBUGP("%s\n", __func__);
>  
> -	/* Make sure no command runs during the reset */
> -	mutex_lock(&us->dev_mutex);
> +	/*
> +	 * Make sure no command runs during the reset. And take
> +	 * the nested annotation to avoid 'AA' lockdep warning
> +	 * for multiple mass storage interfaces' case.
> +	 */
> +	mutex_lock_nested(&us->dev_mutex,
> +		(int)(iface - us->pusb_dev->actconfig->interface[0]));
>  	return 0;
>  }
>  EXPORT_SYMBOL_GPL(usb_stor_pre_reset);

Didn't Alan Stern yesterday say that us->dev_mutex nesting isn't ordered
and that the above will not work?

Also, is there a guarantee your: iface - interface[0] thing is <8 ? If
not, its broken.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux