]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - kernel/irq/manage.c
genirq: Set irq thread to RT priority on creation
[karo-tx-linux.git] / kernel / irq / manage.c
index fa17855ca65a235bd5c1f9a7daa042b57722b924..e16caa81f8872b88ad9d73562352ac54477c0cf7 100644 (file)
@@ -840,9 +840,6 @@ static void irq_thread_dtor(struct callback_head *unused)
 static int irq_thread(void *data)
 {
        struct callback_head on_exit_work;
-       static const struct sched_param param = {
-               .sched_priority = MAX_USER_RT_PRIO/2,
-       };
        struct irqaction *action = data;
        struct irq_desc *desc = irq_to_desc(action->irq);
        irqreturn_t (*handler_fn)(struct irq_desc *desc,
@@ -854,8 +851,6 @@ static int irq_thread(void *data)
        else
                handler_fn = irq_thread_fn;
 
-       sched_setscheduler(current, SCHED_FIFO, &param);
-
        init_task_work(&on_exit_work, irq_thread_dtor);
        task_work_add(current, &on_exit_work, false);
 
@@ -950,6 +945,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
         */
        if (new->thread_fn && !nested) {
                struct task_struct *t;
+               static const struct sched_param param = {
+                       .sched_priority = MAX_USER_RT_PRIO/2,
+               };
 
                t = kthread_create(irq_thread, new, "irq/%d-%s", irq,
                                   new->name);
@@ -957,6 +955,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
                        ret = PTR_ERR(t);
                        goto out_mput;
                }
+
+               sched_setscheduler(t, SCHED_FIFO, &param);
+
                /*
                 * We keep the reference to the task struct even if
                 * the thread dies to avoid that the interrupt code