From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752614AbdBJPeB (ORCPT ); Fri, 10 Feb 2017 10:34:01 -0500 Received: from 8bytes.org ([81.169.241.247]:56906 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751639AbdBJPd6 (ORCPT ); Fri, 10 Feb 2017 10:33:58 -0500 Date: Fri, 10 Feb 2017 16:25:53 +0100 From: Joerg Roedel To: Robin Murphy Cc: Will Deacon , Lorenzo Pieralisi , Alex Williamson , David Woodhouse , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Joerg Roedel Subject: Re: [PATCH 07/11] iommu/arm-smmu: Make use of the iommu_register interface Message-ID: <20170210152553.GJ7339@8bytes.org> References: <1486639981-32368-1-git-send-email-joro@8bytes.org> <1486639981-32368-8-git-send-email-joro@8bytes.org> <9bba214f-4d83-1e37-2df8-2f7db11f7d1f@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9bba214f-4d83-1e37-2df8-2f7db11f7d1f@arm.com> 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 On Fri, Feb 10, 2017 at 02:20:34PM +0000, Robin Murphy wrote: > > @@ -1795,8 +1798,10 @@ static int arm_smmu_add_device(struct device *dev) > > } > > > > group = iommu_group_get_for_dev(dev); > > - if (!IS_ERR(group)) > > + if (!IS_ERR(group)) { > > iommu_group_put(group); > > + iommu_device_link(&smmu->iommu, dev); > > Given the coupling evident from this and the other patches, might it > work to simply do the linking/unlinking automatically in > iommu_group_{add,remove}_device()? Yes, this is one of the goals too. But currently we don't have a generic device->hw_iommu mapping in the iommu-code which would allow to call the link/unlink functions in generic code too. But changing this is one of the next things on my list :) Joerg