From patchwork Thu Jun 25 13:08:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 11625271 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E421514E3 for ; Thu, 25 Jun 2020 13:11:20 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BC71F20702 for ; Thu, 25 Jun 2020 13:11:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JG3haR50"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="LhcV96gS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC71F20702 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=8bytes.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CxBOryZZGCXnI4Aw7eA+CXTfM1ixyUOfcDOkaqxxKVY=; b=JG3haR50pah2+70RJsVbESDB6l uZ5FZrswR6aygRD8zMT9JKrwWbpDV7XFXrPb2GGizCEe6RcjGVLuosgfMXx3wKu8vnPPztntvoo/q X3038J9G3GKGZTk1OMmrKrvhfeAfAvQG7c28+S8bZsSTYUid4oY44CKgLVROkFhKN0crBZLwdA8Lh +wO4b1kXrXd4tehnG4xfHMj5Qayanrtei/apoR0Ma6Hc5Is7zhH8CjaD6i7ZjGOWafffFdOnzD+72 BrlYFTy+xtQ34rRY2IvJGo9p3tOcB1jchM9Qpxgj4NhJAySKdv1PQ7IguxYBnqq5mEFfbbVw4fLOZ t8s2F43Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1joRdL-0004F1-Mr; Thu, 25 Jun 2020 13:09:39 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1joRck-0003xi-FY for linux-arm-kernel@merlin.infradead.org; Thu, 25 Jun 2020 13:09:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description; bh=eDi2VhdLGWD3m/DCWp4sJUaoMQMDFDZ10xjGGtJAWCU=; b=LhcV96gSR3tImlQjtr/cgsyVwL VhjySSQ5geMTgAF4GXHFA9RsnjEt/H8D7B+R+2YuiS/0YTCYf+8KV+0tdVIXHNECKpKIIJMP2dos6 09OXJ0DKtjAoYzpIgnJdQhIdwuHgbW2h5WPKnKDCmwQvfdm0Ole0EPelz71dAYt1b8RrYCVZTmcW0 +IOFUc3Ygd6amwJwOa++EW6kq7fdqtUEAgjcrUROwAHuTyoyKWr8ImSn0QhFNLFoD1zcYRA1BKBsx Oh6MtGqFP767Xe9AIpM/QEngEtm812Jn4NbvsilGLGhn+bqLYnKsS+urPzmm8fRw6TS6QQFd8HDQS ik+ESyHw==; Received: from 8bytes.org ([81.169.241.247] helo=theia.8bytes.org) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1joRcd-0006vY-JD for linux-arm-kernel@lists.infradead.org; Thu, 25 Jun 2020 13:09:00 +0000 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200625_140856_654660_704B9E1C X-CRM114-Status: GOOD ( 13.86 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [81.169.241.247 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-ia64@vger.kernel.org, Heiko Stuebner , David Airlie , Benjamin Herrenschmidt , Joonas Lahtinen , Thierry Reding , Paul Mackerras , Will Deacon , Marek Szyprowski , Michael Ellerman , Joerg Roedel , x86@kernel.org, Russell King , Catalin Marinas , Fenghua Yu , Joerg Roedel , intel-gfx@lists.freedesktop.org, Jani Nikula , Rodrigo Vivi , Matthias Brugger , linux-arm-kernel@lists.infradead.org, Tony Luck , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Daniel Vetter , David Woodhouse , Lu Baolu MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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); }