soc: qcom: msm_glink_pkt: remove the wakeup source during device close

Client closing the device immediately after receiving data leaves
the packet arrival wakeup source in active state and block the system
infinitely from entering into suspend state.

Check the state of wakeup source during close operation and release
if it is active.

CRs-Fixed: 989126
Change-Id: I5ad87614edb1307cffaa798f9b393d816dce012a
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
This commit is contained in:
Arun Kumar Neelakantam 2016-03-29 11:53:55 +05:30 committed by Jeevan Shriram
parent 3be4acf242
commit ae4f988961

View file

@ -984,6 +984,7 @@ int glink_pkt_release(struct inode *inode, struct file *file)
{ {
int ret = 0; int ret = 0;
struct glink_pkt_dev *devp = file->private_data; struct glink_pkt_dev *devp = file->private_data;
unsigned long flags;
GLINK_PKT_INFO("%s() on dev id:%d by [%s] ref_cnt[%d]\n", GLINK_PKT_INFO("%s() on dev id:%d by [%s] ref_cnt[%d]\n",
__func__, devp->i, current->comm, devp->ref_cnt); __func__, devp->i, current->comm, devp->ref_cnt);
@ -1011,7 +1012,12 @@ int glink_pkt_release(struct inode *inode, struct file *file)
mutex_lock(&devp->ch_lock); mutex_lock(&devp->ch_lock);
} }
devp->poll_mode = 0; devp->poll_mode = 0;
devp->ws_locked = 0; spin_lock_irqsave(&devp->pa_spinlock, flags);
if (devp->ws_locked) {
__pm_relax(&devp->pa_ws);
devp->ws_locked = 0;
}
spin_unlock_irqrestore(&devp->pa_spinlock, flags);
devp->sigs_updated = false; devp->sigs_updated = false;
devp->in_reset = 0; devp->in_reset = 0;
} }