net: usb: Abort suspend if get_encap response is not sent

Cherry picked from 9a8280fab6030abef96ca835ef88f92926ca88bb

After receiving response available notification driver queues
a work to send get_encap response. pm state is set to
RPM_SUSPENDING before interface suspend is initiated. If
interface suspend happens after queuing the work then work
will be executed and blocked until it is done. Work tries to
resume the interface synchronously by calling rpm_resume().
This causes rpm_resume() to wait indefinitely for the pm state
to change from RPM_SUSPENDED to RPM_RESUME which will not
happen until interface suspend returns EBUSY. Hence avoid this
situation by aborting interface suspend if work is pending
or running.

CRs-Fixed: 415208
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Change-Id: Ib2a079a7107d994f760c0a876736ede3add07ea2
This commit is contained in:
Hemant Kumar 2012-10-31 19:14:25 -07:00 committed by Iliyan Malchev
parent 4c142bbbd0
commit 023fc753b5

View file

@ -339,8 +339,10 @@ int rmnet_usb_ctrl_start_rx(struct rmnet_ctrl_dev *dev)
int rmnet_usb_ctrl_suspend(struct rmnet_ctrl_dev *dev)
{
if (!flush_work_sync(&dev->get_encap_work))
usb_kill_anchored_urbs(&dev->rx_submitted);
if (work_busy(&dev->get_encap_work))
return -EBUSY;
usb_kill_anchored_urbs(&dev->rx_submitted);
return 0;
}