All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@denx.de>
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
Date: Sun, 20 Sep 2020 10:44:52 +0200	[thread overview]
Message-ID: <20200920084452.GA2257@amd> (raw)

[-- Attachment #1: Type: text/plain, Size: 1079 bytes --]


Move prepare to wait around, so that normal GFP_KERNEL allocation can
be used.

Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>

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);

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

             reply	other threads:[~2020-09-20  8:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-20  8:44 Pavel Machek [this message]
2020-09-21 12:24 ` [PATCH] usb: yurex: Rearrange code not to need GFP_ATOMIC Oliver Neukum
2020-09-21 12:52   ` Pavel Machek
2020-09-21 13:00     ` Oliver Neukum
2020-09-21 14:45   ` Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200920084452.GA2257@amd \
    --to=pavel@denx.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavoars@kernel.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.