[ldv-project] [PATCH] usb/core/devio.c: Don't use GFP_KERNEL while we cannot reset a storage device

Ming Lei tom.leiming at gmail.com
Mon Mar 11 17:31:03 MSK 2013


On Sat, Mar 9, 2013 at 12:50 AM, Alexey Khoroshilov
<khoroshilov at ispras.ru> wrote:
> As it was described by Oliver Neukum in commit acbe2fe
> "USB: Don't use GFP_KERNEL while we cannot reset a storage device":
>
>   Memory allocations with GFP_KERNEL can cause IO to a storage device
>   which can fail resulting in a need to reset the device. Therefore
>   GFP_KERNEL cannot be safely used between usb_lock_device()
>   and usb_unlock_device(). Replace by GFP_NOIO.
>
> The patch fixes the same issue in usb/core/devio.c.
> All the allocations fixed are under usb_lock_device() from usbdev_do_ioctl().

I am wondering why the device lock is needed for usbdev_do_ioctl()? Looks
device lock isn't required for USB transfer of kernel driver.


Thanks,
-- 
Ming Lei



More information about the ldv-project mailing list