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:
Manu Gautam <mgautam@codeaurora.org>
Loading
Please register or sign in to comment