mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
USB: android gadget: queue the request only when serial is online
As a part of comp switch serial driver may queue the request during serial unregistration, since serial unregistration is not happening in atomic context. Add variable to maintain serial driver state and verify that variable before queuing the request. Signed-off-by: Anji Jonnala <anjir@qualcomm.com>
This commit is contained in:
parent
f2fbda6175
commit
602b4dcc05
1 changed files with 3 additions and 0 deletions
|
@ -32,6 +32,7 @@ struct f_gser {
|
|||
u8 data_id;
|
||||
u8 port_num;
|
||||
|
||||
u8 online;
|
||||
#ifdef CONFIG_MODEM_SUPPORT
|
||||
u8 pending;
|
||||
spinlock_t lock;
|
||||
|
@ -385,6 +386,7 @@ static int gser_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
|
|||
}
|
||||
}
|
||||
gserial_connect(&gser->port, gser->port_num);
|
||||
gser->online = 1;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -400,6 +402,7 @@ static void gser_disable(struct usb_function *f)
|
|||
usb_ep_fifo_flush(gser->notify);
|
||||
usb_ep_disable(gser->notify);
|
||||
#endif
|
||||
gser->online = 0;
|
||||
}
|
||||
#ifdef CONFIG_MODEM_SUPPORT
|
||||
static int gser_notify(struct f_gser *gser, u8 type, u16 value,
|
||||
|
|
Loading…
Reference in a new issue