From patchwork Tue Aug 25 17:33:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suravee Suthikulpanit X-Patchwork-Id: 7072391 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 F25699F358 for ; Tue, 25 Aug 2015 17:37:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 191A720885 for ; Tue, 25 Aug 2015 17:37:08 +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 D55AE20880 for ; Tue, 25 Aug 2015 17:37:05 +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 1ZUI7K-0002M3-Vt; Tue, 25 Aug 2015 17:34:38 +0000 Received: from mail-bn1on0137.outbound.protection.outlook.com ([157.56.110.137] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZUI7C-00029W-CQ for linux-arm-kernel@lists.infradead.org; Tue, 25 Aug 2015 17:34:31 +0000 Received: from BY1PR0201CA0034.namprd02.prod.outlook.com (10.160.191.172) by BY1PR02MB1148.namprd02.prod.outlook.com (10.162.108.15) with Microsoft SMTP Server (TLS) id 15.1.256.15; Tue, 25 Aug 2015 17:34:07 +0000 Received: from BN1AFFO11FD027.protection.gbl (2a01:111:f400:7c10::154) by BY1PR0201CA0034.outlook.office365.com (2a01:111:e400:4814::44) with Microsoft SMTP Server (TLS) id 15.1.243.23 via Frontend Transport; Tue, 25 Aug 2015 17:34:07 +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; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from atltwp02.amd.com (165.204.84.222) by BN1AFFO11FD027.mail.protection.outlook.com (10.58.52.87) with Microsoft SMTP Server id 15.1.249.14 via Frontend Transport; Tue, 25 Aug 2015 17:34:06 +0000 X-WSS-ID: 0NTNFGP-08-24L-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 214C4D16007; Tue, 25 Aug 2015 13:34:00 -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; Tue, 25 Aug 2015 12:34:14 -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.195.1; Tue, 25 Aug 2015 13:34:03 -0400 From: Suravee Suthikulpanit To: , , , , Subject: [PATCH V2 4/4] PCI: ACPI: Add support for PCI device DMA coherency Date: Wed, 26 Aug 2015 00:33:29 +0700 Message-ID: <1440524009-5359-5-git-send-email-Suravee.Suthikulpanit@amd.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1440524009-5359-1-git-send-email-Suravee.Suthikulpanit@amd.com> References: <1440524009-5359-1-git-send-email-Suravee.Suthikulpanit@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD027; 1:RWaMbCF9WMQiPlEWi6jWwHJc7Coir3Dijv5gDlXK2fFcqQMYtTAtXezau9Wv0uTP+rrk9oQfXnmtayuqjg0WdZ0CFCwg1xipiAEvQGMFAyPf3I0UznS/oogAdghBF9tE7O2UYj9nLkZ/c4Gb2rMdrl2dNsUvGu0IzwCvEiYeKICYY+YNqOdJl6CT4t9cx47GcoKVVd1HswuuwhAUToIUCFjwRwLJiVxrXbGXZtSt1r/ZEodgsEVCKgpXpHE5ieeIULAdW801PrUg0T45DKC1lHo8et++QBVmJ1Tgj52+FgiAY394xl/CHwNH3Lq0+JVwzv7S8C7u+WMDNbHqJdEtHFIKwfdEKPbQ1R78YVb5aCbHmutlRWk8c2hEqYppo2DL X-Forefront-Antispam-Report: CIP:165.204.84.222; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(428002)(3050300001)(199003)(189002)(4001540100001)(5007970100001)(62966003)(77156002)(50466002)(105586002)(19580405001)(19580395003)(2201001)(106466001)(86362001)(101416001)(5003600100002)(53416004)(189998001)(64706001)(47776003)(77096005)(68736005)(92566002)(2950100001)(50986999)(5001920100001)(5001860100001)(87936001)(48376002)(5001830100001)(76176999)(97736004)(5001770100001)(50226001)(46102003)(5003940100001)(229853001)(36756003); DIR:OUT; SFP:1102; SCL:1; SRVR:BY1PR02MB1148; H:atltwp02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY1PR02MB1148; 2:g7GR2lXlumeGF9yHmNUYPJrNXUH8DDj02CHmw5sRNB9hw+WNnjPacld5DyaWiFzBtQi+eSyCrpVGQ6KRoOsct2Sf9DHQrhIlzGfzwo2RHbdTavG1IoX181lQNsd0eWP+CDqEwgcHPyBBbgu5m8rf1tQcR3W/FO+qFfy5+CbVIwQ=; 3:ji2dQ3aHtI/KQql3vJGVKisphwr/0LDk2c124Cr5zRkMCb0sXfKW+ppNPJkY/hXZGLZN/zJs6dZNLdi8ZWijg/+4evuY4SyxMDzznhmHHrayK4CAsPlQuTzoLxIBiMtMrZIkskJBuUfvx+ZNzbTMIyJ9iT4nNWx5v2CjI3OALm1zM5suaYObof3JzLdEDU+6AcTp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8YYxHsBoyB4dvtCoIxsm9T7aOqq8gs1UZ9l+eu2VBVSg1505Tm+9raAjEXm4wyULrQUCK8i9VTrjbPxImb50qc62zoLDp+cpoCuai8fMLif9VFoUQl/NVtNJGuBH9ZupL0pO1ZUbZJ9ZLTqhRHLeXZ3IGknXeNxs9G2nfBeMVE2q+4AY4P9HulMUWiPhUexUGOXAyLBqM4uXRfm9Qn0j7jRePtaPw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(8121501046)(5005006)(3002001); SRVR:BY1PR02MB1148; BCL:0; PCL:0; RULEID:; SRVR:BY1PR02MB1148; X-Forefront-PRVS: 06793E740F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR02MB1148; 23:hmiO0fh8+fl0hYQHPay8kLSGhZoZzEeatatC6YH6f?= =?us-ascii?Q?fRFwHU99eOLN/pMSDAAh2isNNOgMMU3gQqryCj7CyQANYwdvaelJP8WF343y?= =?us-ascii?Q?UYUqdLJF6v3Cz8MUp1mgEWl4U0zrun5FMHv4hSjpS71gy0lh5ShD3M4DbT7T?= =?us-ascii?Q?ezqdQ+XG5Ynb3RRXJ7+f6C9AO+wD7Kv7MSs83JVB1pc86/0bHbDlikD3TJE2?= =?us-ascii?Q?yetLApQbMXCDHmwPeBlFITlphPcLBLx8RhHc9dELlvHhDla5IAUNOBqdz8dy?= =?us-ascii?Q?lZzZ2XRi2wG4FZc9EB9EbAie57IN8GdqxPzASSajJRTkmn3Xru3wJI9KH3aS?= =?us-ascii?Q?9i50GmI2Y54XD8U2fzSdTYt78CCa/YYYjcVi2kfIIQ0UVHcV9VXTnCEiIWxG?= =?us-ascii?Q?wtiUeEzT+f2Wt7IXWzqLlENSLwIKSn9hXwt7VXwtnKxXmU8mmzSPGyGEux71?= =?us-ascii?Q?bXaSgMaxAwJ2+xKGqHqctkp33eoFa8ze9bAP7n7oyBipYHyKWtU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bnT3RKbf2DD8Y=; 20:vrI85+iSA2unHDxQnF3FwFzZP4PomTVCIx5SQauR0BRZnp4XkKXtROXoII3xt6mGadG2r/seiW/Dq2gKZjZABw== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2015 17:34:06.9837 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96; Ip=[165.204.84.222]; Helo=[atltwp02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR02MB1148 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150825_103430_761713_60116FAE X-CRM114-Status: GOOD ( 13.78 ) 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: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Murali Karicheri , linux-acpi@vger.kernel.org, Rob Herring , 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=-5.5 required=5.0 tests=BAD_ENC_HEADER,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 adds support for setting up PCI device DMA coherency from ACPI _CCA object that should normally be specified in the DSDT node of its PCI host bridge. Signed-off-by: Suravee Suthikulpanit CC: Bjorn Helgaas CC: Catalin Marinas CC: Rob Herring CC: Will Deacon CC: Rafael J. Wysocki CC: Murali Karicheri --- drivers/pci/probe.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 4de6594..2fd2a60 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1551,17 +1551,22 @@ static void pci_init_capabilities(struct pci_dev *dev) * @dev: ptr to pci_dev struct of the PCI device * * Function to update PCI devices's DMA configuration using the same - * info from the OF node of host bridge's parent (if any). + * info from the OF node or ACPI node of host bridge's parent (if any). */ static void pci_dma_configure(struct pci_dev *dev) { struct device *bridge = pci_get_host_bridge_device(dev); if (IS_ENABLED(CONFIG_OF) && dev->dev.of_node) { - if (!bridge->parent) - return; - - of_dma_configure(&dev->dev, bridge->parent->of_node); + if (bridge->parent) + of_dma_configure(&dev->dev, + bridge->parent->of_node); + } else if (has_acpi_companion(bridge)) { + struct acpi_device *adev = to_acpi_node(bridge->fwnode); + int coherent = acpi_check_dma_coherency(adev); + + if (-1 != coherent) + arch_setup_dma_ops(&dev->dev, 0, 0, NULL, coherent); } pci_put_host_bridge_device(bridge);