diff options
author | Arun Kumar Neelakantam <aneela@codeaurora.org> | 2016-03-29 11:53:55 +0530 |
---|---|---|
committer | Jeevan Shriram <jshriram@codeaurora.org> | 2016-04-07 16:01:26 -0700 |
commit | ae4f988961d63774c487a4f1e1ac6d003c6643ab (patch) | |
tree | 5603439ea98ccd498f70efb1e804c23b3a31a21e /drivers | |
parent | 3be4acf2428f6aeb48ed2f39392c8c373efd1cb4 (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/soc/qcom/msm_glink_pkt.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/soc/qcom/msm_glink_pkt.c b/drivers/soc/qcom/msm_glink_pkt.c index 29b007dbf883..7589ea3b747e 100644 --- a/drivers/soc/qcom/msm_glink_pkt.c +++ b/drivers/soc/qcom/msm_glink_pkt.c @@ -984,6 +984,7 @@ int glink_pkt_release(struct inode *inode, struct file *file) { int ret = 0; 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", __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); } 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->in_reset = 0; } |