From patchwork Thu Jan 8 17:06:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 5594211 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B50CCC058D for ; Thu, 8 Jan 2015 17:08:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8974F2035D for ; Thu, 8 Jan 2015 17:08:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AEBC2203AB for ; Thu, 8 Jan 2015 17:08:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757033AbbAHRG0 (ORCPT ); Thu, 8 Jan 2015 12:06:26 -0500 Received: from foss-mx-na.foss.arm.com ([217.140.108.86]:58094 "EHLO foss-mx-na.foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932386AbbAHRGX (ORCPT ); Thu, 8 Jan 2015 12:06:23 -0500 Received: from foss-smtp-na-1.foss.arm.com (unknown [10.80.61.8]) by foss-mx-na.foss.arm.com (Postfix) with ESMTP id 76DC54E4; Thu, 8 Jan 2015 11:06:19 -0600 (CST) Received: from collaborate-mta1.arm.com (highbank-bc01-b06.austin.arm.com [10.112.81.134]) by foss-smtp-na-1.foss.arm.com (Postfix) with ESMTP id 6C3695FAD7; Thu, 8 Jan 2015 11:06:19 -0600 (CST) Received: from approximate.cambridge.arm.com (approximate.cambridge.arm.com [10.1.209.148]) by collaborate-mta1.arm.com (Postfix) with ESMTP id 3AEFD13F78C; Thu, 8 Jan 2015 11:06:18 -0600 (CST) From: Marc Zyngier To: Bjorn Helgaas , Thomas Gleixner , Jiang Liu Cc: , , , Yijing Wang , Suravee Suthikulpanit Subject: [PATCH v2 4/8] PCI/MSI: of: Allow msi_domain lookup using the PHB node Date: Thu, 8 Jan 2015 17:06:08 +0000 Message-Id: <1420736772-11088-5-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1420736772-11088-1-git-send-email-marc.zyngier@arm.com> References: <1420736772-11088-1-git-send-email-marc.zyngier@arm.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A number of platforms do not need to use the msi-parent property, as the host bridge itself provides the MSI controller. Allow this configuration by performing an irq domain lookup based on the PHB node if it doesn't have a valid msi-parent property. Signed-off-by: Marc Zyngier --- drivers/pci/of.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/pci/of.c b/drivers/pci/of.c index d8d1274..75bfb85 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -68,9 +68,14 @@ void pci_set_phb_of_msi_domain(struct pci_bus *bus) if (!bus->dev.of_node) return; + /* Start looking for a phandle to an MSI controller. */ np = of_parse_phandle(bus->dev.of_node, "msi-parent", 0); + /* + * If we don't have an msi-parent property, look for a domain + * directly attached to the host bridge. + */ if (!np) - return; + np = bus->dev.of_node; dev_set_msi_domain(&bus->dev, irq_find_host(np)); #endif }