Commit 96adbd27 authored by Alison Schofield's avatar Alison Schofield Committed by Greg Kroah-Hartman

staging: wilc1000: replace sem_test_disconn_block with a completion

Semaphore sem_test_disconn_block is used to signal completion of its
host interface message. Since the thread locking this semaphore will
have to wait, completions are the preferred mechanism and will offer
a performance improvement.
Signed-off-by: default avatarAlison Schofield <amsfield22@gmail.com>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Tested-by: default avatarLeo Kim <leo.kim@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7c8a3dca
...@@ -1857,7 +1857,7 @@ static void Handle_Disconnect(struct wilc_vif *vif) ...@@ -1857,7 +1857,7 @@ static void Handle_Disconnect(struct wilc_vif *vif)
} }
} }
up(&hif_drv->sem_test_disconn_block); complete(&hif_drv->comp_test_disconn_block);
} }
void wilc_resolve_disconnect_aberration(struct wilc_vif *vif) void wilc_resolve_disconnect_aberration(struct wilc_vif *vif)
...@@ -3099,7 +3099,7 @@ int wilc_disconnect(struct wilc_vif *vif, u16 reason_code) ...@@ -3099,7 +3099,7 @@ int wilc_disconnect(struct wilc_vif *vif, u16 reason_code)
if (result) if (result)
netdev_err(vif->ndev, "Failed to send message: disconnect\n"); netdev_err(vif->ndev, "Failed to send message: disconnect\n");
down(&hif_drv->sem_test_disconn_block); wait_for_completion(&hif_drv->comp_test_disconn_block);
return result; return result;
} }
...@@ -3406,7 +3406,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) ...@@ -3406,7 +3406,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
} }
sema_init(&hif_drv->sem_test_key_block, 0); sema_init(&hif_drv->sem_test_key_block, 0);
sema_init(&hif_drv->sem_test_disconn_block, 0); init_completion(&hif_drv->comp_test_disconn_block);
init_completion(&hif_drv->comp_get_rssi); init_completion(&hif_drv->comp_get_rssi);
init_completion(&hif_drv->comp_inactive_time); init_completion(&hif_drv->comp_inactive_time);
......
...@@ -276,7 +276,7 @@ struct host_if_drv { ...@@ -276,7 +276,7 @@ struct host_if_drv {
struct mutex cfg_values_lock; struct mutex cfg_values_lock;
struct semaphore sem_test_key_block; struct semaphore sem_test_key_block;
struct semaphore sem_test_disconn_block; struct completion comp_test_disconn_block;
struct completion comp_get_rssi; struct completion comp_get_rssi;
struct completion comp_inactive_time; struct completion comp_inactive_time;
......
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