From patchwork Tue Jun 21 15:10:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Perttunen X-Patchwork-Id: 12889377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8B1E5C43334 for ; Tue, 21 Jun 2022 15:13:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=u0c556uhAAPM6eCy0uKofH+UXY0wsW/2GgIPIQevPz4=; b=pdPJJFGStR4lX2 QCAr8huxrScI60vCvMUhz1vSpT+oF38C/oZO8uSmZQ3fMVL/rRZa49upSqvJBlBYzNgmAuTxbFH6x tBcafSaNIje1NMxGVe4ZWaQ8/fcJUribcHD1Vf/TiuVIHugnWacx1psYtOPYuncOYLzhWpcJ5MzvD B9aXUN0tziRdp2QJQxD0nM+Lg0mGwK+59RzLbyBslkrdqVhKjEwOpxreNg31LDbZhP53yW/5QcgUI ml4ClRPrNTBVwJsERuvaZunBm1u5AUglguLiW2FkLvZPdtwqOkvo8eHvn74c4+0hlP3IKh9eRvSqA cTTT8pXCsreT/dOOOXFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3fXy-0063Km-Qo; Tue, 21 Jun 2022 15:12:08 +0000 Received: from mail.kapsi.fi ([2001:67c:1be8::25]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3fWr-0062r4-O6 for linux-arm-kernel@lists.infradead.org; Tue, 21 Jun 2022 15:11:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=tEnOk0m5EknjIwP5Wi5D0MEtwLqTocqed5XbSC4LxPw=; b=LwXMf7kCx1x5kbVqzdYdMTq38K f+cCCGgkMs3+BHcjuFfUe8OUdDVazudyC9arQ/xcBQOI43kSYZStulXJdpyEI9fg8EDHtaZM6PThV KXVQC/bofdmiJZKIntRayin8L0K8j4ZQ0Co+BdgkGV18mr+PfExFqsqroI3lzcnWY9yLWMaqnXtkf nm8IpLWvukhQQLWftyEvFxPH/aaCiYR5c/6/hcFgfGGD3V8iP5wsq0PpzjAaa9Qjo92ZZ5NmLaflA KXsWz48v2qqxXWEyU4D1oO3ti6ZPGEHBbzI46Wkqh3IR+dDBMBJ2I9yDcmac/7xEJNkLmWQrnuqSh IV2oXPuA==; Received: from 91-158-25-70.elisa-laajakaista.fi ([91.158.25.70] helo=toshino.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1o3fWT-00Ea3F-Ib; Tue, 21 Jun 2022 18:10:33 +0300 From: Mikko Perttunen To: thierry.reding@gmail.com, jonathanh@nvidia.com, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, robh+dt@kernel.org, krzysztof.kozlowski@canonical.com Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mikko Perttunen Subject: [PATCH v6 01/10] iommu/arm-smmu: Attach to host1x context device bus Date: Tue, 21 Jun 2022 18:10:13 +0300 Message-Id: <20220621151022.1416300-2-cyndis@kapsi.fi> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220621151022.1416300-1-cyndis@kapsi.fi> References: <20220621151022.1416300-1-cyndis@kapsi.fi> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 91.158.25.70 X-SA-Exim-Mail-From: cyndis@kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220621_081057_929670_E0CAABC8 X-CRM114-Status: GOOD ( 12.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Mikko Perttunen Set itself as the IOMMU for the host1x context device bus, containing "dummy" devices used for Host1x context isolation. Signed-off-by: Mikko Perttunen --- This patch should only be applied if Robin Murphy's IOMMU bus refactoring series doesn't get merged in time. --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index 2ed3594f384e..74c4357f850b 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -39,6 +39,7 @@ #include #include +#include #include "arm-smmu.h" @@ -2056,8 +2057,20 @@ static int arm_smmu_bus_init(struct iommu_ops *ops) goto err_reset_pci_ops; } #endif +#ifdef CONFIG_TEGRA_HOST1X_CONTEXT_BUS + if (!iommu_present(&host1x_context_device_bus_type)) { + err = bus_set_iommu(&host1x_context_device_bus_type, ops); + if (err) + goto err_reset_fsl_mc_ops; + } +#endif + return 0; +err_reset_fsl_mc_ops: __maybe_unused; +#ifdef CONFIG_FSL_MC_BUS + bus_set_iommu(&fsl_mc_bus_type, NULL); +#endif err_reset_pci_ops: __maybe_unused; #ifdef CONFIG_PCI bus_set_iommu(&pci_bus_type, NULL);