Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 34faa9f1 authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

usb: gadget: f_ipc: Re-initialize completion on every read/write



When the driver is waiting for the completion of a queued
read/write request and some system interrupt is triggered, then
the request is dequeued and the core gadget driver calls the
request completion handler as a part of dequeue which increments
the completion's 'done' count to 1.
Next, when a new request is queued, its completion is immediately
done because the wait_for_completion bails out if 'done' count is
non-zero while the request is still queued with the hardware. So
the transfer fails with EALREADY error.
Fix this by re-initializing the completion before new read/write
request is queued. This assigns 0 value to 'done' field of the
completion and normal functionality resumes.

Change-Id: If51a1e4784c69377d296127356b17f8fbf0bc81e
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 5cd2a161
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment