Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751244AbdGPBY0 (ORCPT ); Sat, 15 Jul 2017 21:24:26 -0400 Received: from smtprelay.synopsys.com ([198.182.60.111]:42242 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751213AbdGPBYY (ORCPT ); Sat, 15 Jul 2017 21:24:24 -0400 X-Mozilla-News-Host: news://gmane.comp.lib.uclibc.buildroot:119 To: "linux-arch@vger.kernel.org" , "linux-mm@kvack.org" , Christoph Hellwig , , Alexander Duyck , Krzysztof Kozlowski , Andrew Morton , "linux-arch@vger.kernel.org" CC: lkml , arcml From: Vineet Gupta Subject: semantics of dma_map_single() Organization: Synopsys Message-ID: Date: Sat, 15 Jul 2017 18:24:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.12.196.96] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1019 Lines: 26 P.S. Apologies in advance for the explicit TO list, it seemed adding people who've touched the dma mapping code (for ARC atleast), would respond sooner ;-) The question is does dma_map_single() imply a single region (possibly > PAGE_SIZE) or does it imply PAGE_SIZE. Documentation/DMA-API* is not explicit about one or the other and the code below seems to point to "a" struct page, although it could also mean multiple pages, specially if the pages are contiguous, say as those returned by alloc_pages(with order > 0) static inline dma_addr_t dma_map_single_attrs(dev, size, dir, attrs) { addr = ops->map_page(dev, virt_to_page(ptr), <--- this is one struct page offset_in_page(ptr), size, dir, attrs); } ARC dma_map_single() currently only handles cache coherency for only one struct page or PAGE_SIZE worth of memory, and we have a customer who seem to assume that it handles a region. Looking at other arches dma mapping backend, it is not clear either what the semantics are. Thx, -Vineet