@@ -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, ¶m);
current->flags |= PF_NOFREEZE;
while (!kthread_should_stop()) {