Re: [PATCH 2/2] usb: gadget: f_fs: stop sleeping in ffs_func_eps_disable

From: John Stultz
Date: Mon Oct 03 2016 - 20:26:17 EST

On Mon, Oct 3, 2016 at 5:07 PM, Michal Nazarewicz <mina86@xxxxxxxxxx> wrote:
> ffs_func_eps_disable is called from atomic context so it cannot sleep
> thus cannot grab a mutex. Change the handling of epfile->read_buffer
> to use non-sleeping synchronisation method.
> Reported-by: Chen Yu <chenyu56@xxxxxxxxxx>
> Signed-off-by: MichaÅ Nazarewicz <mina86@xxxxxxxxxx>
> Fixes: 9353afbbfa7b ("buffer data from âoversizedâ OUT requests")
> Tested-by: Chen Yu <chenyu56@xxxxxxxxxx>
> ---
> drivers/usb/gadget/function/f_fs.c | 109 +++++++++++++++++++++++++++++++------
> 1 file changed, 93 insertions(+), 16 deletions(-)
> Compared to the previous version:
> â this one has a bit more comments (I feel like itâs a bad sign that
> this needs so much documentation);
> â ffs_epfile_realese sets read_buffer to READ_BUFFER_DROP (which
> doesnât matter since on entry __ffs_epfile_read_buffered behaves
> the same way when read_buffer is NULL or READ_BUFFER_DROP); and
> â __ffs_epfile_read_data will drop the temporary data if read_buffer
> is READ_BUFFER_DROP (which may happen if ep is disabled between ep
> request finishes and data is copied to user space).
> Chen, John, if you could test this version as well, that would be
> swell.

for both patches:

Tested-by: John Stultz <john.stultz@xxxxxxxxxx>

Thanks so much for these!