From patchwork Thu Aug 9 15:53:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 10643 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 EA2C223E40 for ; Thu, 9 Aug 2012 15:54:07 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id B87A4A189A8 for ; Thu, 9 Aug 2012 15:54:07 +0000 (UTC) Received: by ghbg10 with SMTP id g10so591745ghb.11 for ; Thu, 09 Aug 2012 08:54:07 -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:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=hhcNNdOvqJMRMQrzz5kSZt0+muR+LEJ0Kk5Mxq/kTjk=; b=CMhYCW1KmRQM7IQlMWFzpdjSGHYdtl9Y1NDw6saBb1Fgbe3Wqi9pvJvzplx1u220co xj2aqSxEkJj9KHvEsIJZ5dNMAtJisQYTLIO4ZZyA/ZrH3cBGA67N+zKQYsgmyCpqDQWF elviNyJuO2wEug97AZHZkPzzBQoJxV5wmGxO8II06Wfsz0wH2vcvT9g404bpAnV19xFC gOvGaLpS+oB5j/63urkZtSRMu4kegoWbd/UwHDApmUBna3Yhq4hsr7SyrO8NRLI331oT zmwsxdVqdeilxKnQaHaDdSEFxdOPyNogiFHbkVexDlGUdP0dirEgSXHro7JlDIKlZ4Z2 rRxA== Received: by 10.50.57.168 with SMTP id j8mr1595105igq.16.1344527646948; Thu, 09 Aug 2012 08:54:06 -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.50.184.200 with SMTP id ew8csp15561igc; Thu, 9 Aug 2012 08:54:06 -0700 (PDT) Received: by 10.180.82.164 with SMTP id j4mr3943155wiy.18.1344527645530; Thu, 09 Aug 2012 08:54:05 -0700 (PDT) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by mx.google.com with ESMTPS id 5si2023432wet.10.2012.08.09.08.54.05 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Aug 2012 08:54:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.172 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.172; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.172 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by wibhm11 with SMTP id hm11so384437wib.13 for ; Thu, 09 Aug 2012 08:54:05 -0700 (PDT) Received: by 10.216.138.73 with SMTP id z51mr11431727wei.39.1344527644896; Thu, 09 Aug 2012 08:54:04 -0700 (PDT) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id cl8sm2302659wib.10.2012.08.09.08.54.03 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Aug 2012 08:54:04 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: STEricsson_nomadik_linux@list.st.com, linus.walleij@stericsson.com, arnd@arndb.de, broonie@opensource.wolfsonmicro.com, Lee Jones , Benjamin Herrenschmidt , Grant Likely Subject: [PATCH 2/8] irqdomain: Take interrupt-parent property into account if specified Date: Thu, 9 Aug 2012 16:53:49 +0100 Message-Id: <1344527635-6163-3-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1344527635-6163-1-git-send-email-lee.jones@linaro.org> References: <1344527635-6163-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQmvPcXrWn79gVzJRUVxNLq6LySQGVMIl8FBTqQTYuQxV7EFGPyuc0FAk0RItt3dl3K/YjUV irq_find_host() currently ignores the 'interrupt-parent' property even if it's specified in the Device Tree. Meaning that a node can match to a domain in its hierarchy even if it doesn't belong to it. By searching for the parent first using of_irq_find_parent() we insist that the 'interrupt-parent' property is taken into account ensuring a greater chance of returning the correct domain. CC: Benjamin Herrenschmidt CC: Grant Likely Signed-off-by: Lee Jones --- kernel/irq/irqdomain.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 49a7772..db63b9b 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -323,8 +324,14 @@ EXPORT_SYMBOL_GPL(irq_domain_add_tree); struct irq_domain *irq_find_host(struct device_node *node) { struct irq_domain *h, *found = NULL; + struct device_node *parent_node; int rc; + /* Take heed if an 'interrupt-parent' was specified. */ + parent_node = of_irq_find_parent(node); + if (parent_node) + node = parent_node; + /* We might want to match the legacy controller last since * it might potentially be set to match all interrupts in * the absence of a device node. This isn't a problem so far