Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753340AbbETLw3 (ORCPT ); Wed, 20 May 2015 07:52:29 -0400 Received: from mail-by2on0129.outbound.protection.outlook.com ([207.46.100.129]:14514 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751996AbbETLwV (ORCPT ); Wed, 20 May 2015 07:52:21 -0400 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; X-WSS-ID: 0NONCZ3-07-KP9-02 X-M-MSG: Message-ID: <555C7563.6080409@amd.com> Date: Wed, 20 May 2015 06:52:03 -0500 From: Suravee Suthikulanit User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Catalin Marinas CC: , , , , , , , , , , , , , , , , , , Subject: Re: [V4 PATCH 1/6] ACPI / scan: Parse _CCA and setup device coherency References: <1431724994-21601-1-git-send-email-Suravee.Suthikulpanit@amd.com> <1431724994-21601-2-git-send-email-Suravee.Suthikulpanit@amd.com> <20150520100122.GD25313@e104818-lin.cambridge.arm.com> In-Reply-To: <20150520100122.GD25313@e104818-lin.cambridge.arm.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD042;1:iIT+cVBRxugYdxFgQls7OwjZlrzyq02svWXDVGnHDgEsiYL89bx6GPoYJtOID8hbBTPDFlpiXWYGy2XUWZ/0H2FFLP5RjDbMl4s9zKLrKtRV9SjGVlJOEaQSPquhD4ewNHfnZ2PdJYAY4+kVHdBRv+y8N75jDZy0qsOzoIargSbimvmrVmpWZaCz4rCWzoi0l44w9QEi8iwCIb03tcobPBsCEMLqkXOawqgMUZi2cAuLisXkXYoRxpvW78p5atSiRfhZ7ojKL5ikXDV9gbOCyw== X-Forefront-Antispam-Report: CIP:165.204.84.221;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(428002)(51704005)(164054003)(377454003)(479174004)(199003)(24454002)(189002)(47776003)(65956001)(65806001)(92566002)(86362001)(64706001)(23746002)(189998001)(64126003)(65816999)(59896002)(120886001)(77156002)(62966003)(68736005)(50466002)(101416001)(46102003)(50986999)(77096005)(2950100001)(87266999)(54356999)(76176999)(36756003)(4001350100001)(106466001)(4001540100001)(97736004)(87936001)(105586002)(80316001)(83506001)(5001830100001)(110136002)(5001860100001)(33656002)(5510600003);DIR:OUT;SFP:1102;SCL:1;SRVR:BN3PR02MB1109;H:atltwp01.amd.com;FPR:;SPF:None;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR02MB1109; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BN3PR02MB1109;BCL:0;PCL:0;RULEID:;SRVR:BN3PR02MB1109; X-Forefront-PRVS: 0582641F53 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2015 11:52:17.0179 (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.221];Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR02MB1109 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1819 Lines: 48 On 5/20/2015 5:01 AM, Catalin Marinas wrote: > On Fri, May 15, 2015 at 04:23:09PM -0500, Suravee Suthikulpanit wrote: >> +static inline bool acpi_dma_is_supported(struct acpi_device *adev) >> +{ >> + /** >> + * Currently, we mainly support _CCA=1 (i.e. is_coherent=1) >> + * This should be equivalent to specifyig dma-coherent for >> + * a device in OF. >> + * >> + * For the case when _CCA=0 (i.e. is_coherent=0 && cca_seen=1), >> + * There are two approaches: >> + * 1. Do not support and disable DMA. >> + * 2. Support but rely on arch-specific cache maintenance for >> + * non-coherence DMA operations. ARM64 is one example. >> + * >> + * For the case when _CCA is missing (i.e. cca_seen=0) but >> + * platform specifies ACPI_CCA_REQUIRED, we do not support DMA, >> + * and fallback to arch-specific default handling. >> + * >> + * See acpi_init_coherency() for more info. >> + */ >> + return adev && (adev->flags.is_coherent || >> + (adev->flags.cca_seen && IS_ENABLED(CONFIG_ARM64))); >> +} > > I don't particularly like the check for CONFIG_ARM64 here but I > understand why it was added (I had the wrong impression that x86 can > cope with _CCA = 0). > > Alternatively, we could leave it out (together with cca_seen) until > someone comes forward with a real use-case for _CCA = 0 on arm64. One > platform I'm aware of is Juno but even though it boot with ACPI, I > wouldn't call it a server platform. Ok. That seems to be what Arnd would prefer as well. Let's just leave the support for _CCA=0 out until it is needed then. Thanks, Suravee -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/