Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1436909ybt; Thu, 25 Jun 2020 06:11:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4kFxeCyzmcuT/zBWgu/oam8s7OiiOVRQWx9jN0PJ0rrBeQmfXJHSUDTPpkvC4tKMJuNdm X-Received: by 2002:a17:906:95d6:: with SMTP id n22mr29482497ejy.138.1593090698443; Thu, 25 Jun 2020 06:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593090698; cv=none; d=google.com; s=arc-20160816; b=wDx44ZXvgFEf4hFaAkCqYR10WAAFltsVjPAi5zMEMGacOr66UOPBD7QhBUZNFJ0cE5 cm1Gh1XmzaomdnQfPnFlGGy82A7Md+6seu+ha7Q8w6UQtBgzqAta/lMups2k0qK6fv3S 4an9dc1JSLRbgsxi5Lpo29nOGsGZwDhmDDVoBl+8GZ7A2f7+KE/M3uXzrfJWSflqmA9M FyOVoHLAweFN4u2xEFNEFhESyYlUWrKH/ufpJUy73vWpeV57Y5vSQu/f0+PgTUjx/FUS Ygt2zyv2cngsfFfED0gERx5EVIRlfZjBD2leZXgEp5/c8Rk+Fm6Z1QC0F7qUjCSqwzzg e/eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=eDi2VhdLGWD3m/DCWp4sJUaoMQMDFDZ10xjGGtJAWCU=; b=V+gmI23vFxgcZ+yyYRT4mCqEVkpn1HRbpPriwkusMjsfvLtvG7zOmHYvtBV9fjpacB 9cnsAVAkHd42DLRFDRs/qh1rs65pv1XHZbhIyZKeXt8M0Tkd0e23DIB++i0qPhEgq8J4 fkPUV6o9iVw11J1/1ZqF2ZHfTH8kVJuk5K1ku7oFUhiWajtwbMnaytR1mPMhbKAopEWA PBdORwPj+eFiu3tQsPnj45EcPxVfSxfYRhWGHah3bN35o/SbLppEZO6mm/p2cg42RC/c JpY+WoLhXIVr9wDBZLZHaW23IE87iSN/APwt9iSscIw0EEa3Zy5ut2H/HdWeksAZhHmK P91w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i1si474777edi.240.2020.06.25.06.11.13; Thu, 25 Jun 2020 06:11:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404914AbgFYNIx (ORCPT + 99 others); Thu, 25 Jun 2020 09:08:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404864AbgFYNIo (ORCPT ); Thu, 25 Jun 2020 09:08:44 -0400 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22649C08C5DB for ; Thu, 25 Jun 2020 06:08:44 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 2FD2B4C4; Thu, 25 Jun 2020 15:08:39 +0200 (CEST) From: Joerg Roedel To: iommu@lists.linux-foundation.org Cc: Russell King , Catalin Marinas , Will Deacon , Tony Luck , Fenghua Yu , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , x86@kernel.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Marek Szyprowski , Joerg Roedel , David Woodhouse , Lu Baolu , Matthias Brugger , Heiko Stuebner , Thierry Reding , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, intel-gfx@lists.freedesktop.org, Joerg Roedel Subject: [PATCH 07/13] iommu/pamu: Use dev_iommu_priv_get/set() Date: Thu, 25 Jun 2020 15:08:30 +0200 Message-Id: <20200625130836.1916-8-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200625130836.1916-1-joro@8bytes.org> References: <20200625130836.1916-1-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joerg Roedel Remove the use of dev->archdata.iommu_domain and use the private per-device pointer provided by IOMMU core code instead. Signed-off-by: Joerg Roedel --- drivers/iommu/fsl_pamu_domain.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index 928d37771ece..b2110767caf4 100644 --- a/drivers/iommu/fsl_pamu_domain.c +++ b/drivers/iommu/fsl_pamu_domain.c @@ -323,7 +323,7 @@ static void remove_device_ref(struct device_domain_info *info, u32 win_cnt) pamu_disable_liodn(info->liodn); spin_unlock_irqrestore(&iommu_lock, flags); spin_lock_irqsave(&device_domain_lock, flags); - info->dev->archdata.iommu_domain = NULL; + dev_iommu_priv_set(info->dev, NULL); kmem_cache_free(iommu_devinfo_cache, info); spin_unlock_irqrestore(&device_domain_lock, flags); } @@ -352,7 +352,7 @@ static void attach_device(struct fsl_dma_domain *dma_domain, int liodn, struct d * Check here if the device is already attached to domain or not. * If the device is already attached to a domain detach it. */ - old_domain_info = dev->archdata.iommu_domain; + old_domain_info = dev_iommu_priv_get(dev); if (old_domain_info && old_domain_info->domain != dma_domain) { spin_unlock_irqrestore(&device_domain_lock, flags); detach_device(dev, old_domain_info->domain); @@ -371,8 +371,8 @@ static void attach_device(struct fsl_dma_domain *dma_domain, int liodn, struct d * the info for the first LIODN as all * LIODNs share the same domain */ - if (!dev->archdata.iommu_domain) - dev->archdata.iommu_domain = info; + if (!dev_iommu_priv_get(dev)) + dev_iommu_priv_set(dev, info); spin_unlock_irqrestore(&device_domain_lock, flags); } -- 2.27.0