From patchwork Wed Aug 26 13:54:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suravee Suthikulpanit X-Patchwork-Id: 7077551 Return-Path: X-Original-To: patchwork-linux-acpi@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 66BC3C05AC for ; Wed, 26 Aug 2015 13:56:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2CED22088C for ; Wed, 26 Aug 2015 13:56:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3873A20887 for ; Wed, 26 Aug 2015 13:56:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756544AbbHZNzG (ORCPT ); Wed, 26 Aug 2015 09:55:06 -0400 Received: from mail-by2on0090.outbound.protection.outlook.com ([207.46.100.90]:26144 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756430AbbHZNzB (ORCPT ); Wed, 26 Aug 2015 09:55:01 -0400 Received: from CY1PR12CA0041.namprd12.prod.outlook.com (10.160.137.51) by DM3PR12MB0860.namprd12.prod.outlook.com (10.164.7.142) with Microsoft SMTP Server (TLS) id 15.1.243.23; Wed, 26 Aug 2015 13:54:59 +0000 Received: from CO1NAM03FT010.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::206) by CY1PR12CA0041.outlook.office365.com (2a01:111:e400:4c1f::51) with Microsoft SMTP Server (TLS) id 15.1.256.15 via Frontend Transport; Wed, 26 Aug 2015 13:54:59 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.221) 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 atltwp01.amd.com (165.204.84.221) by CO1NAM03FT010.mail.protection.outlook.com (10.152.80.104) with Microsoft SMTP Server id 15.1.256.10 via Frontend Transport; Wed, 26 Aug 2015 13:54:58 +0000 X-WSS-ID: 0NTOZZK-07-83A-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 atltwp01.amd.com (Axway MailGate 5.3.1) with ESMTPS id 2162CCAE647; Wed, 26 Aug 2015 09:54:55 -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, 26 Aug 2015 08:55:05 -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; Wed, 26 Aug 2015 09:54:54 -0400 From: Suravee Suthikulpanit To: , , , , CC: , , , , , Jeremy Linton , Suravee Suthikulpanit , Rob Herring Subject: [PATCH V3 1/4] Honor ACPI _CCA attribute setting Date: Wed, 26 Aug 2015 20:54:36 +0700 Message-ID: <1440597279-11802-2-git-send-email-Suravee.Suthikulpanit@amd.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1440597279-11802-1-git-send-email-Suravee.Suthikulpanit@amd.com> References: <1440597279-11802-1-git-send-email-Suravee.Suthikulpanit@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.221; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(428002)(3050300001)(199003)(189002)(106466001)(77156002)(5003600100002)(50986999)(68736005)(50466002)(48376002)(62966003)(50226001)(5003940100001)(77096005)(86362001)(5001860100001)(189998001)(92566002)(5001830100001)(76176999)(101416001)(2950100001)(4001540100001)(5007970100001)(64706001)(105586002)(87936001)(2201001)(229853001)(53416004)(19580395003)(5001770100001)(46102003)(97736004)(36756003)(19580405001)(47776003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR12MB0860; H:atltwp01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0860; 2:vwHc5QDQh0hNsbnAvOY9Kl1q2GUrvO9JdfP5KtVwLlnJIawDflPj/G8YN69jdkt7rz/LH3AVCStWeAtnazXDSHMaVoW5l5Y6kj+8IXPfIJYQrRIcRUcvAKA7o6xXJemiPc8cLg5FTP+SeYrxn1eeyQ1s+R7CxosTlh+3xtAJOO0=; 3:8ZOhLjkRcBS1KNLsANoalFmkq2sOuIjzGsSWtLcHiUTSEitM51KoKTdKR8sLO0IPkRXK2pvek305wSmr5SbUNqi4zNo1cbWSXWnqz/xHJkl7IaaFqsgEpEdQxw4IM0EhKVEHmfUvaD26ECKBJs8B6dzovlFw/KEyls3peQeJ3lwPPOoTyEXekIGilEgvJ+OVYyYaarcmeZzlTeKJhWNlMuI+6Qsobhfdm1SoQL9ICKjR32ESzDY0g9SfEDNrysYi; 25:Gw+Vm7xh0UHIxgAEs2cAUpVKa6E+jejsZZW7o+O8g2dpXydBXxjhg5/+wuqzT9cZg5QK5OTTLc75WfyxNH841vGpn21Wgr4DnBRBedIgnW6Piwr35EQFPUvaOWZKDSiuUE+oaP5w4doC+d02wJwVWyNxgrmfMUk9R9FTW5KWcc5cqynqxfcs+y9kWXclODhEP7TkGeQbDi4z2+9ZzGSXc29EfZMMQqDq3DcwKfJGp5UmIsIBtl1p11e5md+zgmeMUx8Um7+cb12G53rcmYcziA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM3PR12MB0860; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0860; 20:wqlvMECMgwTneXjllbUq9he71PXsb8FWvYoWTD1KOvITaiL9Uy9nD8NKWByRuLrs0d1hemy4WFWHowELyrkqn/WYsLCwXZKrplAb2/6yCfgGPZawpMMOU5cm1LQemr2x1VPLn1mMAMN7XairxboUeZUa9OvR3VPVTk4m/vMNQOBT9rpMEf2qKhU7b9ZQbAbFcp2LP7HBAJOQ313JXh6QN4mTynErFKtlC9gpNxauF1Q8+swp2UhTTXbOdp/tQbG/fztwOqn9txG9YZ7kluKYWBgbgmMUpHQ4uw4OCsoLOAj7ZtoUxcvWSRrdvPTTHyRXKW9MhkkSlQHcm0EbHEqAh1zKYgzMSMVn5JJjv2YlYKxzEsE0by+Hx5Q9EkZ3Q/JXtKWek0NbsoaFX8ufgk5Pe+XBtdC7hiwEp9c2swoYU7L1Kvpl2k7uOFy2D02+d9FPEkcXY86fl9i5vCm3ODdQG2DYKzQzK7HKDeENb1FesVwY7gXK0rkTK3GOLgmVrK8F; 4:5I4uumSIM+9Jd1tcBPJVJDjDJKtv9ZivOVw0VSuv6VXdvJJMsr/wjZqrVlO5mydrRa0+de+8EecVtTqSdU/RA0bud/Egk14fp47DVMhP7bLM9hYbc1VkjJrhcK7kNXQlURtFB3yuLgdBc9xoTmi3aM+NSbPr/7L/6QOuQfjwVmba/PQG/tc/ktCaiu9tJVF0uvk6JQaY0nZrwEPjfoAyy7VvZk3JSjY01oVLvsfO6FwKJg0wuYgfkIGL17/rrHsacP3gHKXNEhC9lggwkmimJtQwGykP3gjpPXGcRv0tso5x1EYQO2JiuAlkv5GlQxeE 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:DM3PR12MB0860; BCL:0; PCL:0; RULEID:; SRVR:DM3PR12MB0860; X-Forefront-PRVS: 0680FADD48 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM3PR12MB0860; 23:y3C46PNA46lYltXeYS5BoS/BFHtQjfo/cn7ee4jk0?= =?us-ascii?Q?b9p23SFNZXul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XN5Obmo?= =?us-ascii?Q?xnC+8j39knSmMAzxsgSz1xLWtW/5mmhFmmRrL9H7sY9GM/i656ahlPZKXtZT?= =?us-ascii?Q?ZHo6BY/OZ4kiQZ8bAOpmF2kCTnC4YKBJRS4x/FPryYkLRp5terzN2niRkSJA?= =?us-ascii?Q?PKP+MAv0P8HHOmb9tyr6DUhf7o6NKrFUq83a5v3W/N4JC+dmA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0860; 5:qTNRFbdugg8X7Rj+Ekw7XRyGvi4uRc1jEOK6bWPWsXB214o4j4PYkIbt0nHuQIbAhAcAj3josS0TD0d1EFBpWaMUbAfiZc8Xt8AkzLhj0OXCxLabah9uNeTh3cy8DmWlMzPtXRq2nn3DNBewlr+KCQ==; 24:8hakmE2I5A5FqBkUtUJrZL/tr3z3iLLe3hmegCYogoIJto9C3aIIHyU/hEAGBk1QrS6XbrZGFlFmdiTjsk1Ck0JFZKiAxigHt4npnMtm7iU=; 20:cV9sRsDtT/IhGGhs2y9X1EPFGAJiejHlPakg6Jv77hMZpaQHKg+yWsxZxG9AVjZXGSHN8rQUdS1KgtVm+SxfRg== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2015 13:54:58.0313 (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.221]; Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB0860 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 From: Jeremy Linton ACPI configurations can now mark devices as noncoherent, support that choice. NOTE: This is required to support USB on ARM Juno Development Board. Signed-off-by: Jeremy Linton Signed-off-by: Suravee Suthikulpanit CC: Bjorn Helgaas CC: Catalin Marinas CC: Rob Herring CC: Will Deacon CC: Rafael J. Wysocki --- include/acpi/acpi_bus.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 83061ca..7ecb8e4 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -399,7 +399,7 @@ static inline bool acpi_check_dma(struct acpi_device *adev, bool *coherent) * case 1. Do not support and disable DMA. * case 2. Support but rely on arch-specific cache maintenance for * non-coherence DMA operations. - * Currently, we implement case 1 above. + * Currently, we implement case 2 above. * * For the case when _CCA is missing (i.e. cca_seen=0) and * platform specifies ACPI_CCA_REQUIRED, we do not support DMA, @@ -407,7 +407,8 @@ static inline bool acpi_check_dma(struct acpi_device *adev, bool *coherent) * * See acpi_init_coherency() for more info. */ - if (adev->flags.coherent_dma) { + if (adev->flags.coherent_dma || + (adev->flags.cca_seen && IS_ENABLED(CONFIG_ARM64))) { ret = true; if (coherent) *coherent = adev->flags.coherent_dma;