[PATCH RT 1/5] genirq: Set the irq thread policy without checking CAP_SYS_NICE

From
Steven Rostedt <rostedt@goodmis.org>
Date
2013-11-21 18:46:33
Also in
lkml
Reply to
Steven Rostedt, 2013-11-21
3.2.52-rt74-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Thomas Pfaff <redacted>

In commit ee23871389 ("genirq: Set irq thread to RT priority on
creation") we moved the assigment of the thread's priority from the
thread's function into __setup_irq(). That function may run in user
context for instance if the user opens an UART node and then driver
calls requests in the ->open() callback. That user may not have
CAP_SYS_NICE and so the irq thread won't run with the SCHED_OTHER
policy.

This patch uses sched_setscheduler_nocheck() so we omit the CAP_SYS_NICE
check which is otherwise required for the SCHED_OTHER policy.

Cc: Ivo Sieben <redacted>
Cc: <redacted>
Cc: <redacted>
Signed-off-by: Thomas Pfaff <redacted>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
[bigeasy: rewrite the changelog]
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 kernel/irq/manage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 88a4ff5..5b51ba7 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1041,7 +1041,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 			goto out_mput;
 		}
 
-		sched_setscheduler(t, SCHED_FIFO, &param);
+		sched_setscheduler_nocheck(t, SCHED_FIFO, &param);
 
 		/*
 		 * We keep the reference to the task struct even if
-- 
1.8.4.rc3
Thread (6 messages) 6 messages, 1 author, last reply 2013-11-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help