The TIMER_IRQSAFE usage was introduced in commit 22597dc3d97b1 ("kthread: initial support for delayed kthread work") which modelled the delayed kthread code after workqueue's code. The workqueue code requires the flag TIMER_IRQSAFE for synchronisation purpose. This is not true for kthread's delay timer since all operations occur under a lock. Remove TIMER_IRQSAFE from the timer initialisation and use timer_setup() for initialisation purpose which is the official function.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -164,9 +164,8 @@ extern void __kthread_init_worker(struct kthread_worker *worker, · 163 unmodified lines | ||
| 164 | 164 | #define kthread_init_delayed_work(dwork, fn) \ |
| 165 | 165 | do { \ |
| 166 | 166 | kthread_init_work(&(dwork)->work, (fn)); \ |
| 167 | − __init_timer(&(dwork)->timer, \ | |
| 168 | − kthread_delayed_work_timer_fn, \ | |
| 169 | − TIMER_IRQSAFE); \ | |
| 167 | + timer_setup(&(dwork)->timer, \ | |
| 168 | + kthread_delayed_work_timer_fn, 0); \ | |
| 170 | 169 | } while (0) |
| 171 | 170 | |
| 172 | 171 | int kthread_worker_fn(void *worker_ptr); |