Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933759AbbEERJo (ORCPT ); Tue, 5 May 2015 13:09:44 -0400 Received: from mail-bn1bbn0102.outbound.protection.outlook.com ([157.56.111.102]:47712 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759836AbbEEQJ6 (ORCPT ); Tue, 5 May 2015 12:09:58 -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: 0NNVWWF-07-LJQ-02 X-M-MSG: Message-ID: <5548EB42.5010800@amd.com> Date: Tue, 5 May 2015 11:09:38 -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: Arnd Bergmann , CC: , , , , , , , , , , , , , , , , Subject: Re: [V2 PATCH 2/5] arm64 : Introduce support for ACPI _CCA object References: <1430838729-21572-1-git-send-email-Suravee.Suthikulpanit@amd.com> <1430838729-21572-3-git-send-email-Suravee.Suthikulpanit@amd.com> <5126612.k0u2CL2zi5@wuerfel> In-Reply-To: <5126612.k0u2CL2zi5@wuerfel> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.221;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(428002)(377454003)(51704005)(189002)(164054003)(24454002)(199003)(479174004)(120886001)(50986999)(77096005)(76176999)(105586002)(47776003)(54356999)(36756003)(65806001)(2950100001)(46102003)(86362001)(80316001)(83506001)(33656002)(62966003)(92566002)(23746002)(101416001)(87936001)(5001770100001)(50466002)(106466001)(77156002)(4001350100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR02MB1114;H:atltwp01.amd.com;FPR:;SPF:None;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR02MB1114; 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:BY1PR02MB1114;BCL:0;PCL:0;RULEID:;SRVR:BY1PR02MB1114; X-Forefront-PRVS: 0567A15835 X-OriginatorOrg: amd4.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2015 16:09:52.7995 (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: BY1PR02MB1114 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1791 Lines: 43 On 5/5/2015 10:44 AM, Arnd Bergmann wrote: > On Tuesday 05 May 2015 10:12:06 Suravee Suthikulpanit wrote: >> +struct dma_map_ops dummy_dma_ops = { >> + .alloc = __dummy_alloc, >> + .free = __dummy_free, >> + .mmap = __dummy_mmap, >> + .map_page = __dummy_map_page, >> + .unmap_page = __dummy_unmap_page, >> + .map_sg = __dummy_map_sg, >> + .unmap_sg = __dummy_unmap_sg, >> + .sync_single_for_cpu = __dummy_sync_single_for_cpu, >> + .sync_single_for_device = __dummy_sync_single_for_device, >> + .sync_sg_for_cpu = __dummy_sync_sg_for_cpu, >> + .sync_sg_for_device = __dummy_sync_sg_for_device, >> + .mapping_error = __dummy_mapping_error, >> + .dma_supported = __dummy_dma_supported, >> +}; >> +EXPORT_SYMBOL(dummy_dma_ops); >> + >> > > This will clearly work, but I think it's easier to just leave > the dma_mask pointer as NULL when creating the platform device, > which should let the normal dma ops fail all the callbacks. > > Arnd > However, codes in several places are making use of dma_map_ops without checking if the ops are NULL (i.e. include/asm-generic/dma-mapping-common.h and in arch-specific implementation). If setting it to NULL is what we are planning to support, we would need to scrub the current code to put NULL check. Also, would you consider if that is safe to do going forward? 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/