lkml.org 
[lkml]   [2013]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] usb/core/devio.c: Don't use GFP_KERNEL while we cannot reset a storage device
From
On Mon, Mar 11, 2013 at 11:32 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
>
> Of course you have to lock the device before changing its driver. What
> would happen if two different threads tried to change a device's driver
> at the same time?

Yes, claim/release interface need device lock, but the patch doesn't
touch claim/release command handling.

>
> usbdev_do_ioctl() needs to acquire the device lock in order to prevent
> races with driver_disconnect() and usbdev_remove().

Looks the patch basically converts the allocation inside URB submit path,
and actually I mean why we need to hold device lock in submitting
URB path? Device lock isn't required before submitting URBs
in kernel driver.


Thanks,
--
Ming Lei


\
 
 \ /
  Last update: 2013-03-11 17:42    [W:0.098 / U:0.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site