Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3081791iob; Mon, 16 May 2022 12:40:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5dG75d8te2KHWqXF01ihAmbrmKLtklX2UZqPRftU3yCEMj30yAMRXINps3q0W+8c0arBL X-Received: by 2002:a17:907:94cf:b0:6f5:942:5db7 with SMTP id dn15-20020a17090794cf00b006f509425db7mr16835392ejc.625.1652730014257; Mon, 16 May 2022 12:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652730014; cv=none; d=google.com; s=arc-20160816; b=RQ23ZBeYs1+F3Q8BA99vSfJm/UeNqwesE8JjrUMp9YtrQPOVQD23lG3mS4d/vzkZR0 35/OMOAv5ZJiVriJyttZelemWRYAegePXuTK5kHBai4MkaNG26l7Irtsckn5LybRb4Wz 1t7oULWzD0urCPbt61ayaiSCi91eK1UB6ihCDRcSVx4P4ugo8dr2RQBzqlbNgZXCEJr6 QF+RZz6smQzBikv6kj/YNySwWki3WV6N3939kkG9igJrxM7clleF6ZDFsm/mqfN5rPKD ZoyKP/yePLP/SaqK1xUeUcQPzqjPxA+ubTDzXR4v105KGxJUE2PFpwKxft8SMoLBqPbO 0E4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=R5AiBlr9NIsN9ihsMxuwoDBJ3enRXEUjzO/I4XwxeNM=; b=TKX2g1WWeGZov1ar56NWhj3nS8HckwFakygRvdwD4XkCbbZvEBCFhnkIk18uja3fJs rvT8UP0iXkfQB+hoy2rG0g8nAuWEYMqvSBtXN34x+YvReiheuZUqbGEzwLQwsCjwxlUX bZLnQ15VmURlUudk1WNI291qjsPwes9v3P+mHzbfF3iGm5DiPn9ujKYiqXsRRQ5nogTI ubgn1KJT2Y9mYr+GowzWNdDNZmSy+2349n+4RXxRV5hww1tomKmdDbI/ndwHN/RwfTgh 838QC0+6J0v3w9jdLujnX2ppfQGJEkWA1v3L8/Nw4Ulc8v1y2flanA/Zl1jV0qhYW/GB yMAg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u5-20020a50eac5000000b00418ee342277si10831132edp.489.2022.05.16.12.39.48; Mon, 16 May 2022 12:40:14 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237782AbiEPKpK (ORCPT + 99 others); Mon, 16 May 2022 06:45:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239787AbiEPKow (ORCPT ); Mon, 16 May 2022 06:44:52 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3849C24947; Mon, 16 May 2022 03:44:49 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DC6CC1063; Mon, 16 May 2022 03:44:48 -0700 (PDT) Received: from [10.57.82.175] (unknown [10.57.82.175]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 849D83F66F; Mon, 16 May 2022 03:44:46 -0700 (PDT) Message-ID: <099cf0f9-5c27-0247-7c5e-6704a9527b11@arm.com> Date: Mon, 16 May 2022 11:44:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v5 5/9] iommu/arm-smmu: Attach to host1x context device bus Content-Language: en-GB To: Mikko Perttunen , Will Deacon Cc: thierry.reding@gmail.com, jonathanh@nvidia.com, joro@8bytes.org, robh+dt@kernel.org, krzysztof.kozlowski@canonical.com, 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 References: <20220516085258.1227691-1-cyndis@kapsi.fi> <20220516085258.1227691-6-cyndis@kapsi.fi> <20220516100721.GA1927@willie-the-truck> <4a170997-c893-1788-dcaa-8ed2193146ae@kapsi.fi> From: Robin Murphy In-Reply-To: <4a170997-c893-1788-dcaa-8ed2193146ae@kapsi.fi> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,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 On 2022-05-16 11:13, Mikko Perttunen wrote: > On 5/16/22 13:07, Will Deacon wrote: >> On Mon, May 16, 2022 at 11:52:54AM +0300, cyndis@kapsi.fi wrote: >>> 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 >> >> bus_set_iommu() is going away: >> >> https://lore.kernel.org/r/cover.1650890638.git.robin.murphy@arm.com >> >> Will > > Thanks for the heads-up. Robin had pointed out that this work was > ongoing but I hadn't seen the patches yet. I'll look into it. Although that *is* currently blocked on the mystery intel-iommu problem that I can't reproduce... If this series is ready to land right now for 5.19 then in principle that might be the easiest option overall. Hopefully at least patch #2 could sneak in so that the compile-time dependencies are ready for me to roll up host1x into the next rebase of "iommu: Always register bus notifiers". Cheers, Robin.