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 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 285DDC433F5 for ; Fri, 22 Apr 2022 19:03:41 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1Xu2JduSORwcZZ1cKDaxhkVIHeX2ADYWDthO570FeI4=; b=S6qc+NuULeFiqO uLVMfyhhmUsfwPOIeP3EcXOp6+WG6ePRRzIm3xrGunQFYvbicv3Xte+i9nXPmu70bJHBBDMJBE801 PSGlz8u4++okNoeYUL6R1hrpj7lyFJX4qLvtAlanUygXcTKo4IX2SIMTI2VS4zw9+cMZAEd7V2b+a 6K/opD4FzM/RvHfTBPEFvXdVNjT42Lp1QuspXXkd1MpShs0728oBirXXW1qyCv4DwiagKwS+87Epy X4m36UN1aIA8Fs6yTW5cCeXe9Z+eoI433ekQydxFp/aw/vc+svyuL+WJExZTzBOohXfBCtTUC8iQA Riuf2zwHfTQpmAlR5NnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhyY1-0024Oo-CC; Fri, 22 Apr 2022 19:02:29 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhyXx-0024Na-IS for linux-arm-kernel@lists.infradead.org; Fri, 22 Apr 2022 19:02:27 +0000 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 3D2B21FB; Fri, 22 Apr 2022 12:02:21 -0700 (PDT) Received: from [10.57.80.98] (unknown [10.57.80.98]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6CDF43F73B; Fri, 22 Apr 2022 12:02:18 -0700 (PDT) Message-ID: <9da468bc-e6fd-1d7c-a6ce-69be87a7472a@arm.com> Date: Fri, 22 Apr 2022 20:02:12 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH 02/13] iommu: Move bus setup to IOMMU device registration Content-Language: en-GB To: Krishna Reddy , "joro@8bytes.org" , "will@kernel.org" Cc: "iommu@lists.linux-foundation.org" , "sven@svenpeter.dev" , "robdclark@gmail.com" , "m.szyprowski@samsung.com" , "baolu.lu@linux.intel.com" , "yong.wu@mediatek.com" , "mjrosato@linux.ibm.com" , "gerald.schaefer@linux.ibm.com" , "zhang.lyra@gmail.com" , "thierry.reding@gmail.com" , "jean-philippe@linaro.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" References: From: Robin Murphy In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220422_120225_710558_9A64DEFD X-CRM114-Status: GOOD ( 14.84 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2022-04-22 19:37, Krishna Reddy wrote: > Good effort to isolate bus config from smmu drivers. > Reviewed-By: Krishna Reddy Thanks! > I have an orthogonal question here. > Can the following code handle the case, where different buses have different type of SMMU instances(like one bus has SMMUv2 and another bus has SMMUv3)? > If it need to handle the above case, can the smmu device bus be matched with specific bus here and ops set only for that bus? Not yet, but that is one of the end goals that this is all working towards. I think the stuff that I've added to the dev branch[1] today should have reached the point where that becomes viable, but I'll need to rig up a system to test it next week. Intermediate solutions aren't worth it because in practice you inevitably end up needing both IOMMU drivers to share the platform "bus" anyway. Cheers, Robin. [1] https://gitlab.arm.com/linux-arm/linux-rm/-/commits/iommu/bus > > >> + for (int i = 0; i < ARRAY_SIZE(iommu_buses); i++) { >> + struct bus_type *bus = iommu_buses[i]; >> + const struct iommu_ops *bus_ops = bus->iommu_ops; >> + int err; >> + >> + WARN_ON(bus_ops && bus_ops != ops); >> + bus->iommu_ops = ops; >> + err = bus_iommu_probe(bus); >> + if (err) { >> + bus_for_each_dev(bus, NULL, iommu, >> remove_iommu_group); >> + bus->iommu_ops = bus_ops; >> + return err; >> + } >> + } > > > -KR _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel