Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751935AbbEFWRA (ORCPT ); Wed, 6 May 2015 18:17:00 -0400 Received: from mail-bn1bon0139.outbound.protection.outlook.com ([157.56.111.139]:54938 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751069AbbEFWQ4 (ORCPT ); Wed, 6 May 2015 18:16:56 -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: 0NNY8K1-08-QZV-02 X-M-MSG: Message-ID: <554A92C3.7060606@amd.com> Date: Wed, 6 May 2015 17:16:35 -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: "Rafael J. Wysocki" CC: , , , , , , , , , , , , , , , , , , Mika Westerberg Subject: Re: [V2 PATCH 1/5] ACPI / scan: Parse _CCA and setup device coherency References: <1430838729-21572-1-git-send-email-Suravee.Suthikulpanit@amd.com> <3234610.3j3NfP3xpR@vostro.rjw.lan> <55499569.8060403@amd.com> <4573209.dHyztuCFMt@vostro.rjw.lan> In-Reply-To: <4573209.dHyztuCFMt@vostro.rjw.lan> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.222;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(428002)(199003)(164054003)(24454002)(189002)(479174004)(377454003)(57704003)(101416001)(62966003)(86362001)(2950100001)(33656002)(80316001)(76176999)(50466002)(83506001)(23676002)(54356999)(92566002)(47776003)(110136002)(65816999)(50986999)(105586002)(59896002)(87936001)(106466001)(65956001)(65806001)(77096005)(77156002)(36756003)(4001350100001)(120886001)(93886004)(5001920100001)(46102003)(189998001);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR02MB068;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:BLUPR02MB068; 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:BLUPR02MB068;BCL:0;PCL:0;RULEID:;SRVR:BLUPR02MB068; X-Forefront-PRVS: 0568F32D91 X-OriginatorOrg: amd4.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2015 22:16:52.1795 (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: BLUPR02MB068 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2274 Lines: 73 On 5/6/2015 5:21 PM, Rafael J. Wysocki wrote: >>>> > >>+ bool >>>> > >>+ >>>> > >>+config ACPI_SUPPORT_CCA_ZERO >>> > > >>> > >I guess this means "we support devices that can DMA, but are not coherent". >>> > >right? >> > >> >Yes, basically when _CCA=0. > So what about > > ARCH_SUPPORT_CACHE_INCOHERENT_DMA Since this is specific to ACPI _CCA, I just want to be clear with the naming. > or something similar? > >>>> > >>+ bool >>>> > >>+ >>>> > >> config ACPI_SLEEP >>>> > >> bool >>>> > >> depends on SUSPEND || HIBERNATION >>>> > >>diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c >>>> > >>index 4bf7559..a6feca4 100644 >>>> > >>--- a/drivers/acpi/acpi_platform.c >>>> > >>+++ b/drivers/acpi/acpi_platform.c >>>> > >>@@ -108,9 +108,11 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev) >>>> > >> if (IS_ERR(pdev)) >>>> > >> dev_err(&adev->dev, "platform device creation failed: %ld\n", >>>> > >> PTR_ERR(pdev)); >>>> > >>- else >>>> > >>+ else { >>> > > >>> > >Please add braces to both branches when making such changes (as per CodingStyle). >>> > > >> > >> >OK. >> > >>>> > >>+ acpi_setup_device_dma(adev, &pdev->dev); >>> > > >>> > >Why do we need to do that here (for the second time)? >> > >> >Because we are calling: >> > acpi_create_platform_device() >> > |--> platform_device_register_device_full() >> > |-->platform_device_alloc() >> > >> >This creates platform_device, which allocate a new platform_device->dev. >> >This is not the same as the original acpi_device->dev that was created >> >during acpi_add_single_object(). So, we have to set up the device >> >coherency again. > Ah, so the second arg is different now. > > Well, in that case, why do we need to set it up for the adev's dev member? > Just for sanity, since I don't know if adev->dev will be referenced anywhere else. This way, it's consistent for all copied of struct device generated. Lemme know if you think that is unnecessary. 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/