From patchwork Sun Sep 20 08:44:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 11787381 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A01CB6CA for ; Sun, 20 Sep 2020 08:53:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D3C620897 for ; Sun, 20 Sep 2020 08:53:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726250AbgITIx0 (ORCPT ); Sun, 20 Sep 2020 04:53:26 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:60820 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726201AbgITIx0 (ORCPT ); Sun, 20 Sep 2020 04:53:26 -0400 X-Greylist: delayed 508 seconds by postgrey-1.27 at vger.kernel.org; Sun, 20 Sep 2020 04:53:25 EDT Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 75C0B1C0B94; Sun, 20 Sep 2020 10:44:53 +0200 (CEST) Date: Sun, 20 Sep 2020 10:44:52 +0200 From: Pavel Machek To: gregkh@linuxfoundation.org, stern@rowland.harvard.edu, johan@kernel.org, gustavoars@kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: yurex: Rearrange code not to need GFP_ATOMIC Message-ID: <20200920084452.GA2257@amd> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Move prepare to wait around, so that normal GFP_KERNEL allocation can be used. Signed-off-by: Pavel Machek (CIP) Acked-by: Alan Stern diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c index b2e09883c7e2..071f1debebba 100644 --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/yurex.c @@ -489,10 +489,10 @@ static ssize_t yurex_write(struct file *file, const char __user *user_buffer, } /* send the data as the control msg */ - prepare_to_wait(&dev->waitq, &wait, TASK_INTERRUPTIBLE); dev_dbg(&dev->interface->dev, "%s - submit %c\n", __func__, dev->cntl_buffer[0]); - retval = usb_submit_urb(dev->cntl_urb, GFP_ATOMIC); + retval = usb_submit_urb(dev->cntl_urb, GFP_KERNEL); + prepare_to_wait(&dev->waitq, &wait, TASK_INTERRUPTIBLE); if (retval >= 0) timeout = schedule_timeout(YUREX_WRITE_TIMEOUT); finish_wait(&dev->waitq, &wait);