<div dir="ltr">I've been debugging an issue with Huawei ME936 (in MBIM mode). The issue is observed since commit 0c7f3380a ("bearer-mbim: ensure session is disconnected before trying to connect").<div><br></div><div>From what I observe, the first connection attempt on ME936 always times out when MMBearerMbim issues a MBIM_CID_CONNECT (MBIMActivationCommandDeactivate) command to force deactivating a session that hasn't yet been activated. But as MMBearerMbim currently ignores that error, it proceeds to issue MBIM_CID_CONNECT (MBIMActivationCommandActivate) command, which then also fails. For some unknown reason (mostly like a firmware bug), the modem takes more than 30s (i.e. the current timeout) to deactivate a session that hasn't been activated once.<div><br></div><div>Increasing the timeout would address the issue, but I'm not too happy to wait 30-40s for a unnecessary operation. So I thought I could query the activation state of the session before trying to deactivate it. Unfortunately, the modem always reports a "unknown" activation state if the session hasn't been activated once (well, most likely yet another firmware bug).<div><div><br></div><div>As the chance of getting a firmware fix seems slim, I try to address that in ModemManger / libmbim with the following patches:</div><div><br></div><div>---</div><div><br></div><div>modemmanager-devel:<div><a href="https://lists.freedesktop.org/archives/modemmanager-devel/2018-February/006167.html">https://lists.freedesktop.org/archives/modemmanager-devel/2018-February/006167.html</a></div><div><a href="https://lists.freedesktop.org/archives/modemmanager-devel/2018-February/006165.html">https://lists.freedesktop.org/archives/modemmanager-devel/2018-February/006165.html</a></div><div><a href="https://lists.freedesktop.org/archives/modemmanager-devel/2018-February/006166.html">https://lists.freedesktop.org/archives/modemmanager-devel/2018-February/006166.html</a><br><br>libmbim-devel:<br><div><a href="https://lists.freedesktop.org/archives/libmbim-devel/2018-February/000985.html">https://lists.freedesktop.org/archives/libmbim-devel/2018-February/000985.html</a><div><a href="https://lists.freedesktop.org/archives/libmbim-devel/2018-February/000986.html">https://lists.freedesktop.org/archives/libmbim-devel/2018-February/000986.html</a><br></div></div></div></div></div></div><div><br></div><div>---</div><div><br></div><div>Thanks,</div><div>Ben</div></div></div>