lkml.org 
[lkml]   [2020]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] usb: yurex: Rearrange code not to need GFP_ATOMIC
From
Date
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

\
 
 \ /
  Last update: 2020-09-21 15:01    [W:0.051 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site