Path: csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod From: Joerg Roedel Newsgroups: linux.kernel Subject: Re: [PATCH 2/5] iommu/omap: Permanently keep iommu_dev pointer in arch_data Date: Fri, 07 Apr 2017 16:40:02 +0200 Message-ID: References: Dkim-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1491575720; bh=AszCIFGl2mHUIp9iyhpjcTkOwzgOfV9/W3z8G3GyE/c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FfUJj0KABGidehCPx3nN4XOF/JR2ylISsui2JaddZu8KHdHITWQhMmPHHeKlXEJz2 6T9DlFHqWO0VuZnE5xxIDMbhW45hZsF/hH2z3lz7yxNGmrUg+IjjDdEUAKsmi7EU/9 ogrukt5tFn/GniprwPQ59GRgQUk9oerqHybqcWgXB8J74jjlSkmTsZkTS/+iCWJwPq RKi1G+PKULJurqc231w//1S6Pf3HGhsgO8ScKg9nQf/OaidE45zBGSs0Ha34ItbXKL nGmb6vVOxvngYBzADSXXsGRCTnvEqMd2m9EQHeJSqryKE6Ttl2TzNXhzFKb8oXGIet wlmPEgZDxtmIA== MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 26 Organization: linux.* mail to news gateway X-Original-Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Joerg Roedel X-Original-Date: Fri, 7 Apr 2017 16:35:20 +0200 X-Original-Message-ID: <20170407143520.GB7266@8bytes.org> X-Original-References: <1490962248-12602-1-git-send-email-joro@8bytes.org> <1490962248-12602-3-git-send-email-joro@8bytes.org> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1618859 Hi Suman, On Mon, Apr 03, 2017 at 03:35:46PM -0500, Suman Anna wrote: > > + iommu = platform_get_drvdata(pdev); > > + if (!iommu) { > > + of_node_put(np); > > + return -EINVAL; > > + } > > This change is causing the issues. OMAP IOMMU driver is not probed yet, > but this gets called during the driver's init function in > bus_set_iommu() and bus's iommu_ops gets set to NULL. The add_device > today is used to add the linking to an IOMMU device (currently name > primarily to support the legacy non-DT mode which is no longer an issue, > but a dev pointer can be used instead here, and the real enabling is > done during the domain's attach_dev callback. Yeah, okay. Solving this problem requires more sophisticated handling in the iommu core code, which is not implemented yet. I drop this patch for now and do the device-linking and group-handling in attach_dev. This makes iommu-groups on omap useless for now, but it is a start. Joerg