Commit ace72eef authored by Neil Horman's avatar Neil Horman Committed by Greg Kroah-Hartman

staging: unisys: Make serverdown synchronous

I don't see why serverdown should be async on a workqueue.  Just make it
synchronous, and remove some code in the process
Signed-off-by: default avatarNeil Horman <nhorman@redhat.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0d507393
...@@ -61,7 +61,6 @@ static const struct file_operations debugfs_enable_ints_fops = { ...@@ -61,7 +61,6 @@ static const struct file_operations debugfs_enable_ints_fops = {
.write = enable_ints_write, .write = enable_ints_write,
}; };
static struct workqueue_struct *visornic_serverdown_workqueue;
static struct workqueue_struct *visornic_timeout_reset_workqueue; static struct workqueue_struct *visornic_timeout_reset_workqueue;
/* GUIDS for director channel type supported by this driver. */ /* GUIDS for director channel type supported by this driver. */
...@@ -148,7 +147,6 @@ struct visornic_devdata { ...@@ -148,7 +147,6 @@ struct visornic_devdata {
* xmit buffer list that have been * xmit buffer list that have been
* sent to the IOPART end * sent to the IOPART end
*/ */
struct work_struct serverdown_completion;
visorbus_state_complete_func server_down_complete_func; visorbus_state_complete_func server_down_complete_func;
struct work_struct timeout_reset; struct work_struct timeout_reset;
struct uiscmdrsp *cmdrsp_rcv; /* cmdrsp_rcv is used for struct uiscmdrsp *cmdrsp_rcv; /* cmdrsp_rcv is used for
...@@ -367,13 +365,10 @@ static ssize_t enable_ints_write(struct file *file, ...@@ -367,13 +365,10 @@ static ssize_t enable_ints_write(struct file *file,
* Returns void. * Returns void.
*/ */
static void static void
visornic_serverdown_complete(struct work_struct *work) visornic_serverdown_complete(struct visornic_devdata *devdata)
{ {
struct visornic_devdata *devdata;
struct net_device *netdev; struct net_device *netdev;
devdata = container_of(work, struct visornic_devdata,
serverdown_completion);
netdev = devdata->netdev; netdev = devdata->netdev;
/* Stop using datachan */ /* Stop using datachan */
...@@ -418,8 +413,7 @@ visornic_serverdown(struct visornic_devdata *devdata, ...@@ -418,8 +413,7 @@ visornic_serverdown(struct visornic_devdata *devdata,
} }
devdata->server_change_state = true; devdata->server_change_state = true;
devdata->server_down_complete_func = complete_func; devdata->server_down_complete_func = complete_func;
queue_work(visornic_serverdown_workqueue, visornic_serverdown_complete(devdata);
&devdata->serverdown_completion);
} else if (devdata->server_change_state) { } else if (devdata->server_change_state) {
dev_dbg(&devdata->dev->device, "%s changing state\n", dev_dbg(&devdata->dev->device, "%s changing state\n",
__func__); __func__);
...@@ -1892,8 +1886,6 @@ static int visornic_probe(struct visor_device *dev) ...@@ -1892,8 +1886,6 @@ static int visornic_probe(struct visor_device *dev)
err = -ENOMEM; err = -ENOMEM;
goto cleanup_xmit_cmdrsp; goto cleanup_xmit_cmdrsp;
} }
INIT_WORK(&devdata->serverdown_completion,
visornic_serverdown_complete);
INIT_WORK(&devdata->timeout_reset, visornic_timeout_reset); INIT_WORK(&devdata->timeout_reset, visornic_timeout_reset);
devdata->server_down = false; devdata->server_down = false;
devdata->server_change_state = false; devdata->server_change_state = false;
...@@ -2019,7 +2011,6 @@ static void visornic_remove(struct visor_device *dev) ...@@ -2019,7 +2011,6 @@ static void visornic_remove(struct visor_device *dev)
} }
/* going_away prevents new items being added to the workqueues */ /* going_away prevents new items being added to the workqueues */
flush_workqueue(visornic_serverdown_workqueue);
flush_workqueue(visornic_timeout_reset_workqueue); flush_workqueue(visornic_timeout_reset_workqueue);
debugfs_remove_recursive(devdata->eth_debugfs_dir); debugfs_remove_recursive(devdata->eth_debugfs_dir);
...@@ -2155,12 +2146,6 @@ static int visornic_init(void) ...@@ -2155,12 +2146,6 @@ static int visornic_init(void)
if (!ret) if (!ret)
goto cleanup_debugfs; goto cleanup_debugfs;
/* create workqueue for serverdown completion */
visornic_serverdown_workqueue =
create_singlethread_workqueue("visornic_serverdown");
if (!visornic_serverdown_workqueue)
goto cleanup_debugfs;
/* create workqueue for tx timeout reset */ /* create workqueue for tx timeout reset */
visornic_timeout_reset_workqueue = visornic_timeout_reset_workqueue =
create_singlethread_workqueue("visornic_timeout_reset"); create_singlethread_workqueue("visornic_timeout_reset");
...@@ -2176,8 +2161,6 @@ static int visornic_init(void) ...@@ -2176,8 +2161,6 @@ static int visornic_init(void)
return 0; return 0;
cleanup_workqueue: cleanup_workqueue:
flush_workqueue(visornic_serverdown_workqueue);
destroy_workqueue(visornic_serverdown_workqueue);
if (visornic_timeout_reset_workqueue) { if (visornic_timeout_reset_workqueue) {
flush_workqueue(visornic_timeout_reset_workqueue); flush_workqueue(visornic_timeout_reset_workqueue);
destroy_workqueue(visornic_timeout_reset_workqueue); destroy_workqueue(visornic_timeout_reset_workqueue);
...@@ -2197,10 +2180,6 @@ static void visornic_cleanup(void) ...@@ -2197,10 +2180,6 @@ static void visornic_cleanup(void)
{ {
visorbus_unregister_visor_driver(&visornic_driver); visorbus_unregister_visor_driver(&visornic_driver);
if (visornic_serverdown_workqueue) {
flush_workqueue(visornic_serverdown_workqueue);
destroy_workqueue(visornic_serverdown_workqueue);
}
if (visornic_timeout_reset_workqueue) { if (visornic_timeout_reset_workqueue) {
flush_workqueue(visornic_timeout_reset_workqueue); flush_workqueue(visornic_timeout_reset_workqueue);
destroy_workqueue(visornic_timeout_reset_workqueue); destroy_workqueue(visornic_timeout_reset_workqueue);
......
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