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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B4C2C46467 for ; Tue, 29 Nov 2022 02:15:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235107AbiK2CO7 (ORCPT ); Mon, 28 Nov 2022 21:14:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234994AbiK2CO5 (ORCPT ); Mon, 28 Nov 2022 21:14:57 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03F073D927 for ; Mon, 28 Nov 2022 18:14:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669688096; x=1701224096; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=N5zvBX15lr1YZY8BlmGZXuzWrDu5BekEK8IaVFde6q4=; b=C3n8CvVI5imE8YfvHXQ+48A+DjRnSqnKpqSTZM0aOY/yhruIcIzMyais ozT0A9DTs8PcKT6gsRtWWWplW0rUnYXkrvxLDH44InwlkE+JJinXmAdW9 88MSat0uIQULJD5Bw9zIRgKPbWD9VcIAcnf2NoiE5nDXrkjuecPKmES05 3uvnFIVk0VcSpXCeLhNFHCfmhKA4nyyt9uJGkUBj2kXVHDaWVdGhx/c/m QE4bnJjqN7eLakimeGY/A0EK1AH6SkSq1ohO4CjmTnCE/0SE0s/yl1BvF 61ocUUZ38uZ7AfNguZSBn2sk64bJDlulR2uH4c852syPDI83S/BNCZlrY g==; X-IronPort-AV: E=McAfee;i="6500,9779,10545"; a="312629129" X-IronPort-AV: E=Sophos;i="5.96,201,1665471600"; d="scan'208";a="312629129" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2022 18:14:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10545"; a="594093098" X-IronPort-AV: E=Sophos;i="5.96,201,1665471600"; d="scan'208";a="594093098" Received: from allen-box.sh.intel.com (HELO [10.239.159.48]) ([10.239.159.48]) by orsmga003.jf.intel.com with ESMTP; 28 Nov 2022 18:14:50 -0800 Message-ID: <4a979bdc-d7b4-77b4-490a-5f3e691e3df3@linux.intel.com> Date: Tue, 29 Nov 2022 10:07:38 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Cc: baolu.lu@linux.intel.com, Joerg Roedel , Christoph Hellwig , Kevin Tian , Will Deacon , Jean-Philippe Brucker , Suravee Suthikulpanit , Hector Martin , Sven Peter , Rob Clark , Marek Szyprowski , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Yong Wu , Matthias Brugger , Heiko Stuebner , Matthew Rosato , Orson Zhai , Baolin Wang , Chunyan Zhang , Chen-Yu Tsai , Thierry Reding , iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 06/20] iommu/mtk: Remove detach_dev callback Content-Language: en-US To: Robin Murphy , Jason Gunthorpe References: <20221128064648.1934720-1-baolu.lu@linux.intel.com> <20221128064648.1934720-7-baolu.lu@linux.intel.com> From: Baolu Lu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/28/22 9:59 PM, Robin Murphy wrote: > On 2022-11-28 13:49, Jason Gunthorpe wrote: >> On Mon, Nov 28, 2022 at 02:46:34PM +0800, Lu Baolu wrote: >>> The IOMMU driver supports default domain, so the detach_dev op will >>> never >>> be called. Remove it to avoid dead code. >>> >>> Signed-off-by: Lu Baolu >>> --- >>>   drivers/iommu/mtk_iommu.c | 9 --------- >>>   1 file changed, 9 deletions(-) >> >> I listed this driver as not supporting default domains: >> >> https://lore.kernel.org/linux-iommu/20220516135741.GV1343366@nvidia.com/ >> >> ? >> >> Has something changed? Did I get it wrong? > > static struct iommu_domain *mtk_iommu_domain_alloc(unsigned type) > { >     struct mtk_iommu_domain *dom; > >     if (type != IOMMU_DOMAIN_DMA && type != IOMMU_DOMAIN_UNMANAGED) >         return NULL; > ... > > > This one runs on arm64, so has always supported default domains for > iommu-dma to work. This, together with several other ones, only support IOMMU_DOMAIN_DMA type of default domain. The iommu core handle this by falling back to IOMMU_DOMAIN_DMA if other types fail. dom = __iommu_domain_alloc(bus, type); if (!dom && type != IOMMU_DOMAIN_DMA) { dom = __iommu_domain_alloc(bus, IOMMU_DOMAIN_DMA); if (dom) pr_warn("Failed to allocate default IOMMU domain of type %u for group %s - Falling back to IOMMU_DOMAIN_DMA", type, group->name); } I have another cleanup series: https://github.com/LuBaolu/intel-iommu/commits/iommu-use-def_default_type-wip which adds IOMMU_DOMAIN_DMA default domain type requirement in the def_domain_type callback. I planed to bring that to discussion after this one. Best regards, baolu