Loading drivers/char/msm_smd_pkt.c +10 −6 Original line number Diff line number Diff line Loading @@ -1069,6 +1069,8 @@ int smd_pkt_open(struct inode *inode, struct file *file) mutex_lock(&smd_pkt_devp->ch_lock); if (smd_pkt_devp->ch == 0) { unsigned open_wait_rem = smd_pkt_devp->open_modem_wait * 1000; INIT_COMPLETION(smd_pkt_devp->ch_allocated); r = smd_pkt_add_driver(smd_pkt_devp); Loading @@ -1090,7 +1092,7 @@ int smd_pkt_open(struct inode *inode, struct file *file) * retry by user-space modules and to avoid * possible watchdog bite. */ msleep((smd_pkt_devp->open_modem_wait * 1000)); msleep(open_wait_rem); goto release_pd; } } Loading @@ -1111,12 +1113,12 @@ int smd_pkt_open(struct inode *inode, struct file *file) * Wait for a packet channel to be allocated so we know * the modem is ready enough. */ if (smd_pkt_devp->open_modem_wait) { if (open_wait_rem) { r = wait_for_completion_interruptible_timeout( &smd_pkt_devp->ch_allocated, msecs_to_jiffies( smd_pkt_devp->open_modem_wait * 1000)); msecs_to_jiffies(open_wait_rem)); if (r >= 0) open_wait_rem = jiffies_to_msecs(r); if (r == 0) r = -ETIMEDOUT; if (r < 0) { Loading @@ -1137,9 +1139,11 @@ int smd_pkt_open(struct inode *inode, struct file *file) goto release_pil; } open_wait_rem = max_t(unsigned, 2000, open_wait_rem); r = wait_event_interruptible_timeout( smd_pkt_devp->ch_opened_wait_queue, smd_pkt_devp->is_open, (2 * HZ)); smd_pkt_devp->is_open, msecs_to_jiffies(open_wait_rem)); if (r == 0) { r = -ETIMEDOUT; /* close the ch to sync smd's state with smd_pkt */ Loading Loading
drivers/char/msm_smd_pkt.c +10 −6 Original line number Diff line number Diff line Loading @@ -1069,6 +1069,8 @@ int smd_pkt_open(struct inode *inode, struct file *file) mutex_lock(&smd_pkt_devp->ch_lock); if (smd_pkt_devp->ch == 0) { unsigned open_wait_rem = smd_pkt_devp->open_modem_wait * 1000; INIT_COMPLETION(smd_pkt_devp->ch_allocated); r = smd_pkt_add_driver(smd_pkt_devp); Loading @@ -1090,7 +1092,7 @@ int smd_pkt_open(struct inode *inode, struct file *file) * retry by user-space modules and to avoid * possible watchdog bite. */ msleep((smd_pkt_devp->open_modem_wait * 1000)); msleep(open_wait_rem); goto release_pd; } } Loading @@ -1111,12 +1113,12 @@ int smd_pkt_open(struct inode *inode, struct file *file) * Wait for a packet channel to be allocated so we know * the modem is ready enough. */ if (smd_pkt_devp->open_modem_wait) { if (open_wait_rem) { r = wait_for_completion_interruptible_timeout( &smd_pkt_devp->ch_allocated, msecs_to_jiffies( smd_pkt_devp->open_modem_wait * 1000)); msecs_to_jiffies(open_wait_rem)); if (r >= 0) open_wait_rem = jiffies_to_msecs(r); if (r == 0) r = -ETIMEDOUT; if (r < 0) { Loading @@ -1137,9 +1139,11 @@ int smd_pkt_open(struct inode *inode, struct file *file) goto release_pil; } open_wait_rem = max_t(unsigned, 2000, open_wait_rem); r = wait_event_interruptible_timeout( smd_pkt_devp->ch_opened_wait_queue, smd_pkt_devp->is_open, (2 * HZ)); smd_pkt_devp->is_open, msecs_to_jiffies(open_wait_rem)); if (r == 0) { r = -ETIMEDOUT; /* close the ch to sync smd's state with smd_pkt */ Loading