public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Milton Miller <miltonm@bga•com>
To: Benjamin Herrenschmidt <benh@kernel•crashing.org>
Cc: linuxppc-dev@lists•ozlabs.org
Subject: [PATCH 4/8] powerpc irq: always free duplicate IRQ_LEGACY hosts
Date: Wed, 25 May 2011 01:34:17 -0500	[thread overview]
Message-ID: <irq-legacy-kfree@mdm.bga.com> (raw)
In-Reply-To: <more-irq-cleanups@mdm.bga.com>

Since kmem caches are allocated before init_IRQ as noted in 3af259d155
(powerpc: Radix trees are available before init_IRQ), we now call
kmalloc in all cases and can can always call kfree if we are asked
to allocate a duplicate or conflicting IRQ_HOST_MAP_LEGACY host.

Signed-off-by: Milton Miller <miltonm@bga•com>

Index: work.git/arch/powerpc/kernel/irq.c
===================================================================
--- work.git.orig/arch/powerpc/kernel/irq.c	2011-05-19 05:51:25.715500763 -0500
+++ work.git/arch/powerpc/kernel/irq.c	2011-05-19 05:57:30.776503350 -0500
@@ -557,15 +557,8 @@ struct irq_host *irq_alloc_host(struct d
 	if (revmap_type == IRQ_HOST_MAP_LEGACY) {
 		if (irq_map[0].host != NULL) {
 			raw_spin_unlock_irqrestore(&irq_big_lock, flags);
-			/* If we are early boot, we can't free the structure,
-			 * too bad...
-			 * this will be fixed once slab is made available early
-			 * instead of the current cruft
-			 */
-			if (mem_init_done) {
-				of_node_put(host->of_node);
-				kfree(host);
-			}
+			of_node_put(host->of_node);
+			kfree(host);
 			return NULL;
 		}
 		irq_map[0].host = host;

  reply	other threads:[~2011-05-25  6:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-25  6:34 [PATCH 0/8] ipi and irq cleanups and fixes Milton Miller
2011-05-25  6:34 ` Milton Miller [this message]
2011-05-25  6:34 ` [PATCH 6/8] powerpc 8xx: cascade eoi will be performed by generic_handle_irq handler Milton Miller
2011-05-26  3:32   ` Benjamin Herrenschmidt
2011-05-26 11:19     ` Milton Miller
2011-05-25  6:34 ` [PATCH 3/8] powerpc irq: remove stale and misleading comment Milton Miller
2011-05-25  6:34 ` [PATCH 5/8] powerpc: check desc in handle_one_irq and expand generic_handle_irq Milton Miller
2011-05-25  6:34 ` [PATCH 2/8] powerpc cell: rename ipi functions to match current abstractions Milton Miller
2011-05-25  6:34 ` [PATCH 7/8] powerpc irq: protect irq_radix_revmap_lookup against irq_free_virt Milton Miller
2011-05-25 21:31   ` Paul E. McKenney
2011-05-25  6:34 ` [PATCH 8/8] powerpc: fix irq_free_virt by adjusting bounds before loop Milton Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=irq-legacy-kfree@mdm.bga.com \
    --to=miltonm@bga$(echo .)com \
    --cc=benh@kernel$(echo .)crashing.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox