Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp250209ybd; Tue, 25 Jun 2019 20:44:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlHjasbEXg04Rbbmjx1u3e9oNlku+GrVU+QYeLLPcZANPxsRIM1SdZUgUXz7thHLb4e6yr X-Received: by 2002:a17:90a:b115:: with SMTP id z21mr1826276pjq.64.1561520675713; Tue, 25 Jun 2019 20:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561520675; cv=none; d=google.com; s=arc-20160816; b=JnlYtYjAeEImVPxiko+BXlS6PSgigU1jFeylpkVDXaSWpLBEze74udT2GvHjqv/NnV YgTFlVWGQnuHpMQwRD/EYC2ccqxzsT+eO3geWu7dTdMGNPShNZjrws2mhvj58m8B0RgA ikwV7Wxtmtyx9FOEvzOhmEUNdSuRUUCVgi1fSj7N2vdGaXTrjkWeIYIF4ORZ40Ul1B2y 57Rsrh9avhW5FzCkb7etqhTTDbn6HF3kgY1SJs8IZDbS4DnwtFTWrUUQ2eS8+at0CilW 9ofKSW08qBbd2Gp1wpuNlVB+t2CtkqKQ8APqIbWrRXMVsKxZ11mq7xxR4pqyjYdexXrL /osg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tMOlRjEMWIBlNHPylFlBOlJELg/GHm/FJK/yt7MDQjw=; b=XfBgeUzHTk/ZT9gCLHj3IJmaL1FBYTAUEekmYQLK0jOUh6M3AHfvqKrcOyNO0eNf4W d0CX4yGjv/QcIZPazNWab2C4ZS8hpbTrcUwUZSbZiY55PyXMP43AQU41LGC1eKSRF2Tq +cIsoNk5BNbdJmOka17iT3IWoYEFE46eDt6jcqnHva9z7uaw3JGXxPQ7uJqZM+RFumSn 3kV5MTnBFF0SxrrWujUywa8caaTePs9BT7daMcN8UR3WqNoZxOO/hlFzAwH4aAn+wHIm u0RxklcGtNQJdAHXdto/T1CWWlwbH4wKuf8+xZHC3+FLCxUnnK3he8VauASg9bQYlldx +mNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t9hee2XK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si2080817pls.190.2019.06.25.20.44.19; Tue, 25 Jun 2019 20:44:35 -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=t9hee2XK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727110AbfFZDmd (ORCPT + 99 others); Tue, 25 Jun 2019 23:42:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:53394 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727071AbfFZDma (ORCPT ); Tue, 25 Jun 2019 23:42:30 -0400 Received: from sasha-vm.mshome.net (mobile-107-77-172-74.mobile.att.net [107.77.172.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8BBD4205ED; Wed, 26 Jun 2019 03:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561520549; bh=vCYeM5EFMB1SOUuq5Ofz12ylpaMRCJKxg1kTA73sMW8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t9hee2XKx5SIN/6VFxv9RCL6ZiFyj2H36UfrDwFz+94HF/kcHg4HSi3pM5r9BbnmW nFqv7SWBM4Bvz63CCnhUcpv6PMEo2bMamPVyJtvpuQv9p/7gODummoxHcpqXm5D7Wa HmJYnDviAZr/kGuEGatWgBJVu00TRx1QRLACWzOs= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alexandre Belloni , Sylvain Lemieux , James Grant , Felipe Balbi , Sasha Levin , linux-usb@vger.kernel.org Subject: [PATCH AUTOSEL 5.1 25/51] usb: gadget: udc: lpc32xx: allocate descriptor with GFP_ATOMIC Date: Tue, 25 Jun 2019 23:40:41 -0400 Message-Id: <20190626034117.23247-25-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190626034117.23247-1-sashal@kernel.org> References: <20190626034117.23247-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexandre Belloni [ 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 b0781771704e..eafc2a00c96a 100644 --- a/drivers/usb/gadget/udc/lpc32xx_udc.c +++ b/drivers/usb/gadget/udc/lpc32xx_udc.c @@ -922,8 +922,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