Message ID | 1445442731-28819-9-git-send-email-Suravee.Suthikulpanit@amd.com |
---|---|
State | New |
Headers | show
Return-Path: <patchwork-forward+bncBCO3DI5M3QNRBAXKT2YQKGQE7O3KMCQ@linaro.org> X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id 778D6230CD for <linaro@patches.linaro.org>; Wed, 21 Oct 2015 15:53:39 +0000 (UTC) Received: by wicfg8 with SMTP id fg8sf8665074wic.0 for <linaro@patches.linaro.org>; Wed, 21 Oct 2015 08:53:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type :spamdiagnosticoutput:spamdiagnosticmetadata:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=9DAu6S76MNNvjyH8dBa34+FdvWIq+rmjp5nx8iiEAjE=; b=RJE6EiX7HBqWVuDXz5TjExvYEwD48euEFLNjARmPrrIMwXYKgseFMrKcwx9ELA/m1M xcTYlgzu4ea0vjaIWZw/iRsLLk7HfxGv1/rSZKtQiYbkAKqE6wMGPk4Ock9CfjwuT3ji kkrfphq3Hr9nwAT9T+a4HKi0X/Q+tTQ2gcdkTQKfv+uKlio0eDvyB6NKRTNoPE4zIuCG N4GuSbsbdk4yg6lKcIak1SX7guSvIk7T2+ZnKRsP8PAMBNMRIhN3M5Yuz6sJs9445kEE QkSMZn0AfPHxsTBE7yJbRqOkth9FDM8LbppNhJHjFmwLFbLALnmFLlSKTBFV7SzelQxV zu7Q== X-Gm-Message-State: ALoCoQkFkQtYvNjv6HniD8hdBnK1ElPEa7FJBTtRjwudpqxy2P7OcUzv/t9QDZ4ScJf2pWjibB5n X-Received: by 10.194.71.166 with SMTP id w6mr2392976wju.6.1445442818811; Wed, 21 Oct 2015 08:53:38 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.147.194 with SMTP id v185ls219673lfd.22.gmail; Wed, 21 Oct 2015 08:53:38 -0700 (PDT) X-Received: by 10.25.30.84 with SMTP id e81mr3856422lfe.48.1445442818630; Wed, 21 Oct 2015 08:53:38 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id pf6si6839927lbc.166.2015.10.21.08.53.38 for <patchwork-forward@linaro.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Oct 2015 08:53:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbbes7 with SMTP id es7so41773296lbb.2 for <patchwork-forward@linaro.org>; Wed, 21 Oct 2015 08:53:38 -0700 (PDT) X-Received: by 10.112.64.41 with SMTP id l9mr4881217lbs.32.1445442818120; Wed, 21 Oct 2015 08:53:38 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp66398lbq; Wed, 21 Oct 2015 08:53:37 -0700 (PDT) X-Received: by 10.66.158.233 with SMTP id wx9mr11557363pab.157.1445442816328; Wed, 21 Oct 2015 08:53:36 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dz5si14170095pab.108.2015.10.21.08.53.36; Wed, 21 Oct 2015 08:53:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755613AbbJUPxU (ORCPT <rfc822;pingbo.wen@linaro.org> + 28 others); Wed, 21 Oct 2015 11:53:20 -0400 Received: from mail-bn1bon0059.outbound.protection.outlook.com ([157.56.111.59]:12033 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753535AbbJUPxN (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 21 Oct 2015 11:53:13 -0400 Received: from CY1PR1201CA0023.namprd12.prod.outlook.com (10.169.17.161) by CY1PR12MB0714.namprd12.prod.outlook.com (10.163.238.20) with Microsoft SMTP Server (TLS) id 15.1.306.13; Wed, 21 Oct 2015 15:53:10 +0000 Received: from BY2NAM03FT032.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::209) by CY1PR1201CA0023.outlook.office365.com (2a01:111:e400:5b9a::33) with Microsoft SMTP Server (TLS) id 15.1.306.13 via Frontend Transport; Wed, 21 Oct 2015 15:53:09 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from atltwp02.amd.com (165.204.84.222) by BY2NAM03FT032.mail.protection.outlook.com (10.152.84.228) with Microsoft SMTP Server id 15.1.306.8 via Frontend Transport; Wed, 21 Oct 2015 15:53:08 +0000 X-WSS-ID: 0NWKUSG-08-0A3-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 221A6BD8902; Wed, 21 Oct 2015 11:53:03 -0400 (EDT) Received: from SATLEXDAG04.amd.com (10.181.40.9) by SATLVEXEDGE02.amd.com (10.177.96.29) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 21 Oct 2015 10:53:15 -0500 Received: from ssuthiku-fedora-lt.amd.com (10.180.168.240) by satlexdag04.amd.com (10.181.40.9) with Microsoft SMTP Server id 14.3.266.1; Wed, 21 Oct 2015 11:53:05 -0400 From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> To: <bhelgaas@google.com>, <rjw@rjwysocki.net>, <lenb@kernel.org>, <catalin.marinas@arm.com>, <will.deacon@arm.com> CC: <hanjun.guo@linaro.org>, <thomas.lendacky@amd.com>, <herbert@gondor.apana.org.au>, <davem@davemloft.net>, <linux-acpi@vger.kernel.org>, <linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>, Rob Herring <robh+dt@kernel.org>, Murali Karicheri <m-karicheri2@ti.com> Subject: [PATCH V4 8/8] PCI: ACPI: Add support for PCI device DMA coherency Date: Wed, 21 Oct 2015 08:52:11 -0700 Message-ID: <1445442731-28819-9-git-send-email-Suravee.Suthikulpanit@amd.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1445442731-28819-1-git-send-email-Suravee.Suthikulpanit@amd.com> References: <1445442731-28819-1-git-send-email-Suravee.Suthikulpanit@amd.com> MIME-Version: 1.0 Content-Type: text/plain 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)(5003600100002)(50986999)(50466002)(77096005)(48376002)(5008740100001)(97736004)(5001770100001)(46102003)(76176999)(53416004)(2950100001)(5003940100001)(101416001)(47776003)(189998001)(19580395003)(19580405001)(92566002)(2201001)(87936001)(106466001)(86362001)(105586002)(50226001)(5007970100001)(36756003)(229853001)(64706001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0714; H:atltwp02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0714; 2:WcnEDK6Qr7iN2TOZ/Gjl7qOw762IwVU0B2NGB8g3TO6XeHo/tci9MEla7Sz+7b1hHWTgrRbwQDDo3vLcR2pzgPOJgJOmm3gHeBSa0PTrJ0fMQgNlqQPNu6Xet10YwaYu5d+KIrgipUpwjnKhxLtEyS9kw2jLLVnnj9d/QFLeGYw=; 3:Jkfp+QACCBO34g4bSstU3tfZetmH4CwuXGo00SDNWkMn4LDXU0q94xrSjJFf0mIkoMrgtfgDFGP22vux4aZ2IVPQu2uaORw99G019HbZVSNawNFYZokFNDu5ODw9iZe+Xlyj+H1GgZPYgucUboULwEFXTRWMimRy8eZvAr6IzvQF7j9kF4WgKYIa891ALopsMtI5pOgC6XfLSqFblwCJmBazr+v6fzGoUKKApmtB7MXNQ582xOOMEk8EfFRpIa7v; 25:grRNYaHIr81Nz2YMmnGKCgKBShCl85wGf9WOHOby6yU9npIZk7hEvozX+Ue9oQ/ZAoKTEMR6CO+/6wUGTzY0cWosbDAoXmgVNIa3/H3umQYIu2dtmbqVE7c5QHpBVimt7qD9OO8ZrRQC8IeVtMw02bbWdUuN5vSrNNa3gdV7PNWZagwNzW1RW9xvP9TDH2wu64GdAdnJeIk1yOdIHaoIa9CrnHOb11n+se5/vPJIsJAUfQABZ68ntsg0BwFrpTji X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR12MB0714; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0714; 20:nDuZ+SNJ65C162espSuLKG/Q8+5EvoKnSknta7rQtf1P7cXhXmN9M929XcyJPpppsEQzzxWyyiwByTiohRGq8MhM4TDynLi6290pl6gsT03AXjYKU1UEUcxEZ0unMhmk/yygb1fDQFNnxng/y1nwBfR8I8bpCR8lJrffdTezctSr1Bmp6JM6f9QH/fWV2u7vofaVijzQExAtR1DCx0Sf/d7hXWDFjR8M5p4N39rLlgv7DwnhxnkAQqPKWlq3wvsNEW/RbBZ8aB4ycbzpjsafdFONuMVIWV2MREclg2gSKrticrCxUiZjdr6LMU2Ib/H6Lfs72DsWCDHxU6oXW5dCfiY878WOjM8DoLO9zZflnG5y773dotsf1D7aAay4+Q+SMicjArBK2ah7TuUPmxgdiVAjYlF4ADeiZVhDVEnA9bpsJH6hh7DHbO3ZSH/Yu7KSjE1DhNi3ef7xxirLBUuQFLdyEkdMMX3Od9ujHTFVKJbBFC3FOrgx9hypdbYDSub5; 4:hYjAlbqYQKXZyK7pkIiyi8TfFe68zwN7GwhygfXOVMorc8YXGDCSJenuEvwbvIhB7LE/yfuv9wERhFGhFXi5MGMKJ/5Y6j6Bw+NLN2lSahGhd9P4WDRQzs6P3/1iP2r8H7M8CgSbKvH9bGsXc6vC//lXxnf5h9ynVNwUe5xtlLMsEqLnXFle3PidQ3rLbwxMiEzQB+XWZuq4KVLpwU+pgDFcs5cp1wLO5cof3teY5UMz/ZhD2eCLyxqeL/SLPZI6HYxc+1HQA6y/ODjBWJgpL/zpBR2bb6dSioL5bbRVQM+GcIvqv0qRGY6HvfZTmnsA9kTSRvA9OklC5b9a+2s3+wYvqSaJWPKwr51B2FmXkU3uXhuK0gxDSV6uRf2j20Tg X-Microsoft-Antispam-PRVS: <CY1PR12MB0714EC61615B69624DF16B28F3380@CY1PR12MB0714.namprd12.prod.outlook.com> 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:CY1PR12MB0714; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0714; X-Forefront-PRVS: 073631BD3D X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0714; 23:/RfBZsYceQqJdonVK9RnvpxXFcgnI6W49huE9P/C7SOnGJccb8/12j4xBUvH9ZxQgmGe4ZDy1m2DOQEGr3AR1RuJYDeYeNfltreAzrjxlV6qKHRh36bKeat/m/89UX984p1De5nl62AdOJRgwvbscSP/gds/FtX2slMWORocSm+jSm2FoCahP3TX0gO4/Op8iWjrttr9tzOvGFNIEJSBiVASYagc3sxBSLzdwQTPljPdogwQ7IenKiiEVsPwnpsb/Dw/PclfygAEFgbWbqP+Y9166pdqp5pdMY0uaQhNoTE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Djk0Af/BhASawKGZ8jOp5xx7Z1OBMH6Va2pnGDWBp70mUtCU0gB2xUCgXY/wnu/FklxTODXC1zIoA04yY3OsO5Lf2BebjHgk2E+3+A9K4Z6k5/yjN04ipJasVgq5QATUBlhrTPzmc/37I0Pfd SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2015 15:53:08.4960 (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: CY1PR12MB0714 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: <patchwork-forward.linaro.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: suravee.suthikulpanit@amd.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: <http://groups.google.com/a/linaro.org/group/patchwork-forward/post>, <mailto:patchwork-forward@linaro.org> List-Help: <http://support.google.com/a/linaro.org/bin/topic.py?topic=25838>, <mailto:patchwork-forward+help@linaro.org> List-Archive: <http://groups.google.com/a/linaro.org/group/patchwork-forward/> List-Unsubscribe: <mailto:googlegroups-manage+836684582541+unsubscribe@googlegroups.com>, <http://groups.google.com/a/linaro.org/group/patchwork-forward/subscribe> |
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 09264f8..6e9f7e6 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1642,17 +1642,26 @@ static void pci_set_msi_domain(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); + enum dev_dma_attr attr = acpi_get_dma_attr(adev); + + if (attr != DEV_DMA_NOT_SUPPORTED) + arch_setup_dma_ops(&dev->dev, 0, 0, NULL, + attr == DEV_DMA_COHERENT); + else + WARN(1, FW_BUG "PCI device %s fail to setup DMA.\n", + pci_name(dev)); } pci_put_host_bridge_device(bridge);
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 <Suravee.Suthikulpanit@amd.com> CC: Bjorn Helgaas <bhelgaas@google.com> CC: Catalin Marinas <catalin.marinas@arm.com> CC: Rob Herring <robh+dt@kernel.org> CC: Will Deacon <will.deacon@arm.com> CC: Rafael J. Wysocki <rjw@rjwysocki.net> CC: Murali Karicheri <m-karicheri2@ti.com> --- drivers/pci/probe.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)