Commit d8496efa authored by Chas Williams's avatar Chas Williams Committed by David S. Miller

[ATM]: [iphase] remove sleep_on*() usage

Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarChas Williams <chas@cmf.nrl.navy.mil>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d627bd38
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/uio.h> #include <linux/uio.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/wait.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/atomic.h> #include <asm/atomic.h>
...@@ -2586,14 +2587,14 @@ static int __init ia_start(struct atm_dev *dev) ...@@ -2586,14 +2587,14 @@ static int __init ia_start(struct atm_dev *dev)
} }
static void ia_close(struct atm_vcc *vcc) static void ia_close(struct atm_vcc *vcc)
{ {
DEFINE_WAIT(wait);
u16 *vc_table; u16 *vc_table;
IADEV *iadev; IADEV *iadev;
struct ia_vcc *ia_vcc; struct ia_vcc *ia_vcc;
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
struct sk_buff_head tmp_tx_backlog, tmp_vcc_backlog; struct sk_buff_head tmp_tx_backlog, tmp_vcc_backlog;
unsigned long closetime, flags; unsigned long closetime, flags;
int ctimeout;
iadev = INPH_IA_DEV(vcc->dev); iadev = INPH_IA_DEV(vcc->dev);
ia_vcc = INPH_IA_VCC(vcc); ia_vcc = INPH_IA_VCC(vcc);
...@@ -2606,7 +2607,9 @@ static void ia_close(struct atm_vcc *vcc) ...@@ -2606,7 +2607,9 @@ static void ia_close(struct atm_vcc *vcc)
skb_queue_head_init (&tmp_vcc_backlog); skb_queue_head_init (&tmp_vcc_backlog);
if (vcc->qos.txtp.traffic_class != ATM_NONE) { if (vcc->qos.txtp.traffic_class != ATM_NONE) {
iadev->close_pending++; iadev->close_pending++;
sleep_on_timeout(&iadev->timeout_wait, 50); prepare_to_wait(&iadev->timeout_wait, &wait, TASK_UNINTERRUPTIBLE);
schedule_timeout(50);
finish_wait(&iadev->timeout_wait, &wait);
spin_lock_irqsave(&iadev->tx_lock, flags); spin_lock_irqsave(&iadev->tx_lock, flags);
while((skb = skb_dequeue(&iadev->tx_backlog))) { while((skb = skb_dequeue(&iadev->tx_backlog))) {
if (ATM_SKB(skb)->vcc == vcc){ if (ATM_SKB(skb)->vcc == vcc){
...@@ -2619,17 +2622,12 @@ static void ia_close(struct atm_vcc *vcc) ...@@ -2619,17 +2622,12 @@ static void ia_close(struct atm_vcc *vcc)
while((skb = skb_dequeue(&tmp_tx_backlog))) while((skb = skb_dequeue(&tmp_tx_backlog)))
skb_queue_tail(&iadev->tx_backlog, skb); skb_queue_tail(&iadev->tx_backlog, skb);
IF_EVENT(printk("IA TX Done decs_cnt = %d\n", ia_vcc->vc_desc_cnt);) IF_EVENT(printk("IA TX Done decs_cnt = %d\n", ia_vcc->vc_desc_cnt);)
closetime = jiffies; closetime = 300000 / ia_vcc->pcr;
ctimeout = 300000 / ia_vcc->pcr; if (closetime == 0)
if (ctimeout == 0) closetime = 1;
ctimeout = 1; spin_unlock_irqrestore(&iadev->tx_lock, flags);
while (ia_vcc->vc_desc_cnt > 0){ wait_event_timeout(iadev->close_wait, (ia_vcc->vc_desc_cnt <= 0), closetime);
if ((jiffies - closetime) >= ctimeout) spin_lock_irqsave(&iadev->tx_lock, flags);
break;
spin_unlock_irqrestore(&iadev->tx_lock, flags);
sleep_on(&iadev->close_wait);
spin_lock_irqsave(&iadev->tx_lock, flags);
}
iadev->close_pending--; iadev->close_pending--;
iadev->testTable[vcc->vci]->lastTime = 0; iadev->testTable[vcc->vci]->lastTime = 0;
iadev->testTable[vcc->vci]->fract = 0; iadev->testTable[vcc->vci]->fract = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment