Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp288144rdg; Thu, 12 Oct 2023 05:58:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJcO21lRxLmyY7lyF6v5m2V98BX4UOJXMe1+wcb0q4HFZu9ARuP6meNCdaePwwm575HM93 X-Received: by 2002:a05:6358:8a2:b0:14b:86a3:b3f0 with SMTP id m34-20020a05635808a200b0014b86a3b3f0mr27148007rwj.5.1697115484552; Thu, 12 Oct 2023 05:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697115484; cv=none; d=google.com; s=arc-20160816; b=Aq+FYWsNgpWCxciTRXi/gJK9IjBD2GikkRJ5OSd45Pn9ScyOKCncU/9uKi8hne1u6X UfNER0S5w0C5OCJ4gquV0HNEO3fF1X1uCeK5MuOaqu/ZnzBwYkfJHcroaK08P8bRsWd2 cuoKScV1IwCEhlFDVUjPtNq9Nmd9z/l+sJu+C11Fiiv/oMmZTHt55UAYcH5g822ORtQu qHQPDJAG45LhoEGFX2hRCXabHhkdIQoI5dHpgKBMmY+R52++spag/pGyFw3mmxQHkPqb V3deeTuZgRxPhWS+cL4y+yMEYeK/hJhZy6vZ3Xk+Q2VQfVOJ04uAN/OVYQVPr483RHmD i8Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=IGNIAIbv17L8Wl7p0gUvA2y91wbGCS9OX6SIcgaGKHY=; fh=WpD9KyWI+eINSWgF3wFXQIkIuEhiWcNwZpHdEJYb8T0=; b=SMsr2LEumcyCOc/8/0p76IxhLE7LZkYKsgyxqYzic9zGPevCUgbu8hopCG2ZJEksZH 5C57s7syU3YA2r2kTdpQzKFO4emnq6NNkOJoZkM1fVpywW2jIS5QrJFTsqrUdzU/JbKG kZSgFEbb5REEOV6e7XbvBDYw9BYCzN337+hDVYFWyy1V2SWt8PxhB1Vm9e1c5Z3leonm hvhrc0XozQP/Rwb9ph2zjmEe69ymLQv8vuXxv66VI16gW8pVHUV6iUNde36xifuE55+b 1PITHqCQeBJ12oAxhEjXZYJ+MXQBr1l5oBI6UruSaoY48dm3pXJ2haIOuuExE5sse2kh mLKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nzzcxuga; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id b10-20020a056a000cca00b0069026a3de0asi15089798pfv.138.2023.10.12.05.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 05:58:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nzzcxuga; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id A4E6981AA52F; Thu, 12 Oct 2023 05:57:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378390AbjJLM5t (ORCPT + 99 others); Thu, 12 Oct 2023 08:57:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343995AbjJLM5s (ORCPT ); Thu, 12 Oct 2023 08:57:48 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26A58BB for ; Thu, 12 Oct 2023 05:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697115464; x=1728651464; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=eLgI4Z9uatFwbzYeyq1iwRm+eHP+m2Ni4SKD5c1f350=; b=nzzcxuga2sUmuDSEk1+cVZInbaquFLIbmNNZ+6ZnY3HPFhP1PvlUe2PP Z1sLQUDmy8OacK/vbatagC9ODMT6qA2KmlOgMSi4oRGGx/z85j3BcJwlw OnVmEKHQgbpK72v5kQsH6wXg1UNRGtfpY79uNU5hSSBYWY6X8YUJvmxD8 ycmCyrur57Kq7slppTLTYM3vCbBG+d107wifxOPAvQaw070M/j4cYR47P YixrAy3jXrWPZQY2iVdZ4OjcvC6jx5NHRIiSRQWRtMfdI3hxsWIRxJTU/ mxUjWoD68oVgVvfgIrsAy/Tqmk5eQOYRgNkNftAJv22Nle7nERZkCjdIe w==; X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="388769031" X-IronPort-AV: E=Sophos;i="6.03,219,1694761200"; d="scan'208";a="388769031" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 05:57:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="758007757" X-IronPort-AV: E=Sophos;i="6.03,219,1694761200"; d="scan'208";a="758007757" Received: from blu2-mobl.ccr.corp.intel.com (HELO [10.254.213.230]) ([10.254.213.230]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 05:57:42 -0700 Message-ID: <1894abdd-b88b-7d29-1ffd-2244d9086f94@linux.intel.com> Date: Thu, 12 Oct 2023 20:57:40 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Cc: baolu.lu@linux.intel.com, joro@8bytes.org, will@kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 2/7] iommu: Decouple iommu_present() from bus ops Content-Language: en-US To: Jason Gunthorpe , Robin Murphy References: <6711338e24dd1edfd02187f25cf40d8622cefdb2.1697047261.git.robin.murphy@arm.com> <43ca2a88-942e-4d65-87f1-30a7cf537edd@linux.intel.com> <42bbeab4-84f3-470e-bd42-2dae31b5775c@arm.com> <20231012123755.GH3952@nvidia.com> From: Baolu Lu In-Reply-To: <20231012123755.GH3952@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.1 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 12 Oct 2023 05:57:57 -0700 (PDT) On 2023/10/12 20:37, Jason Gunthorpe wrote: > On Thu, Oct 12, 2023 at 12:40:01PM +0100, Robin Murphy wrote: >> On 2023-10-12 07:05, Baolu Lu wrote: >>> On 10/12/23 2:14 AM, Robin Murphy wrote: >>>> Much as I'd like to remove iommu_present(), the final remaining users >>>> are proving stubbornly difficult to clean up, so kick that can down the >>>> road and just rework it to preserve the current behaviour without >>>> depending on bus ops. Since commit 57365a04c921 ("iommu: Move bus setup >>> >>> The iommu_present() is only used in below two drivers. >>> >>> $ git grep iommu_present >>> drivers/gpu/drm/mediatek/mtk_drm_drv.c: if >>> (!iommu_present(&platform_bus_type)) >>> drivers/gpu/drm/tegra/drm.c:    if (host1x_drm_wants_iommu(dev) && >>> iommu_present(&platform_bus_type)) { >>> >>> Both are platform drivers and have the device pointer passed in. Just >>> out of curiosity, why not replacing them with device_iommu_mapped() >>> instead? Sorry if I overlooked previous discussion. >> >> Yes, we've already gone round in circles on this several times, that's why >> it's explicitly called out as "stubbornly difficult" in the commit message. >> The Mediatek one is entirely redundant, but it seems I have yet to figure >> out the right CC list to get anyone to care about that patch[1]. I see now. Thanks for the explanation. > > Please just have Joerg take such a trivial patch, there is no reason > we need to torture outselves because DRM side is not behaving well. :( I was not object to the patch. Just want to make sure that I understand the reason why device_iommu_mapped() can't be used in those two drivers. It's fine to me. I will add my r-b. Best regards, baolu