[to-be-updated] irq-free-setup_irq-interrupt-using-free_irq.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     irq: free setup_irq() interrupt using free_irq()
has been removed from the -mm tree.  Its filename was
     irq-free-setup_irq-interrupt-using-free_irq.patch

This patch was dropped because an updated version will be merged

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: irq: free setup_irq() interrupt using free_irq()
From: Magnus Damm <damm@xxxxxxxxxx>

Add support for using free_irq() on interrupts allocated with setup_irq().
 Without this patch the kernel will try to kfree() the struct irqaction
passed as argument to setup_irq().

Signed-off-by: Magnus Damm <damm@xxxxxxxxxx>
Cc: Paul Mundt <lethal@xxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

On Tue, 2 Dec 2008 10:15:46 +0100 Ingo Molnar <mingo@xxxxxxx> wrote:

> no. Instead of twisting the code flow in this function even more, this 
> should be done cleanly by introducing a helper: __free_irq(), which takes 
> out the guts of free_irq() tha does the non-action related irqchip 
> machinery bits.
> 
> Then change free_irq() to call __free_irq() in the middle, and also 
> provide the __free_irq() function to architecture code. (but do not 
> export it to drivers as it's obviously a dangerous lowlevel facility)
> 

Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/linux/interrupt.h |    2 ++
 kernel/irq/manage.c       |    4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff -puN include/linux/interrupt.h~irq-free-setup_irq-interrupt-using-free_irq include/linux/interrupt.h
--- a/include/linux/interrupt.h~irq-free-setup_irq-interrupt-using-free_irq
+++ a/include/linux/interrupt.h
@@ -49,6 +49,7 @@
  * IRQF_IRQPOLL - Interrupt is used for polling (only the interrupt that is
  *                registered first in an shared interrupt is considered for
  *                performance reasons)
+ * IRQF_STATIC - Interrupt requested with setup_irq(), do not kfree().
  */
 #define IRQF_DISABLED		0x00000020
 #define IRQF_SAMPLE_RANDOM	0x00000040
@@ -58,6 +59,7 @@
 #define IRQF_PERCPU		0x00000400
 #define IRQF_NOBALANCING	0x00000800
 #define IRQF_IRQPOLL		0x00001000
+#define IRQF_STATIC		0x00002000
 
 typedef irqreturn_t (*irq_handler_t)(int, void *);
 
diff -puN kernel/irq/manage.c~irq-free-setup_irq-interrupt-using-free_irq kernel/irq/manage.c
--- a/kernel/irq/manage.c~irq-free-setup_irq-interrupt-using-free_irq
+++ a/kernel/irq/manage.c
@@ -547,6 +547,7 @@ int setup_irq(unsigned int irq, struct i
 {
 	struct irq_desc *desc = irq_to_desc(irq);
 
+	act->flags |= IRQF_STATIC;
 	return __setup_irq(irq, desc, act);
 }
 
@@ -639,7 +640,8 @@ void free_irq(unsigned int irq, void *de
 		local_irq_restore(flags);
 	}
 #endif
-	kfree(action);
+	if (!(action->flags & IRQF_STATIC))
+		kfree(action);
 }
 EXPORT_SYMBOL(free_irq);
 
_

Patches currently in -mm which might be from damm@xxxxxxxxxx are

linux-next.patch
early-platform-driver-v3.patch
clocksource-pass-clocksource-to-read-callback.patch
clocksource-add-enable-and-disable-callbacks.patch
irq-free-setup_irq-interrupt-using-free_irq.patch
pm-rework-includes-remove-arch-ifdefs-v2.patch
pm-cleanup-includes.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux