Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751941Ab3CKNbH (ORCPT ); Mon, 11 Mar 2013 09:31:07 -0400 Received: from mail-ve0-f177.google.com ([209.85.128.177]:35197 "EHLO mail-ve0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751122Ab3CKNbF (ORCPT ); Mon, 11 Mar 2013 09:31:05 -0400 MIME-Version: 1.0 In-Reply-To: <1362761447-24643-1-git-send-email-khoroshilov@ispras.ru> References: <1362761447-24643-1-git-send-email-khoroshilov@ispras.ru> Date: Mon, 11 Mar 2013 21:31:03 +0800 Message-ID: Subject: Re: [PATCH] usb/core/devio.c: Don't use GFP_KERNEL while we cannot reset a storage device From: Ming Lei To: Alexey Khoroshilov Cc: Greg Kroah-Hartman , Hans de Goede , Alan Stern , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1008 Lines: 25 On Sat, Mar 9, 2013 at 12:50 AM, Alexey Khoroshilov 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/