Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7148750ybi; Mon, 8 Jul 2019 15:37:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyk824omvYwlZ6tGTMcs/jtuRSMMMTI9qUPXu8j8TNN62MK1ji4ernnQ2RPgBBV2SilLPaN X-Received: by 2002:a17:902:8f81:: with SMTP id z1mr27254765plo.290.1562625440566; Mon, 08 Jul 2019 15:37:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562625440; cv=none; d=google.com; s=arc-20160816; b=UroCzZucNPsoyDpz0OeQF8B/3w9YZAECF7gqOL+LwScZIFfZ0EXc3KZ/v/iDARmFVa p1Ch3nrO1dOGaH1rSxFRYC5XoPi6Zm/FwvH3vOzSDq7rSPmucKx7IJZQEAf/Ey3mfj8K k8/3d1aGM2QoMVtUfXTFWe1QPIs8eBftcwJEM+AuUghHSmjBSur5EDTbnEGI4gr63kN6 tIKtWL2g1tNP1DfH+8YxPY/oDVca5Ve5qek09bFOW0hZFlmVkYA0+ZuH6Yme6R3ChGT5 wEf82/fx3LFVHy7ZzmSA7/qrENVSI/kaR/v8e8b02pMQYvtuuHzadLhVXm/ba/MdPUAc nvhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IgrDo/XOrbU08WqTT5D6zOG7izBWskItLgwkpx76rb0=; b=WNzozXbjQs5WdOAwTegtPxtk8k7UbwTpMwnWIbeMbOc02us20JN1bYSMOZ5l7ctEqj 3gPhBz4xjaLQYTufRG/2SbWC8PeR6YdqOpYFvGvGgvCY74s2xSamUQApbRDmR3qnKklb lk+KrsvK3ByTsrFWkHn7UDpObDI7RAAlp1p07vnC7Ijwc/ur3R6T3g6LzgOzdgvSgir0 n4e9gbSQt3rH4cQLtHEcBw7+3Rzyep+sSSSAdJbwr9/MYdgagBt5VMNT1kc2J7beZhJu TZBoxLFkuX+ASPiDlngFejCd6bLFpyvtfpWAD137B1PI6Lx5m2Puy6Z0sxWoqcEwjh01 Latg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kJskHaMp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m32si19569702pld.438.2019.07.08.15.37.05; Mon, 08 Jul 2019 15:37:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kJskHaMp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388721AbfGHPZ7 (ORCPT + 99 others); Mon, 8 Jul 2019 11:25:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:53482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388698AbfGHPZz (ORCPT ); Mon, 8 Jul 2019 11:25:55 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DA21620665; Mon, 8 Jul 2019 15:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562599554; bh=cYOXeoA13hecNXNXy0cMxkKIJAkMczHPDQI3mHpfdkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kJskHaMpUF64dSkfcz5t9Upc8PC4u89N/40c6eIip5skyqHeV07r3vShilCTeL5ut SQWoIF2a5qep3vkSC+xh/NMbMk/+n9l7txT3QOpJmGxQKtxmbIsQku6QML79i5VbXw vzYiCrp5bNvhkEZf9+G4qo/jFnP4un12FV78NCBE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sylvain Lemieux , James Grant , Alexandre Belloni , Felipe Balbi , Sasha Levin Subject: [PATCH 4.14 12/56] usb: gadget: udc: lpc32xx: allocate descriptor with GFP_ATOMIC Date: Mon, 8 Jul 2019 17:13:04 +0200 Message-Id: <20190708150519.367952815@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708150514.376317156@linuxfoundation.org> References: <20190708150514.376317156@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit fbc318afadd6e7ae2252d6158cf7d0c5a2132f7d ] 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. Also remove the unnecessary cast. Acked-by: Sylvain Lemieux Tested-by: James Grant Signed-off-by: Alexandre Belloni Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin --- drivers/usb/gadget/udc/lpc32xx_udc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c b/drivers/usb/gadget/udc/lpc32xx_udc.c index 8f32b5ee7734..6df1aded4503 100644 --- a/drivers/usb/gadget/udc/lpc32xx_udc.c +++ b/drivers/usb/gadget/udc/lpc32xx_udc.c @@ -935,8 +935,7 @@ static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc) dma_addr_t dma; struct lpc32xx_usbd_dd_gad *dd; - dd = (struct lpc32xx_usbd_dd_gad *) dma_pool_alloc( - udc->dd_cache, (GFP_KERNEL | GFP_DMA), &dma); + dd = dma_pool_alloc(udc->dd_cache, GFP_ATOMIC | GFP_DMA, &dma); if (dd) dd->this_dma = dma; -- 2.20.1