Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2534912ybg; Thu, 24 Oct 2019 11:09:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzswBtwjGi9BtsSa5iXitcohuIStjvFhNyitZkDLfdoOqwRCM8R6GsPOIIlJ0F7jmOiCzDE X-Received: by 2002:a50:cc43:: with SMTP id n3mr45782788edi.287.1571940570264; Thu, 24 Oct 2019 11:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571940570; cv=none; d=google.com; s=arc-20160816; b=i9xd0AmasSNzSkDkJjcjDSvV0sK6OQ+DLciUD9zO/T8r7tNKTy0pvOAwkrqcMKfjm8 DHoy1GjRN4QhYDgJALHoyQjBVrLwxgzlFYTFUcE4XE43FnAMi5zy3Ibg6k8LG3J5tzoe kkZS5mDNgzkiCjn10u2lq1bVrLi/DseOZRT03dIWfn+P+52ykcspWZELCu+DIdxp0R/5 FqHeSx1Swvs0EWS5nNNhFtj+9dFtdWSmpdszd/FKmRhSciWZQjPQqmFSxY3ibVc4EH/7 dMl+oYNMvjDludPueAolK+J1DKEEdeV/PnDivEvEufX3o5AgC8ub6jXDtpCmnbn0ckow 04yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=t/5OpFZLH5xBoyqBs8r/NrDy8KA9KfJuDJVXsExyMcs=; b=OHSfDkgro0z7sf446rZrkZVQwOj7KsUPg1p0H1uj2/wnA751wSYaiXf/F634y9DuYf lHYBjHEWfQ4gQYFYHip44yBqr78fnw+4On/Eq/d3CrJ5h5Xp+hDIwOuz29ugH67qhuPA 5tfu4mYI26P2wxlRqx+zzxy/v12veLNdJJ8tfFLOCQT5oQZxUw2sdiAj23W0Q947WEiw Y4vh5fQyldIUVH8Up96GFquMVEHLBtj/zPeiN3ZqcJ254qHQh9ha4qpN/J8ln8o+qmRE IXptw7pLSDgCaDCXd1tmUhKlodxLwS+/XsBBsMhc/sG6ubtUnwLFvSKxSyicwYEAtVUz Hf3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g31si9354534edg.206.2019.10.24.11.09.06; Thu, 24 Oct 2019 11:09:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408150AbfJXCBn (ORCPT + 99 others); Wed, 23 Oct 2019 22:01:43 -0400 Received: from verein.lst.de ([213.95.11.211]:43182 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408092AbfJXCBm (ORCPT ); Wed, 23 Oct 2019 22:01:42 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 3BD0B68BE1; Thu, 24 Oct 2019 04:01:40 +0200 (CEST) Date: Thu, 24 Oct 2019 04:01:40 +0200 From: "hch@lst.de" To: Laurentiu Tudor Cc: Robin Murphy , "hch@lst.de" , "joro@8bytes.org" , Ioana Ciocoi Radulescu , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "netdev@vger.kernel.org" , Ioana Ciornei , Leo Li , Diana Madalina Craciun , "davem@davemloft.net" , Madalin-cristian Bucur Subject: Re: [RFC PATCH 1/3] dma-mapping: introduce a new dma api dma_addr_to_phys_addr() Message-ID: <20191024020140.GA6057@lst.de> References: <20191022125502.12495-1-laurentiu.tudor@nxp.com> <20191022125502.12495-2-laurentiu.tudor@nxp.com> <62561dca-cdd7-fe01-a0c3-7b5971c96e7e@arm.com> <50a42575-02b2-c558-0609-90e2ad3f515b@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50a42575-02b2-c558-0609-90e2ad3f515b@nxp.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 23, 2019 at 11:53:41AM +0000, Laurentiu Tudor wrote: > We had an internal discussion over these points you are raising and > Madalin (cc-ed) came up with another idea: instead of adding this prone > to misuse api how about experimenting with a new dma unmap and dma sync > variants that would return the physical address by calling the newly > introduced dma map op. Something along these lines: > * phys_addr_t dma_unmap_page_ret_phys(...) > * phys_addr_t dma_unmap_single_ret_phys(...) > * phys_addr_t dma_sync_single_for_cpu_ret_phys(...) > I'm thinking that this proposal should reduce the risks opened by the > initial variant. > Please let me know what you think. I'm not sure what the ret is supposed to mean, but I generally like that idea better. We also need to make sure there is an easy way to figure out if these APIs are available, as they generally aren't for any non-IOMMU API IOMMU drivers.