linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 13/14] irq_domain: Remove 'new' irq_domain in favour of the ppc one
Date: Thu, 12 Jan 2012 19:20:34 -0700	[thread overview]
Message-ID: <20120113022034.GA25999@ponder.secretlab.ca> (raw)
In-Reply-To: <4F0F7B60.5040701@gmail.com>

On Thu, Jan 12, 2012 at 06:31:28PM -0600, Rob Herring wrote:
> Adding lakml...
> 
> On 01/11/2012 03:27 PM, Grant Likely wrote:
> > On Wed, Jan 11, 2012 at 2:15 PM, Rob Herring <robherring2@gmail.com> wrote:
> >> Grant,
> >>
> >> On 01/11/2012 02:22 PM, Grant Likely wrote:
> >>> This patch removes the simplistic implementation of irq_domains and enables
> >>> the powerpc infrastructure for all irq_domain users.  The powerpc
> >>> infrastructure includes support for complex mappings between Linux and
> >>> hardware irq numbers, and can manage allocation of irq_descs.
> >>>
> >>> This patch also converts the few users of irq_domain_add()/irq_domain_del()
> >>> to call irq_domain_add_legacy() instead.
> >>
> >> So what is the non-legacy way? Legacy implies we don't want to do it
> >> that way. I guess until we remove all non-DT platforms with GIC we are
> >> stuck with legacy. That seems like it could be a ways out until we get
> >> there.
> > 
> > Non-legacy is letting the irq_domain manage the irq_desc allocations.
> > Some of the controllers will be easy to convert, some will be more
> > difficult.  The primary thing that really blocks getting away from the
> > legacy method is anything that expects hardcoded #defined irq numbers.
> >  The goal is to convert all users over to the linear revmap method.
> > 
> 
> So I gave this a spin on highbank. I ran into a couple problems.
> 
> I had to revert "irqdesc: Consolidate irq reservation logic" which is in
> your branch, but not this series. irq_alloc_desc_from was returning -EEXIST.

Gah, I flubbed that patch too.  Try this on top of it:

---

diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 8a9e2ec..11feb2f 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -375,6 +375,9 @@ __irq_reserve_irqs(int irq, unsigned int from, unsigned int cnt)
 	}
 
 	bitmap_set(allocated_irqs, start, cnt);
+	mutex_unlock(&sparse_irq_lock);
+	return start;
+
 err:
 	mutex_unlock(&sparse_irq_lock);
 	return ret;
@@ -408,7 +411,8 @@ EXPORT_SYMBOL_GPL(__irq_alloc_descs);
  */
 int irq_reserve_irqs(unsigned int from, unsigned int cnt)
 {
-	return __irq_reserve_irqs(from, from, cnt);
+	int start = __irq_reserve_irqs(from, from, cnt);
+	return start < 0 ? start : 0;
 }
 
 /**

  parent reply	other threads:[~2012-01-13  2:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1326313337-24603-1-git-send-email-grant.likely@secretlab.ca>
     [not found] ` <1326313337-24603-14-git-send-email-grant.likely@secretlab.ca>
     [not found]   ` <4F0DFC0F.2090005@gmail.com>
     [not found]     ` <CACxGe6vVSO0cTgPurr6jFoo9QF_W02UaABOFYadCTQGU9dcwmg@mail.gmail.com>
2012-01-13  0:31       ` [RFC 13/14] irq_domain: Remove 'new' irq_domain in favour of the ppc one Rob Herring
2012-01-13  0:47         ` Grant Likely
2012-01-13  0:53           ` Rob Herring
2012-01-13  2:20         ` Grant Likely [this message]
2012-01-17  2:43         ` Michael Bohan
2012-01-17  3:42           ` Benjamin Herrenschmidt
2012-01-18  0:28             ` Grant Likely
2012-01-18  2:16               ` Benjamin Herrenschmidt

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=20120113022034.GA25999@ponder.secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).