usb: gadget: ECM: Check if data interface is UP while bus_suspend
CDC ECM requires DATA interface to support two alternate settings.
Bulk (IO) endpoints must be supported only in 1st alternate setting,
not in the default one. Alternate setting is chosen by host using
SET_INTERFACE command after SET_CONFIGURATION. SET_CONFIG results
in set_alt(0) followed by set_alt(1) when SET_INTERFACE is sent.
There is a possibility of USB bus getting suspended between this
window of SET_CONFIG and SET_INTERFACE. This currently results in
a crash in bus_suspend routine of ECM which assumes that by this
time DATA interface would be up. Fix this by adding a check in
ECM bus_suspend/resume routines to bail out if set_alt(1) is not
yet received by device.
CRs-fixed: 614120
Change-Id: Ic002b75f20d2d4f23f6a5dd7b4df365c25f20e0f
Signed-off-by:
Manu Gautam <mgautam@codeaurora.org>
Loading
Please register or sign in to comment