From patchwork Wed Oct 21 18:47:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suravee Suthikulpanit X-Patchwork-Id: 7459451 Return-Path: X-Original-To: patchwork-linux-arm@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 92E97BEEA4 for ; Wed, 21 Oct 2015 18:50:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B2A0F2089C for ; Wed, 21 Oct 2015 18:50:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CA09820896 for ; Wed, 21 Oct 2015 18:50:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZoyR8-0003p2-VQ; Wed, 21 Oct 2015 18:48:34 +0000 Received: from mail-by2on0056.outbound.protection.outlook.com ([207.46.100.56] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZoyQl-0003is-U5 for linux-arm-kernel@lists.infradead.org; Wed, 21 Oct 2015 18:48:13 +0000 Received: from BY2PR12CA0035.namprd12.prod.outlook.com (10.160.121.45) by DM3PR12MB0860.namprd12.prod.outlook.com (10.164.7.142) with Microsoft SMTP Server (TLS) id 15.1.300.14; Wed, 21 Oct 2015 18:47:50 +0000 Received: from CO1NAM03FT003.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::201) by BY2PR12CA0035.outlook.office365.com (2a01:111:e400:2c84::45) with Microsoft SMTP Server (TLS) id 15.1.300.14 via Frontend Transport; Wed, 21 Oct 2015 18:47:49 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.222) smtp.mailfrom=amd.com; apm.com; dkim=none (message not signed) header.d=none; apm.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from atltwp02.amd.com (165.204.84.222) by CO1NAM03FT003.mail.protection.outlook.com (10.152.80.100) with Microsoft SMTP Server id 15.1.306.8 via Frontend Transport; Wed, 21 Oct 2015 18:47:47 +0000 X-WSS-ID: 0NWL2VK-08-3RX-02 X-M-MSG: Received: from satlvexedge02.amd.com (satlvexedge02.amd.com [10.177.96.29]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by atltwp02.amd.com (Axway MailGate 5.3.1) with ESMTPS id 29D47BD8902; Wed, 21 Oct 2015 14:47:43 -0400 (EDT) Received: from SATLEXDAG01.amd.com (10.181.40.3) by SATLVEXEDGE02.amd.com (10.177.96.29) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 21 Oct 2015 13:47:55 -0500 Received: from ssuthiku-fedora-lt.amd.com (10.180.168.240) by SATLEXDAG01.amd.com (10.181.40.3) with Microsoft SMTP Server id 14.3.266.1; Wed, 21 Oct 2015 14:47:45 -0400 From: Suravee Suthikulpanit To: , , , Subject: [PATCH V3 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices Date: Wed, 21 Oct 2015 11:47:25 -0700 Message-ID: <1445453249-32557-3-git-send-email-Suravee.Suthikulpanit@amd.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1445453249-32557-1-git-send-email-Suravee.Suthikulpanit@amd.com> References: <1445453249-32557-1-git-send-email-Suravee.Suthikulpanit@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.222; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(428002)(199003)(189002)(105586002)(77096005)(2950100001)(5001770100001)(2201001)(189998001)(97736004)(5003600100002)(86362001)(5007970100001)(19580405001)(50466002)(106466001)(5003940100001)(50226001)(48376002)(64706001)(19580395003)(101416001)(87936001)(229853001)(53416004)(92566002)(5008740100001)(46102003)(50986999)(36756003)(76176999)(47776003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR12MB0860; H:atltwp02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0860; 2:q0lriIJByOo37trxVhJvUK4wj/ode6QxGvjHeqp/cJ1DKadZxFRT/QM+7/rCQ/X1fpMA9Y9J1LQMkbWEsw7rI8CgZKEYrEUlxxsbMoW+sPALBVTX6O+gMRS3JEpjifKvs1rT7OMTSJCkFJbj0NflySGU9zMZ4tYTqNXXCubbhIo=; 3:biUqtveJkpw7WDUsiPSrK+xEWwuMpRIR2/VfyzTMHeL7zJC/T0XdD/R75QdDtr2o5MA/Yt9+OpG0q5m+Ncqa9uRP6+XnVUibQ/mxjN7sPlm0VrAJZqsXdrc1ok91IMdfbPDvLO434c5loO+Kj5PqHMa2p1VkwShaOa3IeT72REKsfrwekRI/6rUam1bn+xRYCSz/OPipHVIktkyomQp2Jrct8OkAaKEd6nx8bZEQtCD4IDfY8VY5QCipFWVGehUi; 25:6G1TQImYD9291qegDHxTO2b7xnHKfksE/WwoPGx9z1bWf6U75zrQcYqJBCRr1Z4gKOb4lYKP8gRJBfkKEEdR9bBBTxD/xtlu0NAlyUudwww8wyi9PvULQ8eDEIgSmoe5Zw0qcUtHwwGtPCU2Iktfhz1s0YPEtQmx+Sv3ogh7CHPOAQr7S7Pkqc00TJotEC9jDNy89LZjaRhpLEK6btc6xD7ECePxMF/KxGTko4KxDnqOZMK+HoxDaE1QF5YGxGZNyOeGM/n+e3R0nMRZo77zyQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM3PR12MB0860; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0860; 20:wVRC8pfeuO4fwAk5P7HDtGYdQMoNe8XF6DuZWrhq+xNQOfaZJYGV+oGt9jsMHOWSkFd6Rehlv+o+4yLrEXhTST7CB+e8CrvO8FAkhaHCmLokPUgwrEbPuO2rOPDLOvIht9TLXhJozLHUx7AXODI0cR4FmAZdxKo5cECZbIL/gFghYjob/9RX2VnAn85QmtlQ5L+E3NWoXo/72bt8DOl4JhG/89caKfmIxIKPdDzYdIJ12GhSOieNEFNi8n0Ulf9YsDuXFTjUaNb18FhqxXD5TrPrD5ADw0ZbQqeyHtrqxdbLZRwbTpnIsZwliBEvTdVdoqyzIpPHTg1TnGB5qLBDZbb4FTrrBJOzfNcEGJ4cn/VtEpkCa1skQHQqkCf689Vh17R4++6hQNOkpsDUilrUi9qH3EK4phpdh/xQ4acNpW+JVV/3ToouKRQt/G7yNa9nPDTML1CTFoan3exQsNCNjhZOW02SFK0YTS40QWXOqlq8OTEzK8Xjc+gYP6NgisuW; 4:lmzhvBEwk5h626C1KNOxVn9lRK8TmzCEG8qQB9wuLGuJr3BEfUq4N16eK1h45rf13JazjKBnvDATt0Hh0g1BobWIQU/aKi8d6rKXN5cCvJal1BBa0LraqTAg3l+J0pCvh0i+HZ4lP3CGfQBnczQtuSSbmeIiHr1S35oO3qjqofpZSQYY/sVwlp/O72pGQXTZvWZKa1FwbSmbn33SLhIadR+bqtcZZfR73F4pjpIIaJ3FssAEgJEWiqHL6c1UDtVdptaH1iUhPCIWzNq4EGMFxmeeA3wOJ9nZ2mE9V8Hq05FPKIhmvFAAoOYWkWUftObG5HXqkkt4BWEXmjcKtKNwHHJeJ/dEodyKWr/l4n+9wZwDqwb5gOoWTjdmyo2ltxm/ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(8121501046)(5005006)(3002001)(102115026); SRVR:DM3PR12MB0860; BCL:0; PCL:0; RULEID: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HiqhdR4YrrVKXtF0I1ZM06fZBNmKoqm1k5W92BQYehi1fojR7L5N8vFNHxsmvUGQ5hhDVOAHhuXcEs0ZELDhDRbbQIMf15tFs98hn/n47adESQVB1jRWCSGF7+uoMHSSVk+uc0J+z1L37NjA1Ew==; 24:JNxUjhgJ41eU5TjhhN05FLWUIKti2zMc7XG6pVgG3JcjIAwlN/z9GSDefx1M7bgqTM0NLUEBlEYPgX9F1HCKgEPQP+3SqPaVutySdbWc5dM=; 20:Weg5SQ2UMy3P4yQL+zBqVFsJA9ogL2NsxMcl7eTgQmV0cg32NLwz3Vz8PJDlhQSMrTqET45FH5M2NLtdLgQCCASQxh80q3wWBoCsmOZ12fxOVVgSfk4bBtJuSwdDncEsCHbO5ElTK+DF/jzNrZGdlhsH7F+p3OgeFUFwGxjK7xuIXnQz+4cd2tq3Wp8aoPjLfCCewcvGMWpZZxOJakyZdezYfIRCzq9swGJShAUhG+0LGalE1CA17bE8xd8mo8Pc SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2015 18:47:47.7457 (UTC) X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.222]; Helo=[atltwp02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB0860 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151021_114812_141525_263E1889 X-CRM114-Status: GOOD ( 13.12 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , graeme.gregory@linaro.org, Catalin Marinas , dhdang@apm.com, Will Deacon , linux-kernel@vger.kernel.org, tomasz.nowicki@linaro.org, linux-acpi@vger.kernel.org, hanjun.guo@linaro.org, Suravee Suthikulpanit , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 This patch introduces pci_host_bridge_acpi_msi_domain(), which returns the MSI domain of the specified PCI host bridge with DOMAIN_BUS_PCI_MSI bus token. Then, it is assigned to pci device. Signed-off-by: Suravee Suthikulpanit --- drivers/pci/pci-acpi.c | 13 +++++++++++++ drivers/pci/probe.c | 2 ++ include/linux/pci.h | 7 +++++++ 3 files changed, 22 insertions(+) diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index a32ba75..0e21ef4 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -9,7 +9,9 @@ #include #include +#include #include +#include #include #include #include @@ -689,6 +691,17 @@ static struct acpi_bus_type acpi_pci_bus = { .cleanup = pci_acpi_cleanup, }; +struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus) +{ + struct irq_domain *dom = NULL; + struct fwnode_handle *fwnode = pci_msi_get_fwnode(&bus->dev); + + if (fwnode) + dom = irq_find_matching_fwnode(fwnode, + DOMAIN_BUS_PCI_MSI); + return dom; +} + static int __init acpi_pci_init(void) { int ret; diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 0dbc7fb..bea1840 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -671,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.h b/include/linux/pci.h index e90eb22..4a7f6a9 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1925,6 +1925,13 @@ static inline struct irq_domain * pci_host_bridge_of_msi_domain(struct pci_bus *bus) { return NULL; } #endif /* CONFIG_OF */ +#ifdef CONFIG_ACPI +struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus); +#else +static inline struct irq_domain * +pci_host_bridge_acpi_msi_domain(struct pci_bus *bus) { return NULL; } +#endif + #ifdef CONFIG_EEH static inline struct eeh_dev *pci_dev_to_eeh_dev(struct pci_dev *pdev) {