From patchwork Fri Nov 1 06:49:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hiroshi Doyu X-Patchwork-Id: 287708 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 84AE82C03F9 for ; Fri, 1 Nov 2013 17:49:15 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753596Ab3KAGtO (ORCPT ); Fri, 1 Nov 2013 02:49:14 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:7651 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753489Ab3KAGtN (ORCPT ); Fri, 1 Nov 2013 02:49:13 -0400 Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com id ; Thu, 31 Oct 2013 23:49:27 -0700 Received: from hqemhub01.nvidia.com ([172.20.12.94]) by hqnvupgp08.nvidia.com (PGP Universal service); Thu, 31 Oct 2013 23:44:09 -0700 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Thu, 31 Oct 2013 23:44:09 -0700 Received: from HQMAIL105.nvidia.com (172.20.187.12) by hqemhub01.nvidia.com (172.20.150.30) with Microsoft SMTP Server (TLS) id 8.3.327.1; Thu, 31 Oct 2013 23:49:13 -0700 Received: from HQMAIL105.nvidia.com (172.20.187.12) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.712.24; Thu, 31 Oct 2013 23:49:12 -0700 Received: from deemhub02.nvidia.com (10.21.69.138) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.712.24 via Frontend Transport; Thu, 31 Oct 2013 23:49:12 -0700 Received: from oreo (10.21.65.27) by deemhub02.nvidia.com (10.21.69.138) with Microsoft SMTP Server (TLS) id 8.3.327.1; Fri, 1 Nov 2013 07:49:10 +0100 Received: from oreo ([::1]) by oreo with smtp (Exim 4.76) (envelope-from ) id 1Vc8Xd-00009E-MH; Fri, 01 Nov 2013 08:49:09 +0200 Date: Fri, 1 Nov 2013 08:49:09 +0200 From: Hiroshi Doyu To: Stephen Warren CC: "thierry.reding@gmail.com" , "grant.likely@linaro.org" , "joro@8bytes.org" , Stephen Warren , "rob.herring@calxeda.com" , "iommu@lists.linux-foundation.org" , "linux-tegra@vger.kernel.org" , "devicetree@vger.kernel.org" Subject: Re: [PATCHv3 01/19] [HACK] of: dev_node has struct device pointer Message-ID: <20131101084909.5ed79987aa3aeb13b14e3f08@nvidia.com> In-Reply-To: <52729912.9050800@wwwdotorg.org> References: <52718122.9000206@wwwdotorg.org> <20131031.101232.80781047726461143.hdoyu@nvidia.com> <527286CC.9080404@wwwdotorg.org> <20131031.184603.979300613649357798.hdoyu@nvidia.com> <52729912.9050800@wwwdotorg.org> X-Mailer: Sylpheed 3.2.0beta5 (GTK+ 2.24.10; x86_64-pc-linux-gnu) X-NVConfidentiality: public MIME-Version: 1.0 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org On Thu, 31 Oct 2013 18:53:22 +0100 Stephen Warren wrote: ... > We're talking about memory-mapped on-SoC devices here, that generally > only exist inside Tegra SoCs. > > Even ignoring that (i.e. expanding the argument to arbitrary modules), > having drivers that perform bus-master transactions call a function > of_iommu_attach() or similar, which does nothing if the device isn't > behind an IOMMU but otherwise does whatever is required, seems like it > isn't much of an imposition. Where do you expect of_iommu_attach() to be called? I thought something below: Modified drivers/base/dd.c --- To unsubscribe from this list: send the line "unsubscribe linux-tegra" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 35fa368..92ec2e9 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -278,6 +278,10 @@ static int really_probe(struct device *dev, struct device_driver *drv) if (ret) goto probe_failed; + ret = of_iommu_attach(dev); + if (ret) + goto probe_failed; + if (driver_sysfs_add(dev)) { printk(KERN_ERR "%s: driver_sysfs_add(%s) failed\n", __func__, dev_name(dev));