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=-15.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 4D7ACC433E0 for ; Thu, 7 Jan 2021 13:04:57 +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 E851122D01 for ; Thu, 7 Jan 2021 13:04:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E851122D01 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wfB7rGobaDWgRGIy7CELspyeaPoNRVabG7cbHzNuElI=; b=3Q3D+iwajK1OjRmD7hrM1r2gG 9hFxDXY4nQ5ZozYhc6V8LJDjIo0J3rkTi2jU4JJW4nwHAXDL0a9SKZPOhVA//WYVSby+YbNflhyoN J9O/Rqz9TALhEiBUrTDZdcmtaDDga/yddgLRzYEuGtJbEdMjJQVEdwi5OZ8IOkz+TxRCEH0IZFtbs AASpaDccTL9bw+eTtu2XubrWPQFFq7n+sVGUYCys3Cj4NTfEgnsPsbfSzT+dm/MmoBWpWN8NSr9FB KgGUbmqeSBbV7PzLTx3fwJ2psaLYoamQgswBP+MLA16eh4ier88gdcIo0xlWoLqYYDSzLpUU8D8oa 1iD5Uq+tw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxUwq-0008LO-5W; Thu, 07 Jan 2021 13:03:28 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxUwo-0008Kq-0f for linux-arm-kernel@lists.infradead.org; Thu, 07 Jan 2021 13:03:26 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 12F6722D01; Thu, 7 Jan 2021 13:03:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610024604; bh=GfXmkqoELy/f9VuG/jwzCEOi96GnRIiD/hBd6Kv7aZs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aNhNwduW7Bg+R6qpPnF4Fq0VsiF2LfWeRBt+esJh1uVeUagrdZBEELfG85NXoiz0z thcm7Ygu/Xfdsrw/wLEiIDnrzqFSwb3Y1xwcARMmlx7eNboKJfDRgxZZwsGp1OIH6A kE6gmllZqZB1mUNkDOJ6yd3o1EmsL0HANMbACyuIHcD8kgeLC0Qjxc9A99fFdw2fsw pOePow6JWtEW5zFXk/zv4Ru4zlnF01wtWh4S/kJovjk4xpYd4vfD13Jspe4kTMsCez FTazW/3YzmYXr+9M+7rONP3e/w9T9esoC6PhhM14U1hNOXizdjVRVY067qQnzs7axF aHWn0xT9+JCiA== Date: Thu, 7 Jan 2021 13:03:19 +0000 From: Will Deacon To: Ajay Kumar Subject: Re: [PATCH] iommu/arm-smmu-v3: Handle duplicated Stream IDs from other masters Message-ID: <20210107130319.GA2986@willie-the-truck> References: <20210107093340.15279-1-ajaykumar.rs@samsung.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210107093340.15279-1-ajaykumar.rs@samsung.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210107_080326_249086_7913EFAB X-CRM114-Status: GOOD ( 16.92 ) 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: mark.rutland@arm.com, joro@8bytes.org, john.garry@huawei.com, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, robh+dt@kernel.org, robin.murphy@arm.com, 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 On Thu, Jan 07, 2021 at 03:03:40PM +0530, Ajay Kumar wrote: > When PCI function drivers(ex:pci-endpoint-test) are probed for already > initialized PCIe-RC(Root Complex), and PCIe-RC is already bound to SMMU, > then we encounter a situation where the function driver tries to attach > itself to the smmu with the same stream-id as PCIe-RC and re-initialize > an already initialized STE. This causes ste_live BUG_ON() in the driver. I don't understand why the endpoint is using the same stream ID as the root complex in this case. Why is that? Is the grouping logic not working properly? > There is an already existing check in the driver to manage duplicated ids > if duplicated ids are added in same master device, but there can be > scenarios like above where we need to extend the check for other masters > using the same stream-id. > > Signed-off-by: Ajay Kumar > --- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 33 +++++++++++++++++++++ > 1 file changed, 33 insertions(+) It doesn't feel like the driver is the right place to fix this, as the same issue could surely occur for other IOMMUs too, right? In which case, I think we should avoid getting into the situation where different groups have overlapping stream IDs. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel