Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1021377pxk; Fri, 25 Sep 2020 04:17:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxM7kaqC4dq++k1HUH2eP9Hxi69UyRKVc553m5vCzaUOnXaqNXxkwf2xmLY2/F02CA4kwoz X-Received: by 2002:a50:cfc5:: with SMTP id i5mr700367edk.151.1601032633556; Fri, 25 Sep 2020 04:17:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601032633; cv=none; d=google.com; s=arc-20160816; b=tQNbEwUCpqOhlK6+m9zvj7CAPQQONVFHFslbf+TmhECP+Hkkcxwvzyou+SaepRi4gn jzKrRxXITi5ssV7v6YVKFkbmpmAxO9XtT2GvNHItkKk7kNDPozAggEx0h6qobsMTZ5LL FAvEfnuV1GVmF6zFJU76VffJbleyH74WcOEWC0j32M/JaGgOT7BGWQfNd3Vgr8zapSBc qCOIixkPMmzfJTZdXlXdE9QHo6Ejynrh9fPSTe+mFgxfS0t939JHnvZtGmowTiG2zkNY 0chY8kDEK3qb2avv6O+U0pqWxkNMSBJM7oT8wT/5OqYFXr0+qBOFG5o5ILMihD51eYGT Y3tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=Rf6O5RaQkJBkPfgcJWor4U3YcqA3IS3UFJB+G/GWQi0=; b=SC/5mvnOa1lY+VyW6uQHSJMLyL5gIldPUxT/wxR8XXeMeWhlnkGfT5404bwEF+rbe6 cC1RK7ClRv+47C3Qj+vw2+qT2WEq0ih79XC5D0+5Eu7q8sgCCJwC3CFqsgBJ3DlVCKzx rGZRTwsFhu9mgvv2y/362d8EC2qIAz6ETskbnPaXU7n+jEYVoDq623wcBzrrw17KOG+e yOVLZ2DzIIEHbOG5nd/+9oW+KmhKYouWA5zIDYYX6YirAonCqsJsz9BE60dnNz++8S5d 2mVmUyryeSVXcdPgsg+7OhDXATwe9jeCmuhUeGabhcSJvAWHhLoKS6l40Dta9NBB2KE/ QH5A== 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 a1si1581803ejk.68.2020.09.25.04.16.49; Fri, 25 Sep 2020 04:17:13 -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 S1728069AbgIYLPn (ORCPT + 99 others); Fri, 25 Sep 2020 07:15:43 -0400 Received: from foss.arm.com ([217.140.110.172]:42402 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727132AbgIYLPn (ORCPT ); Fri, 25 Sep 2020 07:15:43 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 34B1D101E; Fri, 25 Sep 2020 04:15:42 -0700 (PDT) Received: from [10.57.48.76] (unknown [10.57.48.76]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 986323F70D; Fri, 25 Sep 2020 04:15:38 -0700 (PDT) Subject: Re: [PATCH 08/18] dma-mapping: add a new dma_alloc_noncoherent API To: 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 Cc: 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 References: <20200915155122.1768241-1-hch@lst.de> <20200915155122.1768241-9-hch@lst.de> From: Robin Murphy Message-ID: Date: Fri, 25 Sep 2020 12:15:37 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.2.2 MIME-Version: 1.0 In-Reply-To: <20200915155122.1768241-9-hch@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Robin.