From: Thomas Abraham <thomas.abraham@linaro.org>
To: Rob Herring <robherring2@gmail.com>
Cc: devicetree-discuss@lists.ozlabs.org,
linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
rob.herring@calxeda.com, patches@linaro.org
Subject: Re: [PATCH] of/irq: of_irq_init: Call initialization function for all controllers
Date: Wed, 28 Mar 2012 11:32:20 +0530 [thread overview]
Message-ID: <CAJuYYwSTA_oibeF0maCeaMnw4z2hU33wBjW_ussfLY9S-=UEmA@mail.gmail.com> (raw)
In-Reply-To: <CAJuYYwRxCTWxnof1HUqYVX4mbzWCxcab69CJyKxOh13bQbQ_5Q@mail.gmail.com>
On 26 March 2012 21:06, Thomas Abraham <thomas.abraham@linaro.org> wrote:
> On 26 March 2012 18:34, Rob Herring <robherring2@gmail.com> wrote:
>> Your fix doesn't really guarantee the proper order either. It's still a
>> side effect of the implementation. Perhaps a retry mechanism would work.
>> Then the init for wakeup_eint can retry if the gic is not yet setup.
>
> Ok. A retry mechanism would be most robust solution for this case.
>
Hi Rob,
I have attempted an implementation of the the retry mechanism in the
of_irq_init() function. It allows initialization functions of
interrupt controller nodes to report -EAGAIN indicating that the
initialization was not complete and should be retried.
I have tested this and it is working fine. But the complexity of the
interrupt controller's intialization function increases because it has
to undo some of the intialization steps it completed before finding
that the its parent controller was not initialized.
The following is the diff of the changes for of_irq_init() function.
Please let know if this is acceptable.
Thanks,
Thomas.
@@ -452,7 +454,6 @@ void __init of_irq_init(const struct of_device_id *matches)
if (desc->interrupt_parent != parent)
continue;
- list_del(&desc->list);
match = of_match_node(matches, desc->dev);
if (WARN(!match->data,
"of_irq_init: no init function for %s\n",
@@ -466,6 +467,14 @@ void __init of_irq_init(const struct of_device_id *matches)
desc->dev, desc->interrupt_parent);
irq_init_cb = match->data;
ret = irq_init_cb(desc->dev, desc->interrupt_parent);
+ if (ret == -EAGAIN)
+ /*
+ * Interrupt controller's initialization did not
+ * complete and should be retried. So let its
+ * intc_desc be on intc_desc_list.
+ */
+ continue;
+ list_del(&desc->list);
if (ret) {
kfree(desc);
continue;
@@ -482,7 +491,18 @@ void __init of_irq_init(const struct of_device_id *matches)
desc = list_first_entry(&intc_parent_list, typeof(*desc), list);
if (list_empty(&intc_parent_list) || !desc) {
pr_err("of_irq_init: children remain, but no parents\n");
- break;
+ /*
+ * If a search with NULL as parent did not result in any
+ * new parent being found, then the scan for matching
+ * interrupt controller nodes is considered as complete.
+ * Otherwise, if there are pending elements on the
+ * intc_desc_list, then retry this process again with
+ * NULL as parent.
+ */
+ if (!parent)
+ break;
+ parent = NULL;
+ continue;
}
list_del(&desc->list);
parent = desc->dev;
next prev parent reply other threads:[~2012-03-28 6:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-21 2:25 Device node for a controller with two interrupt parents Thomas Abraham
2012-03-21 3:41 ` David Gibson
2012-03-21 13:35 ` Thomas Abraham
2012-03-21 15:13 ` Grant Likely
2012-03-23 10:48 ` Thomas Abraham
[not found] ` <CAJuYYwQapeMthSxSgpaJ5fQNQnyvducgGyi-75WrjZut6akh+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-24 19:07 ` Grant Likely
2012-03-25 12:17 ` Thomas Abraham
2012-03-25 12:38 ` [PATCH] of/irq: of_irq_init: Call initialization function for all controllers Thomas Abraham
2012-03-25 15:20 ` Rob Herring
2012-03-25 16:16 ` Thomas Abraham
2012-03-26 13:04 ` Rob Herring
2012-03-26 15:36 ` Thomas Abraham
2012-03-28 6:02 ` Thomas Abraham [this message]
2012-03-22 1:05 ` Device node for a controller with two interrupt parents David Gibson
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='CAJuYYwSTA_oibeF0maCeaMnw4z2hU33wBjW_ussfLY9S-=UEmA@mail.gmail.com' \
--to=thomas.abraham@linaro.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=patches@linaro.org \
--cc=rob.herring@calxeda.com \
--cc=robherring2@gmail.com \
/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).