Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1231409pxk; Fri, 25 Sep 2020 09:21:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6CG4NRMFpiHH0YtvpVlJKdO0FoESXQ9aSGgCRyfbRcV1IySGx1rMfWvrlfXfDCTVfOkum X-Received: by 2002:a17:906:f90c:: with SMTP id lc12mr3466741ejb.104.1601050861092; Fri, 25 Sep 2020 09:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601050861; cv=none; d=google.com; s=arc-20160816; b=Ij3oWGCq2S8P4lSAvIhseKbHsdrtWyQQNNorHt6+F5CyCwdmnMiB633ZZ9zwJAVPGs o4BHBNxsNypaLnSIOYR6ODiaix3QlhBS2MLS5bfvBmN05O7x4od5Cb65XfoNJuCpn04d +vdgCmuEgVbsSOQi/xKoiNdbY3UX5JEtoKgjysUPnCkoahBrx5ViXHmtnmICuFXS8Q26 sLCyW5lyQakeV2Vr0b42xMHhKFbWLpHmt9yJm8Y1PAxjcHAHKuo3WVq+OObckFg2slEV 2ZsjnAOI4Diw1/Hb+GKeWBwQIajp6a0zqMehW7T4oNKjNZWNPFAo7alyf2tzxMLk837N +VbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=eEOqx0DJWn7isMgir2AuosIwdDhYePDV1YKZZ/k4PJc=; b=dBiPxWBz5BPYGyK3n2AlcThVSVIOzw28rvfCJE9GInDhsD8CVCmniC7FIXuaXzSt+O CGIAhA9rYDEghM/Co6o6blEPNr+9PUqzTWkpWGgytySj1UAvGxi79+hTAvcMx3G09uVN Reh0IsOdfBE7MtfHOLq5/nWPVe/4F43pr0jxQzZTKHp0ToqJWVNVCMdXWrI8dJGYsE3N aj8EAIHBknrFW40xqZiY4C4HbnskrtKlMRTP6yG7B47IbhoRvkIo61IjP6UcioNMffz6 WxTNDgTWjsElf1UeL4KkJWd23USgRdI2BlrWGYHAOCHorlyOG42S8MDkpv8oEE3eqviQ EIUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lt3si2110003ejb.687.2020.09.25.09.20.35; Fri, 25 Sep 2020 09:21:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729121AbgIYQSB (ORCPT + 99 others); Fri, 25 Sep 2020 12:18:01 -0400 Received: from verein.lst.de ([213.95.11.211]:56719 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728524AbgIYQSB (ORCPT ); Fri, 25 Sep 2020 12:18:01 -0400 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 Cc: Christoph Hellwig , Mauro Carvalho Chehab , Thomas Bogendoerfer , "James E.J. Bottomley" , Joonyoung Shim , Seung-Woo Kim , Ben Skeggs , Marek Szyprowski , Tomasz Figa , Matt Porter , iommu@lists.linux-foundation.org, alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, linux-parisc@vger.kernel.org, linux-doc@vger.kernel.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, Stefan Richter , netdev@vger.kernel.org, linux1394-devel@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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