From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7887C433E3 for ; Thu, 21 May 2020 19:56:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BAED720826 for ; Thu, 21 May 2020 19:56:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IJ5T05hy"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZEHVBYHL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAED720826 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=Ymua+b8airZI/KlNvxh08ZQ52U2gRxDQD8l1oq3eXDY=; b=IJ5T05hyCVKWLM VbTxWPhA6UHn+cyY5uxnGNiIjbRt9NYDpxYGrfySNBZlboO1mpvF+rU9lZH58je9BM5hjeku7ybTf IksUuYzmo7VnJD8RDZurNQo91vvXi6NFnSlyHys0AB7Vwl1IV7pWPjFcBwYw3iimWLNNfjanjBBxt VMhE5/zsI6YfsK7ZcSTvuahs6nF4iHjOif5BiSLZcuCwdlvtmLDBbXT0iupZvI63dcXoA4ovmYEjc im+IuC+/XpmAH6OCEvlM1ZpqVAPC1zG/ThWlufBpuR7R8JCRt1Xa2wVX4UsfyvfL7xKxkkcUhrrtR evbn7hRY0+zL2f9Ur05A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbrJB-00044p-CP; Thu, 21 May 2020 19:56:49 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbrJ9-00043j-AG for linux-arm-kernel@lists.infradead.org; Thu, 21 May 2020 19:56:48 +0000 Received: from localhost (mobile-166-175-190-200.mycingular.net [166.175.190.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 226AE20829; Thu, 21 May 2020 19:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590091006; bh=3pPxhsoMN8AFg9ooaYG2vkfeO0yylrZ+Y4cUkEkWdkk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=ZEHVBYHLP72nxe38Sw3h1kSXw8ATmk0v5q21R9wchW+xahwMzGbEsDbJgb9EZnlnh v7ZanNXBfhlz6GdwVLqNlJXzxGPRQvEBqIMn57kkP7P7rFZALfVOjFui0msOei15uL FR4uSaRrm7XQSfofT1IQKrYTYOGx9AwA5sXJqQIE= Date: Thu, 21 May 2020 14:56:44 -0500 From: Bjorn Helgaas To: Lorenzo Pieralisi Subject: Re: [PATCH 02/12] ACPI/IORT: Make iort_get_device_domain IRQ domain agnostic Message-ID: <20200521195644.GA1171134@bjorn-Precision-5520> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200521130008.8266-3-lorenzo.pieralisi@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200521_125647_396251_89E30073 X-CRM114-Status: GOOD ( 21.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , devicetree@vger.kernel.org, linux-pci@vger.kernel.org, Catalin Marinas , Joerg Roedel , Hanjun Guo , "Rafael J. Wysocki" , Robin Murphy , linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org, Rob Herring , Makarand Pawagi , Sudeep Holla , Bjorn Helgaas , Diana Craciun , Will Deacon , linux-arm-kernel@lists.infradead.org, Laurentiu Tudor Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, May 21, 2020 at 01:59:58PM +0100, Lorenzo Pieralisi wrote: > iort_get_device_domain() is PCI specific but it need not be, > since it can be used to retrieve IRQ domain nexus of any kind > by adding an irq_domain_bus_token input to it. > > Make it PCI agnostic by also renaming the requestor ID input > to a more generic ID name. > > Signed-off-by: Lorenzo Pieralisi > Cc: Will Deacon > Cc: Hanjun Guo > Cc: Bjorn Helgaas > Cc: Sudeep Holla > Cc: Catalin Marinas > Cc: Robin Murphy > Cc: "Rafael J. Wysocki" > Cc: Marc Zyngier Acked-by: Bjorn Helgaas # pci/msi.c > --- > drivers/acpi/arm64/iort.c | 14 +++++++------- > drivers/pci/msi.c | 3 ++- > include/linux/acpi_iort.h | 7 ++++--- > 3 files changed, 13 insertions(+), 11 deletions(-) > > diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c > index 7cfd77b5e6e8..8f2a961c1364 100644 > --- a/drivers/acpi/arm64/iort.c > +++ b/drivers/acpi/arm64/iort.c > @@ -567,7 +567,6 @@ static struct acpi_iort_node *iort_find_dev_node(struct device *dev) > node = iort_get_iort_node(dev->fwnode); > if (node) > return node; > - > /* > * if not, then it should be a platform device defined in > * DSDT/SSDT (with Named Component node in IORT) > @@ -658,13 +657,13 @@ static int __maybe_unused iort_find_its_base(u32 its_id, phys_addr_t *base) > /** > * iort_dev_find_its_id() - Find the ITS identifier for a device > * @dev: The device. > - * @req_id: Device's requester ID > + * @id: Device's ID > * @idx: Index of the ITS identifier list. > * @its_id: ITS identifier. > * > * Returns: 0 on success, appropriate error value otherwise > */ > -static int iort_dev_find_its_id(struct device *dev, u32 req_id, > +static int iort_dev_find_its_id(struct device *dev, u32 id, > unsigned int idx, int *its_id) > { > struct acpi_iort_its_group *its; > @@ -674,7 +673,7 @@ static int iort_dev_find_its_id(struct device *dev, u32 req_id, > if (!node) > return -ENXIO; > > - node = iort_node_map_id(node, req_id, NULL, IORT_MSI_TYPE); > + node = iort_node_map_id(node, id, NULL, IORT_MSI_TYPE); > if (!node) > return -ENXIO; > > @@ -697,19 +696,20 @@ static int iort_dev_find_its_id(struct device *dev, u32 req_id, > * > * Returns: the MSI domain for this device, NULL otherwise > */ > -struct irq_domain *iort_get_device_domain(struct device *dev, u32 req_id) > +struct irq_domain *iort_get_device_domain(struct device *dev, u32 id, > + enum irq_domain_bus_token bus_token) > { > struct fwnode_handle *handle; > int its_id; > > - if (iort_dev_find_its_id(dev, req_id, 0, &its_id)) > + if (iort_dev_find_its_id(dev, id, 0, &its_id)) > return NULL; > > handle = iort_find_domain_token(its_id); > if (!handle) > return NULL; > > - return irq_find_matching_fwnode(handle, DOMAIN_BUS_PCI_MSI); > + return irq_find_matching_fwnode(handle, bus_token); > } > > static void iort_set_device_domain(struct device *dev, > diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c > index 6b43a5455c7a..74a91f52ecc0 100644 > --- a/drivers/pci/msi.c > +++ b/drivers/pci/msi.c > @@ -1558,7 +1558,8 @@ struct irq_domain *pci_msi_get_device_domain(struct pci_dev *pdev) > pci_for_each_dma_alias(pdev, get_msi_id_cb, &rid); > dom = of_msi_map_get_device_domain(&pdev->dev, rid); > if (!dom) > - dom = iort_get_device_domain(&pdev->dev, rid); > + dom = iort_get_device_domain(&pdev->dev, rid, > + DOMAIN_BUS_PCI_MSI); > return dom; > } > #endif /* CONFIG_PCI_MSI_IRQ_DOMAIN */ > diff --git a/include/linux/acpi_iort.h b/include/linux/acpi_iort.h > index 8e7e2ec37f1b..08ec6bd2297f 100644 > --- a/include/linux/acpi_iort.h > +++ b/include/linux/acpi_iort.h > @@ -29,7 +29,8 @@ struct fwnode_handle *iort_find_domain_token(int trans_id); > #ifdef CONFIG_ACPI_IORT > void acpi_iort_init(void); > u32 iort_msi_map_rid(struct device *dev, u32 req_id); > -struct irq_domain *iort_get_device_domain(struct device *dev, u32 req_id); > +struct irq_domain *iort_get_device_domain(struct device *dev, u32 id, > + enum irq_domain_bus_token bus_token); > void acpi_configure_pmsi_domain(struct device *dev); > int iort_pmsi_get_dev_id(struct device *dev, u32 *dev_id); > /* IOMMU interface */ > @@ -40,8 +41,8 @@ int iort_iommu_msi_get_resv_regions(struct device *dev, struct list_head *head); > static inline void acpi_iort_init(void) { } > static inline u32 iort_msi_map_rid(struct device *dev, u32 req_id) > { return req_id; } > -static inline struct irq_domain *iort_get_device_domain(struct device *dev, > - u32 req_id) > +static inline struct irq_domain *iort_get_device_domain( > + struct device *dev, u32 id, enum irq_domain_bus_token bus_token) > { return NULL; } > static inline void acpi_configure_pmsi_domain(struct device *dev) { } > /* IOMMU interface */ > -- > 2.26.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel