Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214925
b: refs/heads/master
c: a8bb69f
h: refs/heads/master
i:
  214923: f76466d
v: v3
  • Loading branch information
Breno Leitao authored and David S. Miller committed Oct 6, 2010
1 parent ff09f54 commit b3a6526
Show file tree
Hide file tree
Showing 3 changed files with 13 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: 5b27d42755fa6536a89f32b107fb2a53267696c2
refs/heads/master: a8bb69f78194dc483f6c4a4bf8860c1ede35fa25
1 change: 1 addition & 0 deletions trunk/drivers/net/ehea/ehea.h
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ struct ehea_port {
u8 autoneg;
u8 num_def_qps;
wait_queue_head_t swqe_avail_wq;
wait_queue_head_t restart_wq;
};

struct port_res_cfg {
Expand Down
18 changes: 11 additions & 7 deletions trunk/drivers/net/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,7 @@ static void reset_sq_restart_flag(struct ehea_port *port)
struct ehea_port_res *pr = &port->port_res[i];
pr->sq_restart_flag = 0;
}
wake_up(&port->restart_wq);
}

static void check_sqs(struct ehea_port *port)
Expand All @@ -796,6 +797,7 @@ static void check_sqs(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 ret;
k = 0;
swqe = ehea_get_swqe(pr->qp, &swqe_index);
memset(swqe, 0, SWQE_HEADER_SIZE);
Expand All @@ -809,13 +811,14 @@ static void check_sqs(struct ehea_port *port)

ehea_post_swqe(pr->qp, swqe);

while (pr->sq_restart_flag == 0) {
msleep(5);
if (++k == 100) {
ehea_error("HW/SW queues out of sync");
ehea_schedule_port_reset(pr->port);
return;
}
ret = wait_event_timeout(port->restart_wq,
pr->sq_restart_flag == 0,
msecs_to_jiffies(100));

if (!ret) {
ehea_error("HW/SW queues out of sync");
ehea_schedule_port_reset(pr->port);
return;
}
}
}
Expand Down Expand Up @@ -2654,6 +2657,7 @@ static int ehea_open(struct net_device *dev)
}

init_waitqueue_head(&port->swqe_avail_wq);
init_waitqueue_head(&port->restart_wq);

mutex_unlock(&port->port_lock);

Expand Down

0 comments on commit b3a6526

Please sign in to comment.