From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [RFC 09/10] drm/tegra: Add IOMMU support Date: Fri, 27 Jun 2014 12:54:20 +0200 Message-ID: <4455459.GtiCHWk2CB@wuerfel> References: <1403815790-8548-1-git-send-email-thierry.reding@gmail.com> <1403815790-8548-10-git-send-email-thierry.reding@gmail.com> <20140627124614.050be2e406a4b9a02d9fe97c@nvidia.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: In-Reply-To: <20140627124614.050be2e406a4b9a02d9fe97c-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Cc: Hiroshi DOyu , Thierry Reding , Mark Rutland , Will Deacon , Paul Walmsley , Pawel Moll , Joerg Roedel , Ian Campbell , Marc Zyngier , Dave Martin , Olav Haugan , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Stephen Warren , Grant Grundler , Allen Martin , Rob Herring , "linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Cho KyongHo , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org" , Kumar Gala List-Id: linux-tegra@vger.kernel.org On Friday 27 June 2014 12:46:14 Hiroshi DOyu wrote: > > Thierry Reding writes: > > > From: Thierry Reding > > > > When an IOMMU device is available on the platform bus, allocate an IOMMU > > domain and attach the display controllers to it. The display controllers > > can then scan out non-contiguous buffers by mapping them through the > > IOMMU. > > > > Signed-off-by: Thierry Reding > > --- > > @@ -1283,8 +1284,18 @@ static int tegra_dc_init(struct host1x_client *client) > > { > > struct drm_device *drm = dev_get_drvdata(client->parent); > > struct tegra_dc *dc = host1x_client_to_dc(client); > > + struct tegra_drm *tegra = drm->dev_private; > > int err; > > > > + if (tegra->domain) { > > + err = iommu_attach_device(tegra->domain, dc->dev); > > I wanted to keep device drivers iommu-free with the following: > > http://patchwork.ozlabs.org/patch/354074/ > We definitely need something like your series to make iommus work transparently on ARM for normal devices, using the of_dma_configure() to look up the correct iommu per device and initialize it. However, any devices that work with multiple iommu domains cannot do that and still need to use the iommu API directy. I believe the tegra drm code falls into this category. Arnd