From: Oliver Neukum <oneukum@suse.com>
To: Pavel Machek <pavel@denx.de>
Cc: gregkh@linuxfoundation.org, stern@rowland.harvard.edu,
johan@kernel.org, gustavoars@kernel.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: yurex: Rearrange code not to need GFP_ATOMIC
Date: Mon, 21 Sep 2020 15:00:16 +0200 [thread overview]
Message-ID: <1600693216.2424.92.camel@suse.com> (raw)
In-Reply-To: <20200921125237.GA24776@duo.ucw.cz>
Am Montag, den 21.09.2020, 14:52 +0200 schrieb Pavel Machek:
> Hi!
> >
> > Task goes to TASK_INTERRUPTIBLE
> >
> > > if (retval >= 0)
> > > timeout = schedule_timeout(YUREX_WRITE_TIMEOUT);
> >
> > Task turns into Sleeping Beauty until timeout
>
> Is there way to do the allocations for submit_urb before the
No. In theory you do not even know which HC will get the URB.
Preallocating resources is impossible. I do consider this a
design bug in the usbcore API.
> prepare_to_wait? GFP_ATOMIC would be nice to avoid... and doing
> GFP_ATOMIC from normal process context just because of task_state
> seems ... wrong.
Well, then you will need to change the rest of the logic
and use a struct completion. Give the age and practical
relevance of the driver I would recommend against making
such drastic changes and let it just be in its awkward
but correct state.
Regards
Oliver
next prev parent reply other threads:[~2020-09-21 13:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-20 8:44 [PATCH] usb: yurex: Rearrange code not to need GFP_ATOMIC Pavel Machek
2020-09-21 12:24 ` Oliver Neukum
2020-09-21 12:52 ` Pavel Machek
2020-09-21 13:00 ` Oliver Neukum [this message]
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=1600693216.2424.92.camel@suse.com \
--to=oneukum@suse.com \
--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=pavel@denx.de \
--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.