diff options
Diffstat (limited to 'drivers/net/ehea/ehea_main.c')
-rw-r--r-- | drivers/net/ehea/ehea_main.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 7897bdf76e66..15401af30108 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -786,6 +786,7 @@ static void reset_sq_restart_flag(struct ehea_port *port) | |||
786 | struct ehea_port_res *pr = &port->port_res[i]; | 786 | struct ehea_port_res *pr = &port->port_res[i]; |
787 | pr->sq_restart_flag = 0; | 787 | pr->sq_restart_flag = 0; |
788 | } | 788 | } |
789 | wake_up(&port->restart_wq); | ||
789 | } | 790 | } |
790 | 791 | ||
791 | static void check_sqs(struct ehea_port *port) | 792 | static void check_sqs(struct ehea_port *port) |
@@ -796,6 +797,7 @@ static void check_sqs(struct ehea_port *port) | |||
796 | 797 | ||
797 | for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) { | 798 | for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) { |
798 | struct ehea_port_res *pr = &port->port_res[i]; | 799 | struct ehea_port_res *pr = &port->port_res[i]; |
800 | int ret; | ||
799 | k = 0; | 801 | k = 0; |
800 | swqe = ehea_get_swqe(pr->qp, &swqe_index); | 802 | swqe = ehea_get_swqe(pr->qp, &swqe_index); |
801 | memset(swqe, 0, SWQE_HEADER_SIZE); | 803 | memset(swqe, 0, SWQE_HEADER_SIZE); |
@@ -809,13 +811,14 @@ static void check_sqs(struct ehea_port *port) | |||
809 | 811 | ||
810 | ehea_post_swqe(pr->qp, swqe); | 812 | ehea_post_swqe(pr->qp, swqe); |
811 | 813 | ||
812 | while (pr->sq_restart_flag == 0) { | 814 | ret = wait_event_timeout(port->restart_wq, |
813 | msleep(5); | 815 | pr->sq_restart_flag == 0, |
814 | if (++k == 100) { | 816 | msecs_to_jiffies(100)); |
815 | ehea_error("HW/SW queues out of sync"); | 817 | |
816 | ehea_schedule_port_reset(pr->port); | 818 | if (!ret) { |
817 | return; | 819 | ehea_error("HW/SW queues out of sync"); |
818 | } | 820 | ehea_schedule_port_reset(pr->port); |
821 | return; | ||
819 | } | 822 | } |
820 | } | 823 | } |
821 | } | 824 | } |
@@ -2654,6 +2657,7 @@ static int ehea_open(struct net_device *dev) | |||
2654 | } | 2657 | } |
2655 | 2658 | ||
2656 | init_waitqueue_head(&port->swqe_avail_wq); | 2659 | init_waitqueue_head(&port->swqe_avail_wq); |
2660 | init_waitqueue_head(&port->restart_wq); | ||
2657 | 2661 | ||
2658 | mutex_unlock(&port->port_lock); | 2662 | mutex_unlock(&port->port_lock); |
2659 | 2663 | ||