From patchwork Tue Oct 13 20:46:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suravee Suthikulpanit X-Patchwork-Id: 7388601 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5ED469F1B9 for ; Tue, 13 Oct 2015 20:48:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 79530207C6 for ; Tue, 13 Oct 2015 20:48:51 +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 DAB8F207E4 for ; Tue, 13 Oct 2015 20:48:49 +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 1Zm6TK-0003II-9F; Tue, 13 Oct 2015 20:46:58 +0000 Received: from mail-bl2on0066.outbound.protection.outlook.com ([65.55.169.66] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zm6T4-0003DR-9Z for linux-arm-kernel@lists.infradead.org; Tue, 13 Oct 2015 20:46:43 +0000 Received: from SN1PR12MB0862.namprd12.prod.outlook.com (10.164.27.12) by SN1PR12MB0141.namprd12.prod.outlook.com (10.162.3.140) with Microsoft SMTP Server (TLS) id 15.1.300.14; Tue, 13 Oct 2015 20:46:20 +0000 Received: from BY2PR12CA0007.namprd12.prod.outlook.com (10.160.121.17) by SN1PR12MB0862.namprd12.prod.outlook.com (10.164.27.12) with Microsoft SMTP Server (TLS) id 15.1.293.16; Tue, 13 Oct 2015 20:46:19 +0000 Received: from BY2NAM03FT014.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::206) by BY2PR12CA0007.outlook.office365.com (2a01:111:e400:2c84::17) with Microsoft SMTP Server (TLS) id 15.1.293.16 via Frontend Transport; Tue, 13 Oct 2015 20:46:20 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.222) smtp.mailfrom=amd.com; arm.com; dkim=none (message not signed) header.d=none; arm.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 BY2NAM03FT014.mail.protection.outlook.com (10.152.84.239) with Microsoft SMTP Server id 15.1.300.4 via Frontend Transport; Tue, 13 Oct 2015 20:46:18 +0000 X-WSS-ID: 0NW6F13-08-C7N-02 X-M-MSG: Received: from satlvexedge01.amd.com (satlvexedge01.amd.com [10.177.96.28]) (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 20D1DD1602E; Tue, 13 Oct 2015 16:46:14 -0400 (EDT) Received: from SATLEXDAG03.amd.com (10.181.40.7) by satlvexedge01.amd.com (10.177.96.28) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 13 Oct 2015 15:46:18 -0500 Received: from ssuthiku-fedora-lt.amd.com (10.180.168.240) by satlexdag03.amd.com (10.181.40.7) with Microsoft SMTP Server id 14.3.266.1; Tue, 13 Oct 2015 16:46:17 -0400 From: Suravee Suthikulpanit To: , , , Subject: [PATCH 2/4] acpi: pci: Setup MSI domain for ACPI based pci devices Date: Tue, 13 Oct 2015 13:46:21 -0700 Message-ID: <1444769183-12374-3-git-send-email-Suravee.Suthikulpanit@amd.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1444769183-12374-1-git-send-email-Suravee.Suthikulpanit@amd.com> References: <1444769183-12374-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)(189002)(199003)(47776003)(77096005)(50466002)(2950100001)(189998001)(101416001)(53416004)(5007970100001)(76176999)(48376002)(50986999)(36756003)(5003600100002)(5003940100001)(50226001)(106466001)(2201001)(86362001)(105586002)(87936001)(46102003)(92566002)(5008740100001)(229853001)(5001770100001)(97736004)(64706001)(19580405001)(19580395003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0862; H:atltwp02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0862; 2:I4AVqM+oMRovY2+zwgCoyWfp4RPvWPSzE4zi0p/cheIMgo+IP+nLANT7uequE1koh/sdOT++ZQsUmGp1A9YX+h42UcgQoLRXgR4dGL4+mJcU0SjRMvk5OIx20Q1676OoSZP/6WHcuyt8bIBXajCXv54DMcVQO16pqo2AF1eSTcQ=; 3:XQ4Y7UGj3KAH5FuZ2M0Ji5fqZ7A4PGpg5vuFQvPHNiH3DFNBEoq3vn2zxwnFj/sFSIctAN7K3/3sllVUmmw9wWLf9CwWpyY/dp9R4hgRAlWrbeaY7EXqBvTtMuvw7qmEHyRxb85OkfnlC5xGehms5QJFWnA256R4WuYRMNB+/bOJb3K4f7XEPjpnP3DgFDAyushVBqYS0P7GsNytKCrrVshFVJFpX/lDRORcW9HQRj7YeWEL4LzGB002HIU9X5ux; 25:EmxwcBH610fnX/QMhZvvRcYw6klfaVif6B//ZV0zwCZkIvnlU0NSz80eS2/FrtcFx7QOffVa356Hg60tQxLqD0WZq58/9Jxm+/CDDtPzEYYhVci/I9uAraxJMTEWjP3yVQORH1y2Gy1r43+d+81OvVyTHkgFIm7qtn4Sn53HmdWrBaNxRQdLfOZBGzOjYuE/Lt2OXZez3nhQgfg/2wW+j0SXC1/qunF77qpr8jpaX+zzIK+6W8NMFbuD+i50orRtWDTwmj3h8PUaDR8D3nGnqg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR12MB0862; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0862; 20:9Dw30FQ4IVfWH3UkvFY8qdeQS11wbGnkakutuR0Mnz8o5sk45jsf00wwxidEdCi7f5RlC7fiqF0fQDacfi016VBA+aus9z2fvAar8F8+Ye/j3mRPF7Ut4n0ZxLn6fQt1emTOCHYAPGbMrvlGQFhvxt8EibN65Lvk4Lw9pFG+0l31FGc6Oym0t6RVGAJP9i30VoUKVT2/2RJ7kFEi5AZBvz5rmcPljhB8DNofJgblHZVcDf3yu4+T4gMTrcFYKVIyFxdbGXYWw8dN9mRp3lhsWqwyAOVEobDDfVRuCjuxWIGBRou2BrRIVzXT00096Ysa4voy7wtoyTvZZFFNB2pEO6v3U4gkjbDVrVOcqm6Dkb/T9Z1OV+HpabTFL6r9cQh9qHdVtiJBrAkATmLmIGLj+1awdWq73+87xtg4cBx4WPptfgdoKTqibSXlXWByN83AiXaR61oepTFTAvNVRj7/vIkLJu3YOpFdiC2P51esaJZouyKNbU6X+//Q19kXS0/2; 4:WGvu1QoggnLdXmDGLgR92WxNsjsg13VcfG0kLsPQ0n//2lHv21yn59WQa48FNgHjxVoE7qkEuObwFa52V6Cbmm1ONaXbJ8ssdWvpCCA9+QY+1i3MH1VboOuStwtNqwzlZB+PEEvTdhouusiaS8zc/GQQsxzy2ZGqEZXPIYcP2TPoDog2U0pwtFpW8B7qa0rVxRIemPQfb2GBy2KNC0NeLA3iMyD6ENSX3XXEcY9yUaoeTVj++H9BKeMHuGycmmz3CLKkMWwjP3WuTT+eeWzY9GrNll/U4jq1jBmOji0lcoToYy6wFdCcrXZQQV5M3e0m6a2wNO15CFiIidvkgTc4SUbiL5ozRayz49U9QxVjpVc= 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); SRVR:SN1PR12MB0862; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0862; X-Forefront-PRVS: 07283408BE X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0862; 23:ZyafaSlEESIPPUsaTPZ/xpAZuPGnj6ZSD4wh8UFt2qfXvoktzKXgWX5VFz7dOsa52g+KmJKC/pd7ufEdVUWVefEOe6Z+PKwAs256pILynuAGa8iNVOfLqMPtUiWQPdz3KblU7Jc48/u7QZ/PJuQmqh/lvhqnDI37lHWvqV5tkaBGOMRBuOartgARZXKx4nUCCmz1FaTpFYF0HWmtmDv+JMvG2WyMTFjST5dB/1iYoL4/KzuVZuYmLC10CZ0yrI481X23aPDYVvdLXzjCNuJFfkPbUwpedkOIaHk8tzVMEzBS3FOEietovDo1fGb6v+fL61zbkV8q+2Z+8kgd0wolZmavkpnL1clxoyM1XPxsiFiJLaz9590BslpT2Mdq2PWr2wYx92e8J2rqnM2TKKJiH7EjMGgUBKhxlEj07ETRvGNMofdHDe62t6e2fTkq7Dsj8tO14BjdJP6XLf1XBd4dW1ejT+3cNMuOOytCs1seQ4EvXD81HeKI9uEROLH9bDdmda5nzmroVb9lN1wK6uAW1G88onmt7rBQ06qv4gaUNVCSJthFq5OTYYFNZ467ulfijH3bO+wDgYVDMHEP6d7SoUf+Q6NCigod9eu1I36r6YWxyvULQpQCrtsWeVbXo9705/bkcmIxo7zIB2dI3q6YYibY9jyXzvRYKC3aF52gR2lFD8cdq0lk1XB4em1uz/3yrrg7XCIzeV+QpHl0dq55aIiT90haqt2Br9lJC8AucaOioocjtWubVMa0Y4CENNmq5Zk8IXVoD6EOmbJgoy/3Tx3tU9R/zIv0+oq/DA3VpM3sEQrEkAWNh78u+Z8UvMrO2Hd5XwsOjrtSkrZfFUGL96BH80QSTrUnmq/Y2e66wHM971Fewj2N7QZW71EKglfK/DdU5h/pTN3vcfQw3A3txAtLlo9mTWjEIbheIiKmlUsYHRGgnQyxEDr1VuIb2pCY X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0862; 5:rsUKJVokDTFFT/DTG5B2BJ7gu0daBSPEnWGj5cwtaLQMnDg1yl9aznFVcJ1bNrKPu9wOqA2mJe9UDITv+Vthvja5N5QSohrG76+XQa31/ORyjVjdEq3SX03uKxE85uHaRfaL+wFA9VYsULwhnpijqw==; 24:NkTZ4vWU27H0NChmKretAIVrqM+JE1hgAv3vLZOBcGhGoF3sGrM1vEOkKnzPR5bT4tAR7I9xZ4zEY+iY8Cibs7qmRcpTrILr6iOL6maBi1U=; 20:iy2QphGYPejMSgb83PYk1tSNuRG0zkdSLMpS/FDWDvQ9Q3Zvaz4tRHUFhEGHv1pBs/SQArPpviNFYeV0l6/vn1w/ixcYioXokq9YTKKk5QcVnCGQpL+TPqVWFfNXRmCpC5E56GdDSiTUsT1q3ABbd7v3jBGBBMMJw95NCQoLYsGpsy6kcrsHSWsZLSCBByPF8kjHw/OtLkSBn/a1NlPKAOe+WSSri6yNHg36zLa9tkR2lNc5K/Ea3pNWnHjQ29NT SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2015 20:46:18.7592 (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: SN1PR12MB0862 X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0141; 2:JX5nPwqJZxIcTO+b9oep3ajE6DpvV2BTT4V9MORnJnDD+zcnI9QDCkfWv9Hqd+XGgXGVRRXw/fFXS/DyUAfV6sWCb3CrG6/LAQNWoczdYE333jilSVhHR1AwsTktBbjgGmanfGreVhUKFNA9P1RHChJxhNRKcLafPj8wSXNJXKU=; 23:segBhyvJkJ4NnQWiX5m/Yw9rrAcrhWIdFji6IXMpt0kkKPGGtX9HSWT6/wCfL1YlUNAP5XIFP+5ktXClIs+vLmJUZfFqWF9TYgqf4hkNGaWWV9fOsnNEierK5vBY39hMRWF0XgANZgZpqwyRXgF5RgkGUStOuTDCjaa/D2blfFN2zaKq8fc/5zLPdGJSxTgo X-OriginatorOrg: amd.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151013_134642_617811_04209473 X-CRM114-Status: GOOD ( 13.38 ) 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 , 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, 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 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) {