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=-20.5 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,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=unavailable 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 EA988C433DB for ; Fri, 29 Jan 2021 01:54:28 +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 760B464DF1 for ; Fri, 29 Jan 2021 01:54:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 760B464DF1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.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:Date:To:From: Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1oWibBUvZY9uQRod7eZ1SsPq9zL5wGJD9qAsac911uQ=; b=Uz9XqYRjFVLz9lSYEchQvP7bR k4rdkmgYFDGlihSE6cXEIRRWZE6lzHvQb/M3W6KZIXGVTUVM6GRILRbWnNLw5zaW+h6sUp0dPyPBT vC0O/LmP1eYhqqmKoFhVs+bXvEE9QEy++iFHjyTGP1QEqWYLKFOgQzwDqxllYcHc6sOJx0sI3u0+N nFVq5QfW1gBENOoAcgFE3Yp00XJNyVHF+NSTH6BP08tAhQNZxvfpxEyEld3UAvsYlVpSNIGVSpTL4 MgKcknwr6+/8omGSVkb6kZmKfp8qAlFES4a1viHkxCxgWkiciX9/ABCHP+m/QCKj1Rt8SZ5OBHiBY iJbrE0qsw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l5Iy3-0002Pp-Sv; Fri, 29 Jan 2021 01:52:59 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l5Ixy-0002OR-VA; Fri, 29 Jan 2021 01:52:56 +0000 X-UUID: 245d6c360f834635ad7e0722a1ddd6fa-20210128 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=fdRmt55p+MQD3S1Cu81aNjjrFDffurU5HWdEwTLBEdQ=; b=P2dBk1xhxdAuw0p8msPEn/u4j9Z18pkgL/R9C/hu+toA6KHci5roQo0j/1jvtkxhw8PdSaERh0SK2FI0+ko0Ew7IkwTCtug210fmN4mZ0Uk6UhPXzXng+riN0xXvJLSfZ03t380O4WoDTPADfd8Sgc7BRxWB8+scZLsfzBoMgIQ=; X-UUID: 245d6c360f834635ad7e0722a1ddd6fa-20210128 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 393215045; Thu, 28 Jan 2021 17:52:47 -0800 Received: from MTKMBS31N1.mediatek.inc (172.27.4.69) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 28 Jan 2021 17:52:45 -0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 29 Jan 2021 09:52:42 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 29 Jan 2021 09:52:41 +0800 Message-ID: <1611885162.5302.19.camel@mhfsdcap03> Subject: Re: [PATCH v6 07/33] iommu: Avoid reallocate default domain for a group From: Yong Wu To: Will Deacon Date: Fri, 29 Jan 2021 09:52:42 +0800 In-Reply-To: <20210128211442.GB3531@willie-the-truck> References: <20210111111914.22211-1-yong.wu@mediatek.com> <20210111111914.22211-8-yong.wu@mediatek.com> <20210126222305.GB30460@willie-the-truck> <1611740356.5302.14.camel@mhfsdcap03> <20210128211020.GA3531@willie-the-truck> <20210128211442.GB3531@willie-the-truck> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: C7FA721F47A35587783A8CC9CE434783D2147DE2CF3728D62F7C900CF55A2C7A2000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210128_205255_216190_1F4BC22B X-CRM114-Status: GOOD ( 33.41 ) 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: youlin.pei@mediatek.com, devicetree@vger.kernel.org, Nicolas Boichat , srv_heupstream@mediatek.com, chao.hao@mediatek.com, Joerg Roedel , linux-kernel@vger.kernel.org, Evan Green , Tomasz Figa , iommu@lists.linux-foundation.org, Rob Herring , linux-mediatek@lists.infradead.org, Krzysztof Kozlowski , Matthias Brugger , anan.sun@mediatek.com, Robin Murphy , 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, 2021-01-28 at 21:14 +0000, Will Deacon wrote: > On Thu, Jan 28, 2021 at 09:10:20PM +0000, Will Deacon wrote: > > On Wed, Jan 27, 2021 at 05:39:16PM +0800, Yong Wu wrote: > > > On Tue, 2021-01-26 at 22:23 +0000, Will Deacon wrote: > > > > On Mon, Jan 11, 2021 at 07:18:48PM +0800, Yong Wu wrote: > > > > > If group->default_domain exists, avoid reallocate it. > > > > > > > > > > In some iommu drivers, there may be several devices share a group. Avoid > > > > > realloc the default domain for this case. > > > > > > > > > > Signed-off-by: Yong Wu > > > > > --- > > > > > drivers/iommu/iommu.c | 3 ++- > > > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > > > > > diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c > > > > > index 3d099a31ddca..f4b87e6abe80 100644 > > > > > --- a/drivers/iommu/iommu.c > > > > > +++ b/drivers/iommu/iommu.c > > > > > @@ -266,7 +266,8 @@ int iommu_probe_device(struct device *dev) > > > > > * support default domains, so the return value is not yet > > > > > * checked. > > > > > */ > > > > > - iommu_alloc_default_domain(group, dev); > > > > > + if (!group->default_domain) > > > > > + iommu_alloc_default_domain(group, dev); > > > > > > > > I don't really get what this achieves, since iommu_alloc_default_domain() > > > > looks like this: > > > > > > > > static int iommu_alloc_default_domain(struct iommu_group *group, > > > > struct device *dev) > > > > { > > > > unsigned int type; > > > > > > > > if (group->default_domain) > > > > return 0; > > > > > > > > ... > > > > > > > > in which case, it should be fine? > > > > > > oh. sorry, I overlooked this. the current code is enough. > > > I will remove this patch. and send the next version in this week. > > > Thanks very much. > > > > Actually, looking at this again, if we're dropping this patch and patch 6 > > just needs the kfree() moving about, then there's no need to repost. The > > issue that Robin and Paul are discussing can be handled separately. > > Argh, except that this version of the patches doesn't apply :) > > So after all that, please go ahead and post a v7 ASAP based on this branch: > > https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/log/?h=for-joerg/mtk After confirm with Tomasz, He still need some time to take a look at v6. thus I need wait some time to send v7 after his feedback. Thanks for your comment. and Thanks Tomasz for the review. > > Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel