diff mbox

mfd: speedup twl4030 irq response time and decrease irq disable time

Message ID 1285120171-3030-1-git-send-email-tom.leiming@gmail.com (mailing list archive)
State Awaiting Upstream, archived
Headers show

Commit Message

Ming Lei Sept. 22, 2010, 1:49 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
index 097f24d..d1e0d80 100644
--- a/drivers/mfd/twl4030-irq.c
+++ b/drivers/mfd/twl4030-irq.c
@@ -286,8 +286,16 @@  static int twl4030_irq_thread(void *data)
 	long irq = (long)data;
 	static unsigned i2c_errors;
 	static const unsigned max_i2c_errors = 100;
-
-
+	struct sched_param param = {
+		.sched_priority = MAX_USER_RT_PRIO/2 + 10,
+	};
+
+	/* Take higher priority than threaded irq to make us immune of
+ 	 * preemption from twl4030 subchips's threaded irq handler, then
+ 	 * we can complete all SIH irqs' handling and enable PIH irq
+ 	 * again asap.
+ 	 * */
+	sched_setscheduler(current, SCHED_FIFO, &param);
 	current->flags |= PF_NOFREEZE;
 
 	while (!kthread_should_stop()) {