net: rmnet_usb: Fix rx_submitted anchor list corruption

The control receive work is scheduled from interrupt URB completion
handler.  The receive work calls synchronous runtime PM API before
queuing the receive URB.  If suspend is in progress, runtime PM core
will immediately resume the device after the ongoing suspend is
completed.

The suspend and resume is handled by the rmnet data interface driver.
The control receive work state is checked before proceeding to suspend.
If work is pending, suspend is aborted.  Otherwise interrupt URB is
unlinked and considered control interface is suspended.  But a receive
work may get scheduled during interrupt URB unlinking or just before
unlink begins.  The receive work if at all scheduled in this window,
will be waiting for device resume.  The interface resume will queue the
interrupt URB before processing the current receive work and it will
lead to rx_submit anchor list corruption.

Check receive work state after unlinking the interrupt URB during
suspend.  If the work is pending, abort the suspend.

CRs-Fixed: 463353
Change-Id: I8920286be9e29ef02a2643f9b87de99b3294068a
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
1 file changed