Received: by 2002:ac0:8c8e:0:0:0:0:0 with SMTP id r14csp275135ima; Tue, 5 Feb 2019 23:07:00 -0800 (PST) X-Google-Smtp-Source: AHgI3IY5xswGpLTxErhozD5xu1qqVRMGa8a14vUhB1ZIWAUyKI3x8BfUO12eS/iWgxrhzyzIXihH X-Received: by 2002:a17:902:b701:: with SMTP id d1mr8846200pls.124.1549436819988; Tue, 05 Feb 2019 23:06:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549436819; cv=none; d=google.com; s=arc-20160816; b=LWj/mwwYLxbMYzIkfAtaW1Y9acWF+sHx4OhT9fjhWax/Y9RAg0a+tnzKH5IWUppw4Q YV0dkzec0yyV+DG6rgR1azqoevtgpfIg2bUaP32sEs466/rYSGJA0lRAoixBA12UdmcF h+uj9wzcHeMsIN/QkWnQHw3t/dYHPP4I5jYdpHhrQxMa/FP4idBN5d/h1lFu88SS9UG3 cpVlnQ4WfEBimTv1+iY2yX995eG5bw/+P8W3AGW8Gi9ZQ0kWU+8MzAQUeYgLFvWGRBDD W1o6qrcC5KY0WVkRDAwWVazUcSqqaApsxnzok3TZRwr6h/ndH7Op6U506dHLOHHgNM74 kADQ== 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=F9ZzQHMZBUxic58OM3NlTMZ3LpMO5Pb+IbV1ciuvt2E=; b=CrLHaYqp4ZJC9+D0PBaCWzUy2dNJ8fm9iVoEG9v/BUttOj/tH4X69xQsw48DAzIWr5 +GhKPhqdb1IAICFEtD8UZamoXQoG8hhH2i7RRkJv+c9v2P9yjVhZdrnsdYIUfyo5UKPr FiTd8PrYRNDspJKphwY62XNXdrH0zEnbIOXIaTr09uDcpSAiH+dk+ux77JsAjMmyN2mQ dXDplq7IkVp1sdALGI8K77dPZMihPN9rMLsnVbjhR+dsRO+Rct1oIy++xeunbUDja8W7 cFujrlk+VJl3fpw6Q78cCosgjjzxZlgh4c4tzBVHDotd5nFZjWGi8WAP41nzWffWfIYi JhLw== 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 f63si5559696pfg.136.2019.02.05.23.06.44; Tue, 05 Feb 2019 23:06:59 -0800 (PST) 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 S1727866AbfBFG5v (ORCPT + 99 others); Wed, 6 Feb 2019 01:57:51 -0500 Received: from verein.lst.de ([213.95.11.211]:58147 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725897AbfBFG5v (ORCPT ); Wed, 6 Feb 2019 01:57:51 -0500 Received: by newverein.lst.de (Postfix, from userid 2407) id 218227F1C3; Wed, 6 Feb 2019 07:57:50 +0100 (CET) Date: Wed, 6 Feb 2019 07:57:50 +0100 From: Christoph Hellwig To: Thierry Reding Cc: Christoph Hellwig , Marek Szyprowski , Robin Murphy , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dma-direct: Export dma_direct_alloc() and dma_direct_free() Message-ID: <20190206065749.GA23392@lst.de> References: <20190205110602.27717-1-thierry.reding@gmail.com> <20190205161036.GA782@lst.de> <20190205162057.GA29974@ulmo> <20190205163837.GA1222@lst.de> <20190205175611.GA7052@ulmo> <20190205180218.GB2882@lst.de> <20190205222912.GC1372@mithrandir> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190205222912.GC1372@mithrandir> 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 Tue, Feb 05, 2019 at 11:29:12PM +0100, Thierry Reding wrote: > > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/gpu/host1x/cdma.c#n106 > > > > Yes, I think we I can come up with a nicer helper for that. > > One thing I could also try is to remove direct IOMMU API usage at least > from the host1x driver. I think this might work nowadays. > > For Tegra DRM we still need direct IOMMU API usage because we need to be > able to map into an IOMMU domain without knowing the struct device * > that we're mapping for (it could be needed by any of up to four display > controllers). For host1x we always only have one struct device *, so the > DMA mapping API should be good enough. If you can convert it to plain DMA API usage, please do. I did look into an IOMMU API memory allocator, and while we can do it easily for coherent devices, we need some arch hooks for non-coherent device support. With a pending series from me we have those for arm64, but 32-bit arm support will require a lot more work first.