Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214924
b: refs/heads/master
c: 5b27d42
h: refs/heads/master
v: v3
  • Loading branch information
Breno Leitao authored and David S. Miller committed Oct 6, 2010
1 parent f76466d commit ff09f54
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9ed51657f6ea2a08582d6a9be5404b044972b7e0
refs/heads/master: 5b27d42755fa6536a89f32b107fb2a53267696c2
1 change: 1 addition & 0 deletions trunk/drivers/net/ehea/ehea.h
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ struct ehea_port {
u8 full_duplex;
u8 autoneg;
u8 num_def_qps;
wait_queue_head_t swqe_avail_wq;
};

struct port_res_cfg {
Expand Down
19 changes: 12 additions & 7 deletions trunk/drivers/net/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,7 @@ static struct ehea_cqe *ehea_proc_cqes(struct ehea_port_res *pr, int my_quota)
pr->queue_stopped = 0;
}
spin_unlock_irqrestore(&pr->netif_queue, flags);
wake_up(&pr->port->swqe_avail_wq);

return cqe;
}
Expand Down Expand Up @@ -2652,6 +2653,8 @@ static int ehea_open(struct net_device *dev)
netif_start_queue(dev);
}

init_waitqueue_head(&port->swqe_avail_wq);

mutex_unlock(&port->port_lock);

return ret;
Expand Down Expand Up @@ -2724,13 +2727,15 @@ static void ehea_flush_sq(struct ehea_port *port)
for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
struct ehea_port_res *pr = &port->port_res[i];
int swqe_max = pr->sq_skba_size - 2 - pr->swqe_ll_count;
int k = 0;
while (atomic_read(&pr->swqe_avail) < swqe_max) {
msleep(5);
if (++k == 20) {
ehea_error("WARNING: sq not flushed completely");
break;
}
int ret;

ret = wait_event_timeout(port->swqe_avail_wq,
atomic_read(&pr->swqe_avail) >= swqe_max,
msecs_to_jiffies(100));

if (!ret) {
ehea_error("WARNING: sq not flushed completely");
break;
}
}
}
Expand Down

0 comments on commit ff09f54

Please sign in to comment.