Commit 0bde2979 authored by Amitoj Kaur Chawla's avatar Amitoj Kaur Chawla Committed by Greg Kroah-Hartman

staging: unisys: visorbus: visorchipset: Remove create_singlethread_workqueue()

With concurrency managed workqueues, use of dedicated workqueues
can be replaced by using system_wq. Drop periodic_controlvm_workqueue
by using system_wq.

Since there is only one work item periodic_controlvm_work and
different periodic_controlvm_works do not need to be ordered, increase
of concurrency level by switching to system_wq should not break anything.

cancel_delayed_work_sync() is used to ensure that work is not pending
or executing on any CPU.
Signed-off-by: default avatarAmitoj Kaur Chawla <amitoj1606@gmail.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Tested-by: default avatarDavid Kershner <david.kershner@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ec3c13e4
...@@ -102,7 +102,6 @@ struct parser_context { ...@@ -102,7 +102,6 @@ struct parser_context {
}; };
static struct delayed_work periodic_controlvm_work; static struct delayed_work periodic_controlvm_work;
static struct workqueue_struct *periodic_controlvm_workqueue;
static DEFINE_SEMAPHORE(notifier_lock); static DEFINE_SEMAPHORE(notifier_lock);
static struct cdev file_cdev; static struct cdev file_cdev;
...@@ -1913,8 +1912,7 @@ controlvm_periodic_work(struct work_struct *work) ...@@ -1913,8 +1912,7 @@ controlvm_periodic_work(struct work_struct *work)
poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST; poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
} }
queue_delayed_work(periodic_controlvm_workqueue, schedule_delayed_work(&periodic_controlvm_work, poll_jiffies);
&periodic_controlvm_work, poll_jiffies);
} }
static void static void
...@@ -2011,8 +2009,7 @@ setup_crash_devices_work_queue(struct work_struct *work) ...@@ -2011,8 +2009,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_SLOW; poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_SLOW;
queue_delayed_work(periodic_controlvm_workqueue, schedule_delayed_work(&periodic_controlvm_work, poll_jiffies);
&periodic_controlvm_work, poll_jiffies);
} }
static void static void
...@@ -2299,19 +2296,10 @@ visorchipset_init(struct acpi_device *acpi_device) ...@@ -2299,19 +2296,10 @@ visorchipset_init(struct acpi_device *acpi_device)
else else
INIT_DELAYED_WORK(&periodic_controlvm_work, INIT_DELAYED_WORK(&periodic_controlvm_work,
controlvm_periodic_work); controlvm_periodic_work);
periodic_controlvm_workqueue =
create_singlethread_workqueue("visorchipset_controlvm");
if (!periodic_controlvm_workqueue) {
POSTCODE_LINUX_2(CREATE_WORKQUEUE_FAILED_PC,
DIAG_SEVERITY_ERR);
rc = -ENOMEM;
goto cleanup;
}
most_recent_message_jiffies = jiffies; most_recent_message_jiffies = jiffies;
poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST; poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
queue_delayed_work(periodic_controlvm_workqueue, schedule_delayed_work(&periodic_controlvm_work, poll_jiffies);
&periodic_controlvm_work, poll_jiffies);
visorchipset_platform_device.dev.devt = major_dev; visorchipset_platform_device.dev.devt = major_dev;
if (platform_device_register(&visorchipset_platform_device) < 0) { if (platform_device_register(&visorchipset_platform_device) < 0) {
...@@ -2346,10 +2334,7 @@ visorchipset_exit(struct acpi_device *acpi_device) ...@@ -2346,10 +2334,7 @@ visorchipset_exit(struct acpi_device *acpi_device)
visorbus_exit(); visorbus_exit();
cancel_delayed_work(&periodic_controlvm_work); cancel_delayed_work_sync(&periodic_controlvm_work);
flush_workqueue(periodic_controlvm_workqueue);
destroy_workqueue(periodic_controlvm_workqueue);
periodic_controlvm_workqueue = NULL;
destroy_controlvm_payload_info(&controlvm_payload_info); destroy_controlvm_payload_info(&controlvm_payload_info);
memset(&g_chipset_msg_hdr, 0, sizeof(struct controlvm_message_header)); memset(&g_chipset_msg_hdr, 0, sizeof(struct controlvm_message_header));
......
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