From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758006AbcBXIbF (ORCPT ); Wed, 24 Feb 2016 03:31:05 -0500 Received: from hqemgate14.nvidia.com ([216.228.121.143]:6310 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751405AbcBXIbC (ORCPT ); Wed, 24 Feb 2016 03:31:02 -0500 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Wed, 24 Feb 2016 00:29:57 -0800 Subject: Re: [PATCH 1/2] drm/tegra: Set DMA ops To: Thierry Reding References: <1456208754-12362-1-git-send-email-acourbot@nvidia.com> <20160223152815.GD27656@ulmo> CC: =?UTF-8?Q?Terje_Bergstr=c3=b6m?= , Stephen Warren , , , , From: Alexandre Courbot Organization: NVIDIA X-Nvconfidentiality: public Message-ID: <56CD6A3E.4090800@nvidia.com> Date: Wed, 24 Feb 2016 17:30:54 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160223152815.GD27656@ulmo> X-Originating-IP: [10.19.57.128] X-ClientProxiedBy: DRBGMAIL104.nvidia.com (10.18.16.23) To HKMAIL103.nvidia.com (10.18.16.12) Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/24/2016 12:28 AM, Thierry Reding wrote: > * PGP Signed by an unknown key > > On Tue, Feb 23, 2016 at 03:25:53PM +0900, Alexandre Courbot wrote: >> The current settings leaves the DRM device's dma_ops field NULL, which >> makes it use the dummy DMA ops on arm64 and return an error whenever we >> try to import a buffer. Call of_dma_configure() with a NULL node (since >> the device is not spawn from the device tree) so that >> arch_setup_dma_ops() is called and sets the default ioswtlb DMA ops. >> >> Signed-off-by: Alexandre Courbot >> --- >> drivers/gpu/drm/tegra/drm.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c >> index d347188bf8f4..bc0555adecaf 100644 >> --- a/drivers/gpu/drm/tegra/drm.c >> +++ b/drivers/gpu/drm/tegra/drm.c >> @@ -9,6 +9,7 @@ >> >> #include >> #include >> +#include >> >> #include >> #include >> @@ -990,6 +991,7 @@ static int host1x_drm_probe(struct host1x_device *dev) >> return -ENOMEM; >> >> dev_set_drvdata(&dev->dev, drm); >> + of_dma_configure(drm->dev, NULL); > > Looking at the various pieces, I think this really belongs in > host1x_device_add() (see drivers/gpu/host1x/bus.c) where it can replace > the open-coded setting of DMA and coherent DMA masks. Also why can't we > pass the correct device tree node here? The DRM device is a virtual > device that hangs off the host1x device, so I think it could use the > same device tree node as the host1x device. > > Something like the below (untested). You're right, that looks like a much better place to do this. of_dma_configure() is called at the bus level (platform and PCI), so it makes sense to do it from host1x too.