The workqueue system_nrt_wq is not available in kernel version < 2.6.36.
This backport code creates such a queue but this old kernel does not
have WQ_NON_REENTRANT, so we use a single threaded queue instead as it
should meat the same restrictions.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
spin_unlock_irqrestore(&anchor->lock, flags);
}
EXPORT_SYMBOL_GPL(compat_usb_scuttle_anchored_urbs);
+
+struct workqueue_struct *system_nrt_wq __read_mostly;
+EXPORT_SYMBOL_GPL(system_nrt_wq);
+
+void compat_system_workqueue_create()
+{
+ system_nrt_wq = create_singlethread_workqueue("events_nrt");
+ WARN_ON(system_nrt_wq);
+}
+
+void compat_system_workqueue_destroy()
+{
+ destroy_workqueue(system_nrt_wq);
+}
+
#endif /* CONFIG_COMPAT_USB_URB_THREAD_FIX */
{
/* pm-qos for kernels <= 2.6.24, this is a no-op on newer kernels */
compat_pm_qos_power_init();
+ compat_system_workqueue_create();
printk(KERN_INFO
COMPAT_PROJECT " backport release: "
static void __exit compat_exit(void)
{
compat_pm_qos_power_deinit();
+ compat_system_workqueue_destroy();
return;
}
{
}
+extern struct workqueue_struct *system_nrt_wq;
+
+void compat_system_workqueue_create(void);
+void compat_system_workqueue_destroy(void);
+
+#else
+
+static inline void compat_system_workqueue_create(void)
+{
+}
+
+static inline void compat_system_workqueue_destroy(void)
+{
+}
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */
#endif /* LINUX_26_36_COMPAT_H */