Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423409AbbD2O5i (ORCPT ); Wed, 29 Apr 2015 10:57:38 -0400 Received: from mail-bn1bon0133.outbound.protection.outlook.com ([157.56.111.133]:29024 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1423165AbbD2O5c convert rfc822-to-8bit (ORCPT ); Wed, 29 Apr 2015 10:57:32 -0400 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; X-WSS-ID: 0NNKPJA-08-KJ2-02 X-M-MSG: From: "Suthikulpanit, Suravee" To: Arnd Bergmann , "linaro-acpi@lists.linaro.org" CC: "linux-arm-kernel@lists.infradead.org" , "catalin.marinas@arm.com" , "rjw@rjwysocki.net" , "linux-kernel@vger.kernel.org" , "will.deacon@arm.com" , "linux-acpi@vger.kernel.org" , "lenb@kernel.org" , "Charles Garcia-Tobin" Subject: Re: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency Thread-Topic: [Linaro-acpi] [PATCH 2/2] ACPI / scan: Parse _CCA and setup device coherency Thread-Index: AQHQgoKUZmTlGX0FBUKsx9+W4zFieJ1kSIaA//+4B4CAAFRqgP//rsiA Date: Wed, 29 Apr 2015 14:57:10 +0000 Message-ID: In-Reply-To: <3246744.xVj4sLRlWl@wuerfel> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.0.121105 x-originating-ip: [10.177.96.13] Content-Type: text/plain; charset="us-ascii" Content-ID: <6CAF71ED978F994C838BF63F72F3B77F@amd.com> Content-Transfer-Encoding: 8BIT 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:(10019020)(6009001)(428002)(51704005)(24454002)(377454003)(199003)(479174004)(189002)(47776003)(86362001)(46102003)(2656002)(97756001)(53416004)(36756003)(50466002)(4001350100001)(106116001)(101416001)(62966003)(106466001)(19580405001)(50986999)(54356999)(105586002)(2950100001)(23726002)(92566002)(83506001)(19580395003)(87936001)(5250100002)(5001770100001)(102836002)(2900100001)(2501003)(77156002);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR02MB1105;H:atltwp02.amd.com;FPR:;SPF:None;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR02MB1105; 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:BLUPR02MB1105;BCL:0;PCL:0;RULEID:;SRVR:BLUPR02MB1105; X-Forefront-PRVS: 05610E64EE X-OriginatorOrg: amd4.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2015 14:57:13.3024 (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: BLUPR02MB1105 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2590 Lines: 75 On 4/29/15, 09:47, "Arnd Bergmann" wrote: >On Wednesday 29 April 2015 09:45:43 Suravee Suthikulpanit wrote: >> On 04/29/2015 09:03 AM, Arnd Bergmann wrote: >> > On Wednesday 29 April 2015 08:44:09 Suravee Suthikulpanit wrote: >> >> + device->flags.cca_seen = 1; >> >> + } else if (IS_ENABLED(CONFIG_ACPI_MUST_HAVE_CCA)) { >> >> + /* >> >> + * Architecture has specified that if the >>device >> >> + * can do DMA, it must have ACPI _CCA object. >> >> + * Here, there could be two cases: >> >> + * 1. Not DMA-able device. >> >> + * 2. DMA-able device, but missing _CCA >>object. >> >> + * >> >> + * In both cases, we will default to dma >>non-coherent. >> >> + */ >> >> + cca = 0; >> >> + } else { >> >> + /* >> >> + * If architecture does not specify that >>device must >> >> + * specify ACPI _CCA (e.g. x86), we default >>to use >> >> + * dma coherent. >> >> + */ >> >> + cca = 1; >> >> + } >> >> >> > >> > What does it mean here if a device does DMA but is not coherent? Do >>you >> > have an example of a server that needs this? >> > >> > Can we please make the default for ARM64 cca=1 as well? >> > >> > Arnd >> > >> >> Actually, I am trying to implement the logic for when missing _CCA to >>be >> consistent with the behavior when the devicetree entry does not specify >> "dma-coherent" property. IIUC, in such case, Linux will default to >>using >> non-coherent DMA. > >Why? > > Arnd Otherwise, it would seem inconsistent with what states in the ACPI spec: CCA objects are only relevant for devices that can access CPU-visible memory, such as devices that are DMA capable. On ARM based systems, the _CCA object must be supplied all such devices. On Intel platforms, if the _CCA object is not supplied, the OSPM will assume the devices are hardware cache coherent. >From the statement above, I interpreted as if it is not present, it would be non-coherent. 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/