From 0c677e9c24935bdca8ed72b96f7e762c95fc8bd3 Mon Sep 17 00:00:00 2001 From: Neil Horman Date: Tue, 21 Jul 2015 09:55:43 -0400 Subject: [PATCH] staging: unisys: Change enable/disable to wait forever I don't see why the server should stop responding, or that we should just give up if it does. Wait forever when enabling/disabling the visornic Signed-off-by: Neil Horman Signed-off-by: Benjamin Romer Signed-off-by: Greg Kroah-Hartman --- drivers/staging/unisys/visornic/visornic_main.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index 316f9ac71600..12318365ec7f 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -28,7 +28,7 @@ #include "visorbus.h" #include "iochannel.h" -#define VISORNIC_INFINITE_RESPONSE_WAIT 0 +#define VISORNIC_INFINITE_RSP_WAIT 0 #define VISORNICSOPENMAX 32 #define MAXDEVICES 16384 @@ -549,7 +549,7 @@ visornic_disable_with_timeout(struct net_device *netdev, const int timeout) * when it gets a disable. */ spin_lock_irqsave(&devdata->priv_lock, flags); - while ((timeout == VISORNIC_INFINITE_RESPONSE_WAIT) || + while ((timeout == VISORNIC_INFINITE_RSP_WAIT) || (wait < timeout)) { if (devdata->enab_dis_acked) break; @@ -686,7 +686,7 @@ visornic_enable_with_timeout(struct net_device *netdev, const int timeout) send_enbdis(netdev, 1, devdata); spin_lock_irqsave(&devdata->priv_lock, flags); - while ((timeout == VISORNIC_INFINITE_RESPONSE_WAIT) || + while ((timeout == VISORNIC_INFINITE_RSP_WAIT) || (wait < timeout)) { if (devdata->enab_dis_acked) break; @@ -731,11 +731,13 @@ visornic_timeout_reset(struct work_struct *work) netdev = devdata->netdev; netif_stop_queue(netdev); - response = visornic_disable_with_timeout(netdev, 100); + response = visornic_disable_with_timeout(netdev, + VISORNIC_INFINITE_RSP_WAIT); if (response) goto call_serverdown; - response = visornic_enable_with_timeout(netdev, 100); + response = visornic_enable_with_timeout(netdev, + VISORNIC_INFINITE_RSP_WAIT); if (response) goto call_serverdown; netif_wake_queue(netdev); @@ -756,7 +758,7 @@ call_serverdown: static int visornic_open(struct net_device *netdev) { - visornic_enable_with_timeout(netdev, VISORNIC_INFINITE_RESPONSE_WAIT); + visornic_enable_with_timeout(netdev, VISORNIC_INFINITE_RSP_WAIT); /* start the interface's transmit queue, allowing it to accept * packets for transmission @@ -777,7 +779,7 @@ static int visornic_close(struct net_device *netdev) { netif_stop_queue(netdev); - visornic_disable_with_timeout(netdev, VISORNIC_INFINITE_RESPONSE_WAIT); + visornic_disable_with_timeout(netdev, VISORNIC_INFINITE_RSP_WAIT); return 0; }