From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Subject: Re: [PATCHv3 01/19] [HACK] of: dev_node has struct device pointer Date: Fri, 01 Nov 2013 15:44:29 -0600 Message-ID: <527420BD.8080600@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> <20131101084909.5ed79987aa3aeb13b14e3f08@nvidia.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20131101084909.5ed79987aa3aeb13b14e3f08-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Hiroshi Doyu Cc: "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Stephen Warren , "rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org" , "linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org" , "thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" , "grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org" List-Id: linux-tegra@vger.kernel.org On 11/01/2013 12:49 AM, Hiroshi Doyu wrote: > 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: > diff --git 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; That sounds reasonable.