Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1438327ybt; Thu, 25 Jun 2020 06:13:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx87po6ba00mMpuPeVzA9hA6sltWByIgCegbyQPMZDpWR9cZ2uvP+h/6LcPCRiM3W1HPB6o X-Received: by 2002:a50:a1e7:: with SMTP id 94mr31047675edk.165.1593090797703; Thu, 25 Jun 2020 06:13:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593090797; cv=none; d=google.com; s=arc-20160816; b=oDBWypdHeoLKQZz2zkiEXhnePbU43M3SXE2ifynBhRJpkjvG19thEaVwxHtVZeM2Mz m9xkJ0SsPsx9G2iQzGTxXwetqpZCzet57aHIjJ18lQwhoFWcucnu5BW5ROiep1hPZ/Ao /sKSom7wwGneZFOJ2FybdnBPpsqzT/2L1KmiZVLH/sfS8adMnkUwaldCHEXB9TcHh7Fx bu16EjWb+H0uxTGM2RJbeCrqpqoNPicMhWTExcLjeT986uryR8iZcljkbYUeWzv+BD7b 01VYPL8PBgz50CQrtHbj+BvSYS0VIzcQZqYIVkeBmT5g7hb8HGy2XrrRaskfh9F4Ckhu 6MTA== 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=lR0bqwKcrf7+U/1CewU1tWIY0HRU0AYGDdeco6yjW8g=; b=hGui/amzjXhIE434wEn/+B5rr+MSDxDwdKFDisdqbLbLlBsOLUxUYl6IBkPq3Hc5tA d51sy6TciiA3eTb4AMfPRfQkiVbSD5XTO2Vvl2pfP7aMSHJGFjsTRUP/tG981aHm49Ey 6YxcpTrBuY+FCgG7evF5RuUf6JmmWBW7kCDu9bPbnG8RFEhukfn8oUQyyaSaNetdbB3n vIJzaroxPS59ZcpwZKhSDT0NiuLU2lsXla/zxKNXqdB0AtYUCq6DM8FUkxs9aptM7YhU GUFDI6mvPaxy9alJyxeTnEJOJMuMdQPVqzamCRQCnxQfw/qeaT1jTUMB0z3Av1MLl1bH ph7A== 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 cn1si9618226edb.354.2020.06.25.06.12.54; Thu, 25 Jun 2020 06:13:17 -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 S2404905AbgFYNJj (ORCPT + 99 others); Thu, 25 Jun 2020 09:09:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404867AbgFYNIo (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 60EF3C08C5DC for ; Thu, 25 Jun 2020 06:08:44 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 5E1104CB; 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 08/13] iommu/mediatek: Do no use dev->archdata.iommu Date: Thu, 25 Jun 2020 15:08:31 +0200 Message-Id: <20200625130836.1916-9-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 The iommu private pointer is already used in the Mediatek IOMMU v1 driver, so move the dma_iommu_mapping pointer into 'struct mtk_iommu_data' and do not use dev->archdata.iommu anymore. Signed-off-by: Joerg Roedel --- drivers/iommu/mtk_iommu.h | 2 ++ drivers/iommu/mtk_iommu_v1.c | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/mtk_iommu.h b/drivers/iommu/mtk_iommu.h index ea949a324e33..1682406e98dc 100644 --- a/drivers/iommu/mtk_iommu.h +++ b/drivers/iommu/mtk_iommu.h @@ -62,6 +62,8 @@ struct mtk_iommu_data { struct iommu_device iommu; const struct mtk_iommu_plat_data *plat_data; + struct dma_iommu_mapping *mapping; /* For mtk_iommu_v1.c */ + struct list_head list; struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX]; }; diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index c9d79cff4d17..82ddfe9170d4 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -269,7 +269,7 @@ static int mtk_iommu_attach_device(struct iommu_domain *domain, int ret; /* Only allow the domain created internally. */ - mtk_mapping = data->dev->archdata.iommu; + mtk_mapping = data->mapping; if (mtk_mapping->domain != domain) return 0; @@ -369,7 +369,6 @@ static int mtk_iommu_create_mapping(struct device *dev, struct mtk_iommu_data *data; struct platform_device *m4updev; struct dma_iommu_mapping *mtk_mapping; - struct device *m4udev; int ret; if (args->args_count != 1) { @@ -401,8 +400,7 @@ static int mtk_iommu_create_mapping(struct device *dev, return ret; data = dev_iommu_priv_get(dev); - m4udev = data->dev; - mtk_mapping = m4udev->archdata.iommu; + mtk_mapping = data->mapping; if (!mtk_mapping) { /* MTK iommu support 4GB iova address space. */ mtk_mapping = arm_iommu_create_mapping(&platform_bus_type, @@ -410,7 +408,7 @@ static int mtk_iommu_create_mapping(struct device *dev, if (IS_ERR(mtk_mapping)) return PTR_ERR(mtk_mapping); - m4udev->archdata.iommu = mtk_mapping; + data->mapping = mtk_mapping; } return 0; @@ -459,7 +457,7 @@ static void mtk_iommu_probe_finalize(struct device *dev) int err; data = dev_iommu_priv_get(dev); - mtk_mapping = data->dev->archdata.iommu; + mtk_mapping = data->mapping; err = arm_iommu_attach_device(dev, mtk_mapping); if (err) -- 2.27.0