Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2948489iob; Mon, 16 May 2022 09:35:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJya8maFgbrqLAlu0QZUlHJRZVwpQr2uYhxg02emX1U+QVNhr3znKbQyh2JSjoDFq7QfK76Y X-Received: by 2002:aa7:c14a:0:b0:42a:9ddd:2019 with SMTP id r10-20020aa7c14a000000b0042a9ddd2019mr11572638edp.43.1652718952936; Mon, 16 May 2022 09:35:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652718952; cv=none; d=google.com; s=arc-20160816; b=eJtPzRJWgucl9A9Sif72/uRaUzrC3//uec9O/smET7qPklmE0pyPoZSZKfa+bl1bJ0 djCExqgi3l/MSmEWhLrmp9nrnMFZ3/M4ud5I0yw+c9D/O9a1NILZxK2WkO2/ZCBHVXw6 PT0UiHZVyjGyIaLK3cPpIu/fesT+lQXPBpyJxd+iVtaoVGQ2Gp4YZCYitld4/9gfR7sh GWooCs9Jg2+3wNur2EI84GGtth2xNPJI6npjL+g7qKwM5rnrais7X1OKtVK++JKjysnV qyIZRtY+n3ncjKdRtdS+xaF2yOGeGGyr8sWmmv7NWTgBS7v8YRbJwucH70LkBu+FIV81 JBYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Vo922W0aHAAexpm1efV+tBqrmfmNUmP8j5ep2MFHXzI=; b=Ekr9HZ7QPT7mzjEacbXzCZgoP+BFtv9dO4hyt3PlzQ8cPgUUBta67XB1WShNGXE6KH DsRcQ1W/e5vz7h453qHPE6lWgfjuT/Xx2JUappX476mI4Ac6ctfqVQ7clr5N4vzF6yov pdMx6RglQCr0iZJFSybHwe7H7UTTF9IFmRpBw0bCYd9Hzq1W7flN7lMQH70e6qby19Jo IvTSlv2YFpJhw9NfFgFhSMdWqNOZeYDwjnrdX2XwLpBw7XMAgADkuyPfTFUQ/Hq/F1fP eXO+HEkfMnJegYUASQM09j4lr6GJcfJxLhVrwbBOto0dzPWcEqZ/eHn3qdVPOfO5yBRL foLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=GzP8u8SF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x3-20020a05640226c300b004239aa67363si9687613edd.191.2022.05.16.09.35.25; Mon, 16 May 2022 09:35:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=GzP8u8SF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242072AbiEPIyT (ORCPT + 99 others); Mon, 16 May 2022 04:54:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242071AbiEPIxm (ORCPT ); Mon, 16 May 2022 04:53:42 -0400 Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D455813F09; Mon, 16 May 2022 01:53:33 -0700 (PDT) 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=Vo922W0aHAAexpm1efV+tBqrmfmNUmP8j5ep2MFHXzI=; b=GzP8u8SF9p0cN4zkGmR4Uz3VPM jIdv3uzyFyE6Pym67J1z6e9vyPoJzoqnPGBmDBhKvQFuT300HrPnt8t4UU/t/HFyFCfuiRpDB+YXL PNO9JC5LRtvq8VvWsY9QDCLR2k1uuRgK/aHyQuvGzO/leLKafHxcTUmp1eJuKAJWQZ/RkahfJ6HHU osVuUhWgQEm6zSenZju134tFWVHc3xtRZdZHCu5PZwvPKIAC7s4HtE4DMUnUjvOpBbYZ6+UIaSgga pgnZVh9uDtAZxcZzbPiw0E99cAtfekO54xmomnba/qVbLBaGTjz/86oYKmYyPi4/QS5UzpWADQOWH i6RGq9cg==; Received: from 91-158-25-70.elisa-laajakaista.fi ([91.158.25.70] helo=toshino.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nqWTe-0005fd-TS; Mon, 16 May 2022 11:53:18 +0300 From: cyndis@kapsi.fi 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 v5 5/9] iommu/arm-smmu: Attach to host1x context device bus Date: Mon, 16 May 2022 11:52:54 +0300 Message-Id: <20220516085258.1227691-6-cyndis@kapsi.fi> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220516085258.1227691-1-cyndis@kapsi.fi> References: <20220516085258.1227691-1-cyndis@kapsi.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- 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 568cce590ccc..9ff54eaecf81 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" @@ -2053,8 +2054,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.36.1