From patchwork Wed Oct 14 23:25:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suravee Suthikulpanit X-Patchwork-Id: 7399061 Return-Path: X-Original-To: patchwork-linux-acpi@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 A83BE9F1B9 for ; Wed, 14 Oct 2015 23:26:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BF9E2207FA for ; Wed, 14 Oct 2015 23:26:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BDB3F207DA for ; Wed, 14 Oct 2015 23:26:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754274AbbJNXZ5 (ORCPT ); Wed, 14 Oct 2015 19:25:57 -0400 Received: from mail-bl2on0098.outbound.protection.outlook.com ([65.55.169.98]:35648 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753717AbbJNXZy (ORCPT ); Wed, 14 Oct 2015 19:25:54 -0400 Received: from CY1PR1201CA0006.namprd12.prod.outlook.com (10.169.17.144) by CY1PR12MB0715.namprd12.prod.outlook.com (10.163.238.21) with Microsoft SMTP Server (TLS) id 15.1.300.14; Wed, 14 Oct 2015 23:25:50 +0000 Received: from BY2NAM03FT029.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::208) by CY1PR1201CA0006.outlook.office365.com (2a01:111:e400:5b9a::16) with Microsoft SMTP Server (TLS) id 15.1.293.16 via Frontend Transport; Wed, 14 Oct 2015 23:25:51 +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 BY2NAM03FT029.mail.protection.outlook.com (10.152.84.213) with Microsoft SMTP Server id 15.1.300.4 via Frontend Transport; Wed, 14 Oct 2015 23:25:49 +0000 X-WSS-ID: 0NW8H2V-08-IVF-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 2485FBD88D5; Wed, 14 Oct 2015 19:25:43 -0400 (EDT) Received: from SATLEXDAG02.amd.com (10.181.40.5) by satlvexedge01.amd.com (10.177.96.28) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 14 Oct 2015 18:25:49 -0500 Received: from ssuthiku-fedora-lt.amd.com (10.180.168.240) by SATLEXDAG02.amd.com (10.181.40.5) with Microsoft SMTP Server id 14.3.266.1; Wed, 14 Oct 2015 19:25:45 -0400 From: Suravee Suthikulpanit To: , , , CC: Lorenzo Pieralisi , Will Deacon , Catalin Marinas , , , , , , , , Suravee Suthikulpanit Subject: [PATCH V2 2/6] acpi: pci: Setup MSI domain for ACPI based pci devices Date: Wed, 14 Oct 2015 16:25:52 -0700 Message-ID: <1444865156-9870-3-git-send-email-Suravee.Suthikulpanit@amd.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1444865156-9870-1-git-send-email-Suravee.Suthikulpanit@amd.com> References: <1444865156-9870-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)(5003940100001)(5003600100002)(64706001)(2201001)(5007970100001)(86362001)(87936001)(50466002)(47776003)(92566002)(36756003)(189998001)(5008740100001)(48376002)(5001770100001)(53416004)(105586002)(5001920100001)(77096005)(46102003)(50226001)(2950100001)(19580395003)(19580405001)(229853001)(106466001)(76176999)(101416001)(50986999)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0715; H:atltwp02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0715; 2:RKTiw+DILv1lL/PuOCVB4vD9Pa08OM/sZgkOWUtV3nEnquXEoBv6iz5c0ConYd3lq/TjsOLYzf40Zyk6u7ZNDN61zcjwsi8LUiEftR8W/lNEmc4uAMLlo/tG4DTSrH7+VzTz1GO+D4M+oZd8eqZUEY4Hj2rNSTFJ3o9O08uw5jA=; 3:piDkIiOVzv0GXa+f0PMP3M7FBuKcRguo7DGnJYShLkfQVe/tddjSRHpDOc1UCbA7o+758jiBLY5yf19UMuUhOFaTbfmLBmm4ebwLliQfaY9GTqN1f9Tuiskt92L9gXKnHpTPcl1G532eu7pixlque2WbdVvRP7Hk3aPFEGtSmGI3USB2tjTJGuecmX9rJl8eoOV6lPX3iw6d1vNYklJ8i7Usy6MtOO0h0mtgD7DsXnA+u36WL7aOil6SxISkJJi3; 25:RMTflPRGY9zKV0cUZ0CZM5gix8LfITXC0gCXU/BazMKvzrQb29oHQcU0od4CpAXg9RoY81nQ1KgN7ZBDri1Z51IkQ31EZmGCi9v6lTV+wdLoLy21ydbnNro69pshB3eb52voWxygN0/3lHYkH9cyvaEcUsZPNl/RUiUGmzugZBEJbY/QAGH3S5Aul/vx3cxzrXkcDs9+1fT/FttdaqKfG51Rr5meAF+Y+nReXqiCrQ4Jt5YLisMPrPYy9DkgjOqEMl/T+swd05QEFrhixYsU0w== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR12MB0715; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0715; 20:sRuPb3fXvZCde5tdZ2raifcvjSbtoAbNyyL6j5vZMc5iePS01FP8gYTh6iaADpKvF+8G0fEErMVUasHAi9V8r1ti5zHvDipAtNmLhQPg/Zk8jeLW1E13bnD5MKQT5XEHtzzw1lnw7s6Kv83hwWHIGs29lQQ6ykVYTQnJip7498gJTFMGeqRETrv8D0lFfUuhyppoKP0T1vjAC5uEPUA3HsrI6p2mHtQE0LBId1TwqRxjZzm87XwzUDrfHmkYpQvWNtNO63I9Bxmm1x/66dN6PwXYjJjZDQGK2VNsIecId8EuZr18l8lsADxKmHkO6JgFpfv+aITIMjVNCORhgioRiLAiFK+WmR/90RWDsM28BRLi2bFyAXJyGeJXYdi9GpadNeUORBplmuBi/Y6KJrQ/xRUbC6i6u+pPJhHEvA4D+Ia7hEpvM4wpZ/tdqsqiitEBT8eDqSfk2nF38rvMEFxombgxDFpQKor+NdmcWIqIvSW4wB3rCrtjHAF+LoNYAW9R; 4:zaInwRADpLEiLh6rlTGxmSZe73P3+7EZb9lpa3Dvcr/qB5xcYSw66c4V9Q5oic/9MVdVKTYteFeiisnSdIfGDT0lho6wjmaMz67dHBKlk9OWvxPmJLZsXHY4uVUeAtroFj46qDBkHJeHh02tK7VJumBSPVYD7jLy21ltDF+3WOPsZPX0XLqEV/5ygyq+CNf8mZy/jzsuLmWutWYaLdmgd131PK2cS0mUmhpf5zCa3xk3MXjm8ggq5xTKuADQWmLyHtoeuzicR9w0OjVEif9en+gxM3HfzC3BhT+6SumhtMzAj9s0zEaHwzcFLbsxzlEA6+fwPl3riH9KCGDl3M6LXkG95RWSDQW6xsVwmmMpFgo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(520078)(3002001); SRVR:CY1PR12MB0715; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0715; X-Forefront-PRVS: 0729050452 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR12MB0715; 23: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q?83E0pLaPUrNrfhRtEjkVSjBHDaqFOC8NIy8U2P05CyeR4RFFCspcFMNX6WKy?= =?us-ascii?Q?3eWBdxPZi8YbSQ0TjEN7g0Yl6y0Jy0fZl3mm3hLLZEoo8XGtFC5I1RMEQbv5?= =?us-ascii?Q?vI=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0715; 5:TXYXhKLvTyul/eV2sxlfhYbJRFkrbwuJY90k2A5XiVVwHgz9T7sL4OtCfhlmQbD3s+nZmoeh7sMErBgUOLql2e8s3mZAtYQf8BQ209iL+pnuwpW7NEhQqBwqwAY3BYg9F2xa4Lm6kP7CFEFeCmemRA==; 24:H/8V3ETkpRfKeVvwyR5+Ftezerytc4WA+0zwANk+okBOYUBN8J4JCvM+iHld7DrxNjcRyuDG4lamu3Iuym+2rvldlK2xIU3RCK71jp/QRcM=; 20:zf3YdlhrJbn93kr3DVrdRwvcncMGDssaWOI295A6y54hBpgGUhXVD37Hxn/iG8NszxfwGFBzxbdbOnDdLybmKoomZw/ZMdFPQJJN3/w13HdTwNYkFLJkTSxFencmvjITCz6gUpjku9n6VjeDb/nqT3QwT/mp++v6pr8MbcwAFnQHZQCja3SZaaEOg8tWiUEyorpXf1/SBQSALE1iqXuh3B+pEkDbQE4PHWB1pdbRx4iU6YRvS1XLBEMHUuoUmF4c SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2015 23:25:49.3219 (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: CY1PR12MB0715 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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) {