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

Commit 0af93af8 authored by Manu Gautam's avatar Manu Gautam
Browse files

USB: f_mbim: Drop commands until MBIMD opens device on MBIM_OPEN



Host may sent back to back MBIM_OPEN commands if device doesn't
respond with MBIM_OPEN_DONE to previous one. This may happen
during bootup when USB is enumerated early but userspace takes
time to open MBIM device to fetch commands received from host.
If host sends second MBIM_OPEN just before receiving MBIM_OPEN_DONE
from device then MBIMD re-starts opening procedure afresh. But, when
host received MBIM_OPEN_DONE from first MBIM_OPEN, it assumes that
the response if for second command and it proceeds with sending more
commands. As MBIMD is yet to finish 2nd mbim_open, it rejects
commands with MBIM_NOT_OPENED. Host treats this as an error resulting
in yellow bang on device.
Handle this scenario by dropping commands until MBIMD opens mbim
device file and queue very first command to avoid any delays in
MBIM connection during bootup or if host stops retrying after a while.

Change-Id: Ib1f7f60b676a64e9919c16beeb3d8a963b6944bc
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent 80fa1579
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