From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C3CCC04A6B for ; Fri, 10 May 2019 16:06:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6D2902070D for ; Fri, 10 May 2019 16:06:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727589AbfEJQGi (ORCPT ); Fri, 10 May 2019 12:06:38 -0400 Received: from smtprelay0009.hostedemail.com ([216.40.44.9]:50776 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727471AbfEJQGi (ORCPT ); Fri, 10 May 2019 12:06:38 -0400 X-Greylist: delayed 401 seconds by postgrey-1.27 at vger.kernel.org; Fri, 10 May 2019 12:06:37 EDT Received: from smtprelay.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by smtpgrave01.hostedemail.com (Postfix) with ESMTP id 33DC11803281C for ; Fri, 10 May 2019 15:59:57 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 426E0181D396A; Fri, 10 May 2019 15:59:55 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: plot02_906f77e1ab355 X-Filterd-Recvd-Size: 1887 Received: from XPS-9350 (cpe-23-242-196-136.socal.res.rr.com [23.242.196.136]) (Authenticated sender: joe@perches.com) by omf02.hostedemail.com (Postfix) with ESMTPA; Fri, 10 May 2019 15:59:52 +0000 (UTC) Message-ID: <82974f50ad02342abd59b800a802f7adecabc0b9.camel@perches.com> Subject: Re: [PATCH] usb: gadget: udc: lpc32xx: allocate descriptor with GFP_ATOMIC From: Joe Perches To: Alexandre Belloni , Felipe Balbi , Vladimir Zapolskiy , Greg Kroah-Hartman Cc: Sylvain Lemieux , James Grant , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Fri, 10 May 2019 08:59:51 -0700 In-Reply-To: <20190510124248.2430-1-alexandre.belloni@bootlin.com> References: <20190510124248.2430-1-alexandre.belloni@bootlin.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.1-1build1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Fri, 2019-05-10 at 14:42 +0200, Alexandre Belloni wrote: > Gadget drivers may queue request in interrupt context. This would lead to > a descriptor allocation in that context. In that case we would hit > BUG_ON(in_interrupt()) in __get_vm_area_node. [] > diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c b/drivers/usb/gadget/udc/lpc32xx_udc.c [] > @@ -938,7 +938,7 @@ static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc) > struct lpc32xx_usbd_dd_gad *dd; > > dd = (struct lpc32xx_usbd_dd_gad *) dma_pool_alloc( > - udc->dd_cache, (GFP_KERNEL | GFP_DMA), &dma); > + udc->dd_cache, (GFP_ATOMIC | GFP_DMA), &dma); trivia: This could fit nicely on a single line without the unnecessary cast and the unnecessary parentheses around the GFP_ types.