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 smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 215C5C43334 for ; Fri, 24 Jun 2022 01:36:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 9B85684814; Fri, 24 Jun 2022 01:36:08 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 9B85684814 Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=HWaJIDff X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jquDmjQfYvAU; Fri, 24 Jun 2022 01:36:07 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id 4BC798480B; Fri, 24 Jun 2022 01:36:07 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 4BC798480B Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1ECCCC0039; Fri, 24 Jun 2022 01:36:07 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id F402BC002D; Fri, 24 Jun 2022 01:36:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id C7D1D40510; Fri, 24 Jun 2022 01:36:05 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org C7D1D40510 Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=HWaJIDff X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QQCK7fERBppJ; Fri, 24 Jun 2022 01:36:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 726A140441 X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by smtp2.osuosl.org (Postfix) with ESMTPS id 726A140441; Fri, 24 Jun 2022 01:36:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656034564; x=1687570564; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=gyA97i97HwL5wq54DYwFbjfmzziuSTurfIWHXSjG3gU=; b=HWaJIDffCgb4a3soh172RjZOViB78M6HaiKDdRyEdvGtxTbC4JLTJipw Bf3IJfPK28k+D+zUkx3Q2+t1o7NOKnj49LHWmvnq7Vgj4de062ygVnxkR HPoORJ5dTc3q27Szw8huwjQCp/AIoS4i+QGiP5WrX5Kn3/SVaUO5dJLzl uAzQyUsC2TgiqfJ9UeipPAwZpUXtrLiW/gphEjRAWED1GcCaY1d4LylX6 3V8CJ23qtxEmvRzp2cfyxYIFrhYR6umaT01mGZ3wVCTtjc6n10NOtwSYH x/I9EjLehQFJox+ao6t3RQyFhdYXHAoCRr8ZAo+3gPOnC72Jrbpq9fJYm A==; X-IronPort-AV: E=McAfee;i="6400,9594,10387"; a="260710091" X-IronPort-AV: E=Sophos;i="5.92,217,1650956400"; d="scan'208";a="260710091" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2022 18:35:59 -0700 X-IronPort-AV: E=Sophos;i="5.92,217,1650956400"; d="scan'208";a="645038369" Received: from wenli3x-mobl.ccr.corp.intel.com (HELO [10.249.168.117]) ([10.249.168.117]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2022 18:35:51 -0700 Message-ID: <270eec00-8aee-2288-4069-d604e6da2925@linux.intel.com> Date: Fri, 24 Jun 2022 09:35:49 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v3 1/5] iommu: Return -EMEDIUMTYPE for incompatible domain and device/group Content-Language: en-US To: Nicolin Chen , joro@8bytes.org, will@kernel.org, marcan@marcan.st, sven@svenpeter.dev, robin.murphy@arm.com, robdclark@gmail.com, matthias.bgg@gmail.com, orsonzhai@gmail.com, baolin.wang7@gmail.com, zhang.lyra@gmail.com, jean-philippe@linaro.org, alex.williamson@redhat.com, jgg@nvidia.com, kevin.tian@intel.com References: <20220623200029.26007-1-nicolinc@nvidia.com> <20220623200029.26007-2-nicolinc@nvidia.com> From: Baolu Lu In-Reply-To: <20220623200029.26007-2-nicolinc@nvidia.com> Cc: jordan@cosmicpenguin.net, thierry.reding@gmail.com, alyssa@rosenzweig.io, linux-s390@vger.kernel.org, kvm@vger.kernel.org, jonathanh@nvidia.com, yangyingliang@huawei.com, gerald.schaefer@linux.ibm.com, linux-arm-msm@vger.kernel.org, christophe.jaillet@wanadoo.fr, linux-tegra@vger.kernel.org, tglx@linutronix.de, virtualization@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, cohuck@redhat.com, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-mediatek@lists.infradead.org, dwmw2@infradead.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On 2022/6/24 04:00, Nicolin Chen wrote: > diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c > index e1cb51b9866c..5386d889429d 100644 > --- a/drivers/iommu/mtk_iommu_v1.c > +++ b/drivers/iommu/mtk_iommu_v1.c > @@ -304,7 +304,7 @@ static int mtk_iommu_v1_attach_device(struct iommu_domain *domain, struct device > /* Only allow the domain created internally. */ > mtk_mapping = data->mapping; > if (mtk_mapping->domain != domain) > - return 0; > + return -EMEDIUMTYPE; > > if (!data->m4u_dom) { > data->m4u_dom = dom; This change looks odd. It turns the return value from success to failure. Is it a bug? If so, it should go through a separated fix patch. Best regards, baolu _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu