From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E0E5C4363D for ; Fri, 25 Sep 2020 16:18:04 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4E88820809 for ; Fri, 25 Sep 2020 16:18:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E88820809 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E66D587628; Fri, 25 Sep 2020 16:18:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R4DgoF3jAymz; Fri, 25 Sep 2020 16:18:02 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id E828687581; Fri, 25 Sep 2020 16:18:02 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id CBD9FC0890; Fri, 25 Sep 2020 16:18:02 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id A8DFEC0859 for ; Fri, 25 Sep 2020 16:18:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 929C486980 for ; Fri, 25 Sep 2020 16:18:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K5ipPTcBiTAK for ; Fri, 25 Sep 2020 16:18:00 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 2B50A8694A for ; Fri, 25 Sep 2020 16:18:00 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 39A7E68AFE; Fri, 25 Sep 2020 18:17:55 +0200 (CEST) Date: Fri, 25 Sep 2020 18:17:54 +0200 From: Christoph Hellwig To: Robin Murphy Subject: Re: [PATCH 08/18] dma-mapping: add a new dma_alloc_noncoherent API Message-ID: <20200925161754.GA18721@lst.de> References: <20200915155122.1768241-1-hch@lst.de> <20200915155122.1768241-9-hch@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Cc: alsa-devel@alsa-project.org, linux-doc@vger.kernel.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, "James E.J. Bottomley" , linux-mm@kvack.org, linux1394-devel@lists.sourceforge.net, Christoph Hellwig , linux-samsung-soc@vger.kernel.org, Joonyoung Shim , linux-scsi@vger.kernel.org, Ben Skeggs , Matt Porter , linux-media@vger.kernel.org, Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, Thomas Bogendoerfer , linux-parisc@vger.kernel.org, netdev@vger.kernel.org, Seung-Woo Kim , linux-mips@vger.kernel.org, iommu@lists.linux-foundation.org, Stefan Richter X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Fri, Sep 25, 2020 at 12:15:37PM +0100, Robin Murphy wrote: > On 2020-09-15 16:51, Christoph Hellwig wrote: > [...] >> +These APIs allow to allocate pages in the kernel direct mapping that are >> +guaranteed to be DMA addressable. This means that unlike dma_alloc_coherent, >> +virt_to_page can be called on the resulting address, and the resulting > > Nit: if we explicitly describe this as if it's a guarantee that can be > relied upon... > >> +struct page can be used for everything a struct page is suitable for. > > [...] >> +This routine allocates a region of bytes of consistent memory. It >> +returns a pointer to the allocated region (in the processor's virtual address >> +space) or NULL if the allocation failed. The returned memory may or may not >> +be in the kernels direct mapping. Drivers must not call virt_to_page on >> +the returned memory region. > > ...then forbid this document's target audience from relying on it, > something seems off. At the very least it's unhelpfully unclear :/ > > Given patch #17, I suspect that the first paragraph is the one that's no > longer true. Yes. dma_alloc_pages is the replacement for allocations that need the direct mapping. I'll send a patch to document dma_alloc_pages and fixes this up _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu