From patchwork Sun Mar 25 15:20:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 7454 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 35B3423E40 for ; Sun, 25 Mar 2012 15:20:38 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id C3608A180DE for ; Sun, 25 Mar 2012 15:20:37 +0000 (UTC) Received: by iage36 with SMTP id e36so9323541iag.11 for ; Sun, 25 Mar 2012 08:20:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :dkim-signature:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding:x-gm-message-state; bh=sIAfzgHg8k8eXFfWK1yNLRV6EnWJx70W9njFw5gpi5U=; b=kYlIiOJiUL+yFKop6ln2f5wIkgGBBLF4K9oFW52vUs9DkTjsOAr3Js30l4ELbqT6qw 8xd3Myx3d/aCoI1JfHig/4eExleCZQRzj7HeEfd+2vM87L/yRS7me4No3dTiwKkXA+Su i9H67aOFiyayr9oCOqAHh19ntgefGQzlmK+01C4SVu/ebeF3kh+Uq4T5gN3lD8yEECOb eTL0FhjceJQtI3xmiGLK3TI1qMVkqZi7uzxCaR8DOpLd+0obFjg57T4jaL6spJSodz6R ZD6e8iyTJ6eXQKdbBi6sROW21u5Q4Rjc9pEN3buLlRCfAXJpnLVRT0lMIMsafqM+4iF7 KscQ== Received: by 10.50.183.163 with SMTP id en3mr3495123igc.12.1332688837223; Sun, 25 Mar 2012 08:20:37 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.203.79 with SMTP id fh15csp69364ibb; Sun, 25 Mar 2012 08:20:36 -0700 (PDT) Received: by 10.182.216.2 with SMTP id om2mr23445327obc.46.1332688836059; Sun, 25 Mar 2012 08:20:36 -0700 (PDT) Received: from mail-ob0-f178.google.com (mail-ob0-f178.google.com [209.85.214.178]) by mx.google.com with ESMTPS id r9si8557970oee.16.2012.03.25.08.20.35 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 25 Mar 2012 08:20:36 -0700 (PDT) Received-SPF: pass (google.com: domain of robherring2@gmail.com designates 209.85.214.178 as permitted sender) client-ip=209.85.214.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robherring2@gmail.com designates 209.85.214.178 as permitted sender) smtp.mail=robherring2@gmail.com; dkim=pass header.i=@gmail.com Received: by obbuo19 with SMTP id uo19so5999807obb.37 for ; Sun, 25 Mar 2012 08:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=sIAfzgHg8k8eXFfWK1yNLRV6EnWJx70W9njFw5gpi5U=; b=mdaJLVPu72JLauPQuQLIH45WI1vLUZuwSYcCpVHQ4KdXpQzCERYPfNbC8j/TUOlDXU 0M1CJ7IgRwfXhAtSntAxlhxaYG7kaDyI3ZR/YtuLlAPrtEsCMQhjmMJ5NjR/tU1Tke3R 9fzUkjcOIEWiGpAtaxMGTUB6/JZVIH8hSsh86woRsOZI76cJ7fy8JLcaMstvHBYmxVd7 Z6SQT1UmheRiB/Q+r/jUMzH+VNsrdCJam8I8bYlx+oPyLdE7fyFdG6bOC4O/YPfcYcH/ d4GVb+qAJDdWHcUxfTAoMyXUWibN3gMmOmKXYQ27R0lTbDeQZKqE+LFu0MqHXQCRZ5Jl ioHA== Received: by 10.60.0.135 with SMTP id 7mr16713145oee.25.1332688835714; Sun, 25 Mar 2012 08:20:35 -0700 (PDT) Received: from [192.168.1.103] (65-36-72-55.dyn.grandenetworks.net. [65.36.72.55]) by mx.google.com with ESMTPS id c6sm4751441oec.13.2012.03.25.08.20.33 (version=SSLv3 cipher=OTHER); Sun, 25 Mar 2012 08:20:34 -0700 (PDT) Message-ID: <4F6F37B6.3050506@gmail.com> Date: Sun, 25 Mar 2012 10:20:22 -0500 From: Rob Herring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120310 Thunderbird/11.0 MIME-Version: 1.0 To: Thomas Abraham 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 References: <1332679129-23864-1-git-send-email-thomas.abraham@linaro.org> In-Reply-To: <1332679129-23864-1-git-send-email-thomas.abraham@linaro.org> X-Gm-Message-State: ALoCoQkMxzmMyBT4zLBM8EYADqV4n8YjqUzLlRvDQPcoYEATQXm1v1UmzMA1KisqAPTY4fNmoRPi On 03/25/2012 07:38 AM, Thomas Abraham wrote: > The of_irq_init function stops processing the interrupt controller hierarchy > when there are no more interrupt controller parents identified. Though this > condition suffices most cases, there are cases where a interrupt controller's > parent controller does not participate in the initialization of the interrupt > hierarchy. An example of such a case is the use of a interrupt nexus node > by a interrupt controller node which delivers interrupts to separate interrupt > parent controllers. > > Instead of stopping the processing of interrupt controller hierarchy in such > a case, the orphan interrupt controller node's descriptor can be identified > and its 'logical' parent in the descriptor is set as NULL. The processing of > interrupt hierarchy is then restarted by looking for descriptors which have > a NULL interrupt parent. > > Cc: Rob Herring > Cc: Grant Likely > Signed-off-by: Thomas Abraham > --- Wouldn't this accomplish the same thing? You just need to add the wakeup-map node name to your matches list. * pointer, interrupt-parent device_node etc. > drivers/of/irq.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- > 1 files changed, 44 insertions(+), 1 deletions(-) > > diff --git a/drivers/of/irq.c b/drivers/of/irq.c > index 9cf0060..70c6ece 100644 > --- a/drivers/of/irq.c > +++ b/drivers/of/irq.c > @@ -400,6 +400,38 @@ struct intc_desc { > }; > > /** > + * of_irq_mark_orphan_desc - Set parent as NULL for a orphan intc_desc > + * @intc_desc_list: the list of intc_desc to search for orphan intc_desc > + * > + * This is a helper function for the of_irq_init function and is invoked > + * when there are child nodes available in intc_desc_list but there are > + * no parent nodes in intc_parent_list. When invoked, this function > + * searches for a intc_desc instance that does not have a parent intc_desc > + * instance in intc_desc_list. The very reason of the invocation of this > + * function ensures that a orphan intc_desc will be found. When found, the > + * interrupt_parent of the orphan intc_desc is set to NULL. > + */ > +static void of_irq_mark_orphan_desc(struct list_head *intc_desc_list) > +{ > + struct intc_desc *desc, *temp_desc; > + > + list_for_each_entry_safe(desc, temp_desc, intc_desc_list, list) { > + struct intc_desc *td1, *td2; > + list_for_each_entry_safe(td1, td2, intc_desc_list, list) { > + if (desc->interrupt_parent == td1->dev) > + break; > + } > + if (desc->interrupt_parent == td1->dev) > + continue; > + > + pr_debug("%s: set interrupt_parent of 'intc_desc' with dev name" > + " %s as NULL\n", __func__, desc->dev->full_name); > + desc->interrupt_parent = NULL; > + return; > + } > +} > + > +/** > * of_irq_init - Scan and init matching interrupt controllers in DT > * @matches: 0 terminated array of nodes to match and init function to call > * > @@ -481,8 +513,19 @@ void __init of_irq_init(const struct of_device_id *matches) > /* Get the next pending parent that might have children */ > desc = list_first_entry(&intc_parent_list, typeof(*desc), list); > if (list_empty(&intc_parent_list) || !desc) { > + /* > + * This has reached a point where there are children in > + * the intc_desc_list but no parent in intc_parent_list. > + * This means there is a child desc in intc_desc_list > + * whose parent is not one of the remaining elements of > + * the intc_desc_list. Such a child node is marked as > + * orphan (interrupt_parent is set to NULL) and the > + * process continues with parent set to NULL. > + */ > pr_err("of_irq_init: children remain, but no parents\n"); > - break; > + of_irq_mark_orphan_desc(&intc_desc_list); > + parent = NULL; > + continue; > } > list_del(&desc->list); > parent = desc->dev; diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 9cf0060..deeaf00 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -416,8 +416,6 @@ void __init of_irq_init(const struct of_device_id *matches) INIT_LIST_HEAD(&intc_parent_list); for_each_matching_node(np, matches) { - if (!of_find_property(np, "interrupt-controller", NULL)) - continue; /* * Here, we allocate and populate an intc_desc with the node