usb: smd: Call smd_close API from workqueue context
smd_close API is blocking, hence, cannot be called from ATOMIC
context. Hence, move it from interrupt context to workqueue context.
Change-Id: Iddda44f50c47582734118ee354a83078ea4cf098
CRs-Fixed: 468606
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
diff --git a/drivers/usb/gadget/u_rmnet_ctrl_smd.c b/drivers/usb/gadget/u_rmnet_ctrl_smd.c
index f60aa6a..161634e 100644
--- a/drivers/usb/gadget/u_rmnet_ctrl_smd.c
+++ b/drivers/usb/gadget/u_rmnet_ctrl_smd.c
@@ -408,6 +408,11 @@
struct platform_driver *pdrv;
c = &port->ctrl_ch;
+ if (c->ch) {
+ smd_close(c->ch);
+ c->ch = NULL;
+ }
+
if (test_bit(CH_READY, &c->flags) ||
test_bit(CH_PREPARE_READY, &c->flags)) {
clear_bit(CH_PREPARE_READY, &c->flags);
@@ -460,11 +465,6 @@
smd_tiocmset(c->ch, c->cbits_tomodem, clear_bits);
}
- if (c->ch) {
- smd_close(c->ch);
- c->ch = NULL;
- }
-
queue_delayed_work(grmnet_ctrl_wq, &port->disconnect_w, 0);
}