Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756934Ab2JWIom (ORCPT ); Tue, 23 Oct 2012 04:44:42 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:45610 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752355Ab2JWIok (ORCPT ); Tue, 23 Oct 2012 04:44:40 -0400 MIME-Version: 1.0 In-Reply-To: References: <1350894794-1494-7-git-send-email-ming.lei@canonical.com> Date: Tue, 23 Oct 2012 16:44:39 +0800 Message-ID: Subject: Re: [RFC PATCH v2 6/6] USB: forbid memory allocation with I/O during bus reset From: Ming Lei To: Alan Stern Cc: linux-kernel@vger.kernel.org, Oliver Neukum , Minchan Kim , Greg Kroah-Hartman , "Rafael J. Wysocki" , Jens Axboe , "David S. Miller" , Andrew Morton , netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-pm@vger.kernel.org, linux-mm@kvack.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: 896 Lines: 26 On Mon, Oct 22, 2012 at 10:37 PM, Alan Stern wrote: > On Mon, 22 Oct 2012, Ming Lei wrote: >> >> + /* >> + * Don't allocate memory with GFP_KERNEL in current >> + * context to avoid possible deadlock if usb mass >> + * storage interface or usbnet interface(iSCSI case) >> + * is included in current configuration. The easiest >> + * approach is to do it for all devices. >> + */ >> + memalloc_noio_save(noio_flag); > > Why not check dev->power.memalloc_noio_resume here too? Yes, we can use the flag here too even though it is introduced for rutime_resume case. 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/