Patchwork Patch "genirq: Deal with desc->set_type() changing desc->chip" has been added to the 2.6.34-stable tree

mail settings
Date July 28, 2010, 12:24 a.m.
Message ID <12802766911316@site>
Download mbox | patch
Permalink /patch/60073/
State Not Applicable
Headers show

Comments - July 28, 2010, 12:24 a.m.
This is a note to let you know that I've just added the patch titled

    genirq: Deal with desc->set_type() changing desc->chip

to the 2.6.34-stable tree which can be found at:;a=summary

The filename of the patch is:
and it can be found in the queue-2.6.34 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <> know about it.

From 4673247562e39a17e09440fa1400819522ccd446 Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <>
Date: Mon, 7 Jun 2010 17:53:51 +0200
Subject: genirq: Deal with desc->set_type() changing desc->chip

From: Thomas Gleixner <>

commit 4673247562e39a17e09440fa1400819522ccd446 upstream.

The set_type() function can change the chip implementation when the
trigger mode changes. That might result in using an non-initialized
irq chip when called from __setup_irq() or when called via
set_irq_type() on an already enabled irq.

The set_irq_type() function should not be called on an enabled irq,
but because we forgot to put a check into it, we have a bunch of users
which grew the habit of doing that and it never blew up as the
function is serialized via desc->lock against all users of desc->chip
and they never hit the non-initialized irq chip issue.

The easy fix for the __setup_irq() issue would be to move the
irq_chip_set_defaults(desc->chip) call after the trigger setting to
make sure that a chip change is covered.

But as we have already users, which do the type setting after
request_irq(), the safe fix for now is to call irq_chip_set_defaults()
from __irq_set_trigger() when desc->set_type() changed the irq chip.

It needs a deeper analysis whether we should refuse to change the chip
on an already enabled irq, but that'd be a large scale change to fix
all the existing users. So that's neither stable nor 2.6.35 material.

Reported-by: Esben Haabendal <>
Signed-off-by: Thomas Gleixner <>
Cc: Benjamin Herrenschmidt <>
Cc: linuxppc-dev <>
Signed-off-by: Greg Kroah-Hartman <>

 kernel/irq/manage.c |    3 +++
 1 file changed, 3 insertions(+)

Patches currently in stable-queue which might be from are



--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -440,6 +440,9 @@  int __irq_set_trigger(struct irq_desc *d
 		desc->status &= ~(IRQ_LEVEL | IRQ_TYPE_SENSE_MASK);
 		desc->status |= flags;
+		if (chip != desc->chip)
+			irq_chip_set_defaults(desc->chip);
 	return ret;