Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp252367lqp; Mon, 10 Jun 2024 03:02:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXstWrssY4R3TE+E2Iin4Sm8Qsm7ibYRy9smUn/V/5EalLQI7EEsUXYiJFxJnHffiHUv9lsP7x9KpFTZyeqOGx+04u1gCg1ycd15ygqsQ== X-Google-Smtp-Source: AGHT+IFoTNbEvqje0w4HbGDsBX6sHVKWp4+rlWA2TfCznHpda7RdF+xXhDGp6swFBMoaLrDmUeMT X-Received: by 2002:a05:6358:3220:b0:197:df0e:f23c with SMTP id e5c5f4694b2df-19f1fd10e84mr1139246555d.11.1718013767564; Mon, 10 Jun 2024 03:02:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718013767; cv=pass; d=google.com; s=arc-20160816; b=J9ry39h6QkZ/7yfLHtKCFg1SPaQ2WrUwUJv7SaaVRwI7t9PjMpsK2JItqxA4JKNn1k vobRgXcpQ6hNhhDVM27KZHX3ad/yP0BL/FWUpNfldXNaiAu7A4OHDAUuZ6We372MGli2 f+kHmaJtAX49b6qYmzjW7QOq+zdpOiA2KYDRlViP3kLtSVFbLuXqtX34+U76n+JuBvlf a3H3BFKqGOKcAJH74NGcE/e9afq9qMYkdWhf7X6IsT57D94BazlLWBL7gfNUDIMl9+Mm seKm5fyohV2VNeBFigYH6bcRG4RthzbLS3pyq6LAFZ247Cdo2yRAEj9fJkyWioo05Rqs wfQg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/7suDWynpK92ihsPjDQ8EaArNADXn0Ufh8fk2rdm2nU=; fh=oMfgzkEw/ooUXqvARCgNaSZrpwGw5y27+DEhhPidNdU=; b=NV2Sv/x4if5BtAc4tCTqvwRDUwJBQDVav8T4MvWyqFtp9JmSqvxe3YHs/LO3qAsjvM JRQ5rWr5er812eCCsYa1HmhVRRNMJJRA/rN765W83FR+uoSeW2Vdtss8Gh/jdN+EfVhI 0F/uwS/wcIS+l1Jjnd15jgYT8xoGGkRLR8jNrnSxTU5hZACNkd2wlJD4OWvyjVXa+4Dl zJN7C2/U2qsNyxzP6FZ7KlIogqM+xNlx8lautvAuoOTtIYKkSDTLLZBaOe/3OpwZvxtD cTWLzwcNkOlN7fOhQiIYhJA6gr5b3e1MjbBC6koNYT+j1KGZSCaaH3FE/PkWRXWMyTp0 erIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=j6Ykq3eH; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-207911-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207911-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e4499184c3si5107871a12.158.2024.06.10.03.02.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 03:02:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207911-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=j6Ykq3eH; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-207911-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207911-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0300D2864A1 for ; Mon, 10 Jun 2024 09:05:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D935C13AA35; Mon, 10 Jun 2024 09:00:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="j6Ykq3eH" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C9DA13A26B for ; Mon, 10 Jun 2024 09:00:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718010003; cv=none; b=Q7DarH8E1gsMfMIO9iQmKCNOCxLiSEXQMNqTkHJmCr0AoTvfidmY/xgjtVdVkBayHx3kj9EjL1umGcOwrZYpmkVHgCabCyDdg4YHd4kWeCquNnH1RZus1IW4zEKhJ6+fe5VPY+p39rhnWq52855gTxab/sUHGfe/26lniiywscw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718010003; c=relaxed/simple; bh=wZSuoOsJ9R3MpkLrN5YRfrHjzrkwvK0M+Y3osdd4hrI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jvkSA0GCtRv2Ij8hGE716WIS+Xxx8vvX4gI8gMcz+xwAtKX/SsKjv7vSLDcbe98fnBHXni0RuOCH5gvVee2vUXkpnZ8KlZ/B8n0pu6a3/a9s0BL6XvL88uIB49Sv8+5aKLM0CkcNsl0SIGc2TWJCzdR0LfRGNRU0edHtqq4spqg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=j6Ykq3eH; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718010001; x=1749546001; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wZSuoOsJ9R3MpkLrN5YRfrHjzrkwvK0M+Y3osdd4hrI=; b=j6Ykq3eHqWLfRFXMh1h0NdwpHI8EdOGnpwCMzm84bNFJmFGaIHH3KKoe /DXGEmwn6Wig8ke0GYAx1tfdW9xZBOZJ5sPFyNm+vRW7ZyIcNBNhI/qoZ nWvmk+CcUb0DT1peLDziwtI6WaTDUEJax9Gerl/yOuY2wOqR9tjaXekmX K+jB2c9TYQnyGkBr8u3CGWBIRpY+ixC4zMoHvKOZHq49boVzx/znjcOSt MZFIEhknWtVoIxh5pue/U5YzW0YiTI5juum1YheQFUa6q8BwIR4+iZwNu Db3M3/yHNReu13rTQI50F+VzMkuEpbPFedDAkVAgZicnifOADoR0ZLyf8 A==; X-CSE-ConnectionGUID: iQRYi6yXQQyOwpOynsSewQ== X-CSE-MsgGUID: D+2+XpKKTmGipNd5Ru/Ouw== X-IronPort-AV: E=McAfee;i="6600,9927,11098"; a="17582003" X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="17582003" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2024 02:00:01 -0700 X-CSE-ConnectionGUID: UkJOBireQRy0iFWBh3TABg== X-CSE-MsgGUID: GPssOU7ITwWVQqYExEAGUw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="43433176" Received: from unknown (HELO allen-box.sh.intel.com) ([10.239.159.127]) by fmviesa003.fm.intel.com with ESMTP; 10 Jun 2024 01:59:57 -0700 From: Lu Baolu To: Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Kevin Tian Cc: Yi Liu , David Airlie , Daniel Vetter , Kalle Valo , Bjorn Andersson , Mathieu Poirier , Alex Williamson , mst@redhat.com, Jason Wang , Thierry Reding , Jonathan Hunter , Mikko Perttunen , Jeff Johnson , ath10k@lists.infradead.org, ath11k@lists.infradead.org, iommu@lists.linux.dev, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH v3 20/21] iommu: Remove iommu_present() Date: Mon, 10 Jun 2024 16:55:54 +0800 Message-Id: <20240610085555.88197-21-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610085555.88197-1-baolu.lu@linux.intel.com> References: <20240610085555.88197-1-baolu.lu@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The iommu_present() interface is no longer used in the tree anymore. Remove it to avoid dead code. Signed-off-by: Lu Baolu --- include/linux/iommu.h | 6 ------ drivers/iommu/iommu.c | 25 ------------------------- 2 files changed, 31 deletions(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 46f1348f1f0a..ba0b27afc256 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -776,7 +776,6 @@ static inline void iommu_iotlb_gather_init(struct iommu_iotlb_gather *gather) } extern int bus_iommu_probe(const struct bus_type *bus); -extern bool iommu_present(const struct bus_type *bus); extern bool device_iommu_capable(struct device *dev, enum iommu_cap cap); extern bool iommu_group_has_isolated_msi(struct iommu_group *group); extern struct iommu_domain *iommu_domain_alloc(const struct bus_type *bus); @@ -1072,11 +1071,6 @@ struct iommu_iotlb_gather {}; struct iommu_dirty_bitmap {}; struct iommu_dirty_ops {}; -static inline bool iommu_present(const struct bus_type *bus) -{ - return false; -} - static inline bool device_iommu_capable(struct device *dev, enum iommu_cap cap) { return false; diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index e03c71a34347..c7ebdf96e4bc 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -1846,31 +1846,6 @@ int bus_iommu_probe(const struct bus_type *bus) return 0; } -/** - * iommu_present() - make platform-specific assumptions about an IOMMU - * @bus: bus to check - * - * Do not use this function. You want device_iommu_mapped() instead. - * - * Return: true if some IOMMU is present and aware of devices on the given bus; - * in general it may not be the only IOMMU, and it may not have anything to do - * with whatever device you are ultimately interested in. - */ -bool iommu_present(const struct bus_type *bus) -{ - bool ret = false; - - for (int i = 0; i < ARRAY_SIZE(iommu_buses); i++) { - if (iommu_buses[i] == bus) { - spin_lock(&iommu_device_lock); - ret = !list_empty(&iommu_device_list); - spin_unlock(&iommu_device_lock); - } - } - return ret; -} -EXPORT_SYMBOL_GPL(iommu_present); - /** * device_iommu_capable() - check for a general IOMMU capability * @dev: device to which the capability would be relevant, if available -- 2.34.1