Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/zcrypt: use system work queue for ap_scan_bus

There is a system work queue system_long_wq for long running work.
Use this work queue for the AP bus scan loop.

Reviewd-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

+8 -18
+8 -18
drivers/s390/crypto/ap_bus.c
··· 76 76 static LIST_HEAD(ap_device_list); 77 77 78 78 /* 79 - * Workqueue & timer for bus rescan. 79 + * Workqueue timer for bus rescan. 80 80 */ 81 - static struct workqueue_struct *ap_work_queue; 82 81 static struct timer_list ap_config_timer; 83 82 static int ap_config_time = AP_CONFIG_TIME; 84 83 static void ap_scan_bus(struct work_struct *); 85 - static DECLARE_WORK(ap_config_work, ap_scan_bus); 84 + static DECLARE_WORK(ap_scan_work, ap_scan_bus); 86 85 87 86 /* 88 87 * Tasklet & timer for AP request polling and interrupts ··· 1246 1247 * Disable scanning for devices, thus we do not want to scan 1247 1248 * for them after removing. 1248 1249 */ 1249 - flush_workqueue(ap_work_queue); 1250 + flush_work(&ap_scan_work); 1250 1251 tasklet_disable(&ap_tasklet); 1251 1252 } 1252 1253 ··· 1279 1280 if (ap_airq_flag) 1280 1281 xchg(ap_airq.lsi_ptr, 0); 1281 1282 tasklet_enable(&ap_tasklet); 1282 - queue_work(ap_work_queue, &ap_config_work); 1283 + queue_work(system_long_wq, &ap_scan_work); 1283 1284 } 1284 1285 1285 1286 static int ap_power_event(struct notifier_block *this, unsigned long event, ··· 1405 1406 return; 1406 1407 /* processing a asynchronous bus rescan */ 1407 1408 del_timer(&ap_config_timer); 1408 - queue_work(ap_work_queue, &ap_config_work); 1409 - flush_work(&ap_config_work); 1409 + queue_work(system_long_wq, &ap_scan_work); 1410 + flush_work(&ap_scan_work); 1410 1411 } 1411 1412 EXPORT_SYMBOL(ap_bus_force_rescan); 1412 1413 ··· 1695 1696 { 1696 1697 if (ap_suspend_flag) 1697 1698 return; 1698 - queue_work(ap_work_queue, &ap_config_work); 1699 + queue_work(system_long_wq, &ap_scan_work); 1699 1700 } 1700 1701 1701 1702 static void ap_reset_domain(void) ··· 1783 1784 if (rc) 1784 1785 goto out_bus; 1785 1786 1786 - ap_work_queue = create_singlethread_workqueue("kapwork"); 1787 - if (!ap_work_queue) { 1788 - rc = -ENOMEM; 1789 - goto out_root; 1790 - } 1791 - 1792 1787 /* Setup the AP bus rescan timer. */ 1793 1788 setup_timer(&ap_config_timer, ap_config_timeout, 0); 1794 1789 ··· 1807 1814 if (rc) 1808 1815 goto out_pm; 1809 1816 1810 - queue_work(ap_work_queue, &ap_config_work); 1817 + queue_work(system_long_wq, &ap_scan_work); 1811 1818 1812 1819 return 0; 1813 1820 ··· 1815 1822 ap_poll_thread_stop(); 1816 1823 out_work: 1817 1824 hrtimer_cancel(&ap_poll_timer); 1818 - destroy_workqueue(ap_work_queue); 1819 - out_root: 1820 1825 root_device_unregister(ap_root_device); 1821 1826 out_bus: 1822 1827 while (i--) ··· 1841 1850 ap_poll_thread_stop(); 1842 1851 del_timer_sync(&ap_config_timer); 1843 1852 hrtimer_cancel(&ap_poll_timer); 1844 - destroy_workqueue(ap_work_queue); 1845 1853 tasklet_kill(&ap_tasklet); 1846 1854 bus_for_each_dev(&ap_bus_type, NULL, NULL, __ap_devices_unregister); 1847 1855 for (i = 0; ap_bus_attrs[i]; i++)