From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 152DAC433E6 for ; Mon, 8 Feb 2021 16:42:43 +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 C9D3964E8F for ; Mon, 8 Feb 2021 16:42:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9D3964E8F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.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:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=w6yKl3S0yaepV83aE67v3kO95UYcJl6PxCGzr6esW7w=; b=LH/UD2wfanboZ8X6K2eau53E0 buEkW3eQaF3YaLKpKSs6hR/ptiydXQ7acqjIOIYMrY6tVNjkxxORK7kBph8RphMwv5kFTclhchj8j b5WzOGOgJ5n+a/IT0YDAPFtS3vE46V2j0gKr5MQEwxbflJh/Nr//odFGm6nwbcshdrKNsnkjTmvMk Lo7DVUlEd6q4kvvYdXol7LzcnR85hfw2AXr1IC7z3lQGm7om/fjIM33pvWOigVy7IzSJcrZ04JyTn UJuizbT62F7fr6ir0axRVmR3RC8Ii1uD9stvSYKM5FXMHAY4FIrHGtmb/Zc/af9vRR9sN7ehuUD19 uluRczWbQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l99bM-0001sy-T8; Mon, 08 Feb 2021 16:41:28 +0000 Received: from mail.kapsi.fi ([2001:67c:1be8::25]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l99b6-0001jo-LF for linux-arm-kernel@lists.infradead.org; Mon, 08 Feb 2021 16:41:16 +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=0IKu+HkeaJAhgzHU2yYWK31KsEfn8lTKeY9abUb5iks=; b=L0Q1HJ2q5PoVKu51YDHqKbfR3y Aooi809PM+nt5Gnlr2tqz14I232iZhIr6aoCOobYV/hqXznvVqYrhlTD0H8doqAbzCkWuG37anQfr ru6k+wg8GHFCXX2x4CX9U/t5MY3sx9L/M4cX1MK7/+QTQ80mVRUNi9UsUWZM56SPf0h/iYmEmsIO8 8syFpHXtm6/WQ/o+xjn/3dUpDb8acdsDRTSDSbfISbtd0EUMVbgOcDbVfsm0H4SBRpAxatdl2Nyb+ lY6U6mOdxZJ9Z5u2n2l8D2PkJZeo6WzSjDNHMO14KB8mb/+jIlsjwfSyxSaiBSf3/5/8qaU2H0ojv XJui5UVQ==; Received: from dsl-hkibng22-54f986-236.dhcp.inet.fi ([84.249.134.236] helo=toshino.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1l99at-0000Cr-0U; Mon, 08 Feb 2021 18:40:59 +0200 From: Mikko Perttunen To: thierry.reding@gmail.com, jonathanh@nvidia.com, joro@8bytes.org, will@kernel.org, robh+dt@kernel.org, frowand.list@gmail.com, robin.murphy@arm.com Subject: [RFC PATCH 5/8] iommu/arm-smmu: Attach to host1x context device bus Date: Mon, 8 Feb 2021 18:38:45 +0200 Message-Id: <20210208163848.2504291-6-mperttunen@nvidia.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210208163848.2504291-1-mperttunen@nvidia.com> References: <20210208163848.2504291-1-mperttunen@nvidia.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 84.249.134.236 X-SA-Exim-Mail-From: mperttunen@nvidia.com 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-20210208_114113_315685_21E5245D X-CRM114-Status: GOOD ( 12.08 ) 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: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Mikko Perttunen , iommu@lists.linux-foundation.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Set itself as the IOMMU for the host1x context device bus, containing "dummy" devices used for Host1x context isolation. Signed-off-by: Mikko Perttunen --- 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 d8c6bfde6a61..ec746c2a08ae 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -40,6 +40,7 @@ #include #include +#include #include "arm-smmu.h" @@ -2087,8 +2088,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); -- 2.30.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel