From patchwork Fri Oct 30 21:11:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jake Oshins X-Patchwork-Id: 538518 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id CC3A61402B2 for ; Sat, 31 Oct 2015 08:14:38 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sendgrid.me header.i=@sendgrid.me header.b=Etais+gu; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030836AbbJ3VNP (ORCPT ); Fri, 30 Oct 2015 17:13:15 -0400 Received: from o1.f.az.sendgrid.net ([208.117.55.132]:16767 "EHLO o1.f.az.sendgrid.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932953AbbJ3VME (ORCPT ); Fri, 30 Oct 2015 17:12:04 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:cc:subject:in-reply-to:references; s=smtpapi; bh=GcbHFchP5BJR2gezxzgC9uWr5yw=; b=Etais+guTi74GlVad/bWMpMvs24oZ RvjJ7x4yTYXLTCjyUcz17DWZAgvtiXJdcNBf9C5qK6tDdvRDJ3QltBc6omDb4Tud 5SprlCHK51p4iF9VPt8W/5NKhtwdboX/9s0OMc3yx+EhF+/k8F7edfDEJGJD7JdK tm1zNiKdwJkMys= Received: by filter-426.sjc1.sendgrid.net with SMTP id filter-426.14642.5633DD2234 2015-10-30 21:12:02.397701529 +0000 UTC Received: from jakeoshinsu2.jakeoshinsu2.d1.internal.cloudapp.net (unknown [104.210.40.47]) by ismtpd0001p1las1.sendgrid.net (SG) with ESMTP id 6EGifWjhRI-zQsE3cgRSeQ Fri, 30 Oct 2015 21:12:02.508 +0000 (UTC) From: jakeo@microsoft.com To: gregkh@linuxfoundation.org, kys@microsoft.com, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, tglx@redhat.com, haiyangz@microsoft.com, marc.zyngier@arm.com, bhelgaas@google.com, linux-pci@vger.kernel.org Cc: Jake Oshins Subject: [PATCH v5 5/7] PCI: irqdomain: Look up IRQ domain by fwnode_handle Date: Fri, 30 Oct 2015 21:11:13 +0000 Message-Id: <1446239475-49480-6-git-send-email-jakeo@microsoft.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1446239475-49480-1-git-send-email-jakeo@microsoft.com> References: <1446239475-49480-1-git-send-email-jakeo@microsoft.com> X-SG-EID: lfnueJVzSjg1mfuVqqukVH7tZvRy9mfCIcBnfbfzaMNOU8VSIPzRX1vyuAtHUPiVj6gw25AeLqvloP cIrtLxuepPhsMORr5Fnu9xpha5alB9E6Tq+BtJiv8vUT+ylpgIjCZVF602QHWM3Ynb699LeeQrGQs5 UIIG2XQY+6mr71A= Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Jake Oshins This patch adds a second way of finding an IRQ domain associated with a root PCI bus. After looking to see if one can be found through the OF tree, it attempts to look up the IRQ domain through an fwnode_handle stored in the pci_sysdata struct. Signed-off-by: Jake Oshins --- arch/x86/include/asm/pci.h | 4 +++- drivers/pci/probe.c | 11 +++++++++++ include/asm-generic/pci.h | 4 ++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index 10213a1..fb74453 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h @@ -45,11 +45,13 @@ static inline int pci_proc_domain(struct pci_bus *bus) #endif #ifdef CONFIG_PCI_MSI_IRQ_DOMAIN -static inline void *pci_fwnode(struct pci_bus *bus) +static inline void *_pci_root_bus_fwnode(struct pci_bus *bus) { struct pci_sysdata *sd = bus->sysdata; return sd->fwnode; } + +#define pci_root_bus_fwnode _pci_root_bus_fwnode #endif /* Can be used to override the logic in pci_scan_bus for skipping diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index f441d1b..60e50a8 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -671,6 +671,17 @@ static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus) */ d = pci_host_bridge_of_msi_domain(bus); +#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN + /* + * If no IRQ domain was found via the OF tree, try looking it up + * directly through the fwnode_handle. + */ + if (!d && pci_root_bus_fwnode(bus)) { + d = irq_find_matching_fwnode(pci_root_bus_fwnode(bus), + DOMAIN_BUS_PCI_MSI); + } +#endif + return d; } diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h index f24bc51..3fde985 100644 --- a/include/asm-generic/pci.h +++ b/include/asm-generic/pci.h @@ -21,4 +21,8 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) #define PCI_DMA_BUS_IS_PHYS (1) #endif +#ifndef pci_root_bus_fwnode +#define pci_root_bus_fwnode(bus) ((void)(bus),NULL) +#endif + #endif /* _ASM_GENERIC_PCI_H */