Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755611AbdDGOff (ORCPT ); Fri, 7 Apr 2017 10:35:35 -0400 Received: from 8bytes.org ([81.169.241.247]:48940 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756384AbdDGOfW (ORCPT ); Fri, 7 Apr 2017 10:35:22 -0400 Date: Fri, 7 Apr 2017 16:35:20 +0200 From: Joerg Roedel To: Suman Anna Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Joerg Roedel Subject: Re: [PATCH 2/5] iommu/omap: Permanently keep iommu_dev pointer in arch_data Message-ID: <20170407143520.GB7266@8bytes.org> References: <1490962248-12602-1-git-send-email-joro@8bytes.org> <1490962248-12602-3-git-send-email-joro@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 949 Lines: 26 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