Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751470AbbHGImr (ORCPT ); Fri, 7 Aug 2015 04:42:47 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:34268 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750829AbbHGImo (ORCPT ); Fri, 7 Aug 2015 04:42:44 -0400 Message-ID: <55C46F74.4020307@linaro.org> Date: Fri, 07 Aug 2015 16:42:28 +0800 From: Hanjun Guo User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Marc Zyngier , Jason Cooper , Will Deacon , Catalin Marinas , "Rafael J. Wysocki" CC: Thomas Gleixner , Jiang Liu , Bjorn Helgaas , Lorenzo Pieralisi , "suravee.suthikulpanit@amd.com" , Timur Tabi , Tomasz Nowicki , "grant.likely@linaro.org" , Mark Brown , Wei Huang , "linux-arm-kernel@lists.infradead.org" , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linaro-acpi@lists.linaro.org" Subject: Re: [PATCH v4 09/10] PCI: ACPI: Bind GIC MSI frame to PCI host bridge References: <1438164539-29256-1-git-send-email-hanjun.guo@linaro.org> <1438164539-29256-10-git-send-email-hanjun.guo@linaro.org> <55C0C685.4000400@arm.com> In-Reply-To: <55C0C685.4000400@arm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3964 Lines: 119 On 08/04/2015 10:04 PM, Marc Zyngier wrote: > On 29/07/15 11:08, Hanjun Guo wrote: >> From: Suravee Suthikulpanit >> >> This patch introduces pci_host_bridge_acpi_msi_domain(), which queries >> a GIC MSI irq-domain token and use it to retrieve an irq_domain with >> DOMAIN_BUS_PCI_MSI bus type, and bind it to PCI host-bridge. >> >> Signed-off-by: Suravee Suthikulpanit >> Signed-off-by: Hanjun Guo >> --- >> drivers/pci/pci-acpi.c | 18 ++++++++++++++++++ >> drivers/pci/probe.c | 3 +++ >> include/linux/pci-acpi.h | 4 ++++ >> 3 files changed, 25 insertions(+) >> >> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c >> index 314a625..5f11653 100644 >> --- a/drivers/pci/pci-acpi.c >> +++ b/drivers/pci/pci-acpi.c >> @@ -9,6 +9,7 @@ >> >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -16,6 +17,7 @@ >> #include >> #include >> #include >> +#include >> #include "pci.h" >> >> /* >> @@ -681,6 +683,22 @@ static bool pci_acpi_bus_match(struct device *dev) >> return dev_is_pci(dev); >> } >> >> +#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN >> +struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus) >> +{ >> + struct irq_domain *d = NULL; >> + void *token = acpi_gic_get_msi_token(&bus->dev); > > Do you see why I positively *hate* having hardware details in generic > layers? They propagate everywhere... > >> + >> + if (token) >> + d = irq_find_matching_host(token, DOMAIN_BUS_PCI_MSI); >> + >> + if (!d) >> + pr_debug("Fail to find domain for MSI\n"); >> + >> + return d; >> +} >> +#endif /*CONFIG_GENERIC_MSI_IRQ_DOMAIN*/ >> + >> static struct acpi_bus_type acpi_pci_bus = { >> .name = "PCI", >> .match = pci_acpi_bus_match, >> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c >> index a7afeac..8c1204c 100644 >> --- a/drivers/pci/probe.c >> +++ b/drivers/pci/probe.c >> @@ -12,6 +12,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include "pci.h" >> >> @@ -670,6 +671,8 @@ static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus) >> * should be called from here. >> */ >> d = pci_host_bridge_of_msi_domain(bus); >> + if (!d) >> + d = pci_host_bridge_acpi_msi_domain(bus); >> >> return d; >> } >> diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h >> index a965efa..766d045 100644 >> --- a/include/linux/pci-acpi.h >> +++ b/include/linux/pci-acpi.h >> @@ -77,6 +77,8 @@ static inline void acpiphp_remove_slots(struct pci_bus *bus) { } >> static inline void acpiphp_check_host_bridge(struct acpi_device *adev) { } >> #endif >> >> +struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus); >> + >> extern const u8 pci_acpi_dsm_uuid[]; >> #define DEVICE_LABEL_DSM 0x07 >> #define RESET_DELAY_DSM 0x08 >> @@ -85,6 +87,8 @@ extern const u8 pci_acpi_dsm_uuid[]; >> #else /* CONFIG_ACPI */ >> static inline void acpi_pci_add_bus(struct pci_bus *bus) { } >> static inline void acpi_pci_remove_bus(struct pci_bus *bus) { } >> +static inline struct irq_domain * >> +pci_host_bridge_acpi_msi_domain(struct pci_bus *bus) { return NULL; } >> #endif /* CONFIG_ACPI */ >> >> #ifdef CONFIG_ACPI_APEI >> > > Once you solve the HW abstraction issue, this will be OK. Sure, I will sync with Suravee to fix that. Thanks for you comments! Hanjun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/