From nobody Wed Nov 27 17:34:24 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 DECF815382F for ; Wed, 9 Oct 2024 04:16:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728447397; cv=none; b=TtrHks7tjCdxyMGjCcQc3/HpOv8TreBvCA+IlhPf4X7FwAaCIo6f44msnKo5eNiuafoB+zK2bsHozURozBBr9GJQ3JoTAeVNgp9+RQP3EpkmcMKOAK+KVxfWJwzozHOxCPRULWts3UOvrQUE2OMon78hhECTxObTz0edk+AZvP4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728447397; c=relaxed/simple; bh=FpKlHHeM/6cKsSb3+hXN3Hii4hdbUz8GYyXvQvDxPug=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BiqRb2Owce51pb4dvgpzmU13gnJZTH4k3vI7dRsuc39bzPltTQ23W65Vgq3aYYP+UF1UsrXoX7WI/CJaSEGMkB2XtVyonCwNw9e8LmLsMaK0qah7dGwQSmXgu/ZEK2pal+CMdJ4APZARKNhXjfiqEIwlZy2RIt7wbtPRXwbAckM= 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=PzZTvHMn; arc=none smtp.client-ip=192.198.163.7 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="PzZTvHMn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728447396; x=1759983396; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FpKlHHeM/6cKsSb3+hXN3Hii4hdbUz8GYyXvQvDxPug=; b=PzZTvHMnW6bxkpcUyDINBNkVIvsKEOsnk9KoIZzOrcakHz61O81nwLpU jYjrhFY9gvKnU0WdJ4M5ZmhxR4lYoGPNTqqiOrSRyBd/Az9MuEpOPyiVZ f9LhIuPNCJS3R991EAUQlymixHvtxhkwxGkLPHY9hQgOaJMw+Sv8RtGdm BNwC28l9ZKqh32x1uhyY2CGI7hGRJbepwn9+eBPXtpscBJrhA1Ez3xY0Q 3o3mzT1WHTcPoK1uv1kgulLhv512ATDuDvgnb8T62wcu3i16hiSQIEtfR 2nHGFCoUh7Y2fNC32msk82sPS/dAM3xAL/ahlW4zgvrEIMbZ5rLaE0w37 Q==; X-CSE-ConnectionGUID: yuIbUAjTR7uvVbWRTvmAtA== X-CSE-MsgGUID: S+FIVQ29RnmStO9iKFd9UQ== X-IronPort-AV: E=McAfee;i="6700,10204,11219"; a="53126980" X-IronPort-AV: E=Sophos;i="6.11,189,1725346800"; d="scan'208";a="53126980" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2024 21:16:36 -0700 X-CSE-ConnectionGUID: gBR1ztROQv6F5nsORJFsxQ== X-CSE-MsgGUID: IuHfSUqBTXCGAYv8AkG3CQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,189,1725346800"; d="scan'208";a="80095696" Received: from allen-box.sh.intel.com ([10.239.159.127]) by fmviesa003.fm.intel.com with ESMTP; 08 Oct 2024 21:16:30 -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, Lyude Paul , Beleswar Padhi , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu , Jason Gunthorpe Subject: [PATCH v4 1/4] remoteproc: Use iommu_paging_domain_alloc() Date: Wed, 9 Oct 2024 12:11:44 +0800 Message-ID: <20241009041147.28391-2-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241009041147.28391-1-baolu.lu@linux.intel.com> References: <20241009041147.28391-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: quoted-printable Content-Type: text/plain; charset="utf-8" An iommu domain is allocated in rproc_enable_iommu() and is attached to rproc->dev.parent in the same function. Use iommu_paging_domain_alloc() to make it explicit. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe Reviewed-by: Mathieu Poirier Acked-by: Beleswar Padhi --- drivers/remoteproc/remoteproc_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remo= teproc_core.c index f276956f2c5c..eb66f78ec8b7 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -109,10 +109,10 @@ static int rproc_enable_iommu(struct rproc *rproc) return 0; } =20 - domain =3D iommu_domain_alloc(dev->bus); - if (!domain) { + domain =3D iommu_paging_domain_alloc(dev); + if (IS_ERR(domain)) { dev_err(dev, "can't alloc iommu domain\n"); - return -ENOMEM; + return PTR_ERR(domain); } =20 iommu_set_fault_handler(domain, rproc_iommu_fault, rproc); --=20 2.43.0 From nobody Wed Nov 27 17:34:24 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 7C398137C37 for ; Wed, 9 Oct 2024 04:16:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728447402; cv=none; b=usXdzIbuzU43yoH3L/u0KYpDn47d5DaoWQgJ56mj8pcS1OTVk60tvSlEURVKf8sKy12cCSDGZxODhDzWAfb5DiFBMG5P132jRHRnG2cZINOBrNY1Gel1hIx1qtqrmMXH3nP77PZ979gdLVgfRADZrNW5IDilgaF/ET9QXeorWEA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728447402; c=relaxed/simple; bh=uEZHu/PVfdBPbQ846vnRaHi9qbLdVY+D5A9rU1Lwz6c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R0Oaymiwm2sj2anwIK7q2rzpWqrnJQ3ou+mrcU11gvLsagyj58bA9J4Xc0ibDY1jxSj75FNOJhI8wr+caJSp0odRHvuRWj2UofeBfYG1Pur2mzD9BMfWdCv7haQ8xF8KJt35DteUaj3ueae459xiou/HvOX7EIiXYq1CHc6frls= 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=FUqemO13; arc=none smtp.client-ip=192.198.163.7 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="FUqemO13" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728447402; x=1759983402; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uEZHu/PVfdBPbQ846vnRaHi9qbLdVY+D5A9rU1Lwz6c=; b=FUqemO13orIRFRRDwX8h3slx3eTgm3PXsKrPolNzOF3tQUnZpicilAVB 4mSRFpDeHkq8Fjc/kzmKjj4qeoyMIU07DlkvWCBccDsm2phpyoM2ZmoJD HV3zMy2WLZmRkirOBtc2wzb8GYEU+CdHUBukb8XDj5vben5VNoGp3lkNj ZxcnowPEBu86iGZS2/791mmQpJ08RfLh5bTHZpp/x8e1ZE9oYEhRznQJz VtCYQxT74x+YznQWEJNFs+Cg7i15gbqXcwz3XkG5CZMHdaa0xmBRW8ctD l3TNBVLQ9bXXHqO1hWU2ntWcWpKgeUNk08vW6JdHeCRZrV4asxTHOzQWT Q==; X-CSE-ConnectionGUID: YemWL/txSMOExWXWXBIvQg== X-CSE-MsgGUID: ZSOlOiRnR6q9DIH1aorYfg== X-IronPort-AV: E=McAfee;i="6700,10204,11219"; a="53126998" X-IronPort-AV: E=Sophos;i="6.11,189,1725346800"; d="scan'208";a="53126998" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2024 21:16:41 -0700 X-CSE-ConnectionGUID: UYwQwEn3SgCh1SLgrMHEFg== X-CSE-MsgGUID: +AYjs8w1TPWVJjIqb4V2KA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,189,1725346800"; d="scan'208";a="80095725" Received: from allen-box.sh.intel.com ([10.239.159.127]) by fmviesa003.fm.intel.com with ESMTP; 08 Oct 2024 21:16:36 -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, Lyude Paul , Beleswar Padhi , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu , Jason Gunthorpe , Thierry Reding Subject: [PATCH v4 2/4] media: nvidia: tegra: Use iommu_paging_domain_alloc() Date: Wed, 9 Oct 2024 12:11:45 +0800 Message-ID: <20241009041147.28391-3-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241009041147.28391-1-baolu.lu@linux.intel.com> References: <20241009041147.28391-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: quoted-printable Content-Type: text/plain; charset="utf-8" An iommu domain is allocated in tegra_vde_iommu_init() and is attached to vde->dev. Use iommu_paging_domain_alloc() to make it explicit. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe Acked-by: Thierry Reding --- drivers/media/platform/nvidia/tegra-vde/iommu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/nvidia/tegra-vde/iommu.c b/drivers/medi= a/platform/nvidia/tegra-vde/iommu.c index 5521ed3e465f..b1d9d841d944 100644 --- a/drivers/media/platform/nvidia/tegra-vde/iommu.c +++ b/drivers/media/platform/nvidia/tegra-vde/iommu.c @@ -78,9 +78,10 @@ int tegra_vde_iommu_init(struct tegra_vde *vde) arm_iommu_release_mapping(mapping); } #endif - vde->domain =3D iommu_domain_alloc(&platform_bus_type); - if (!vde->domain) { - err =3D -ENOMEM; + vde->domain =3D iommu_paging_domain_alloc(dev); + if (IS_ERR(vde->domain)) { + err =3D PTR_ERR(vde->domain); + vde->domain =3D NULL; goto put_group; } =20 --=20 2.43.0 From nobody Wed Nov 27 17:34:24 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 E4CE1150997 for ; Wed, 9 Oct 2024 04:16:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728447408; cv=none; b=XuqTkwTH5Xg8jHBXkJMh72w6yVG+djIQX8ck9Bz+y4c37S6nMWkujbCfFtpwU6Fj7ojra8X8aDcnNScjJI6tNh/BAOnrJ35//aqYv+nk6Muz3JLOujX8/y+S/Lu3+hHfor3Vl4bqp+QDL4NYy5/ca7kA7rgiDEd3K71e7vJzlsg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728447408; c=relaxed/simple; bh=FNZtLfJ5rXbaDZePK51gpgINvo8ZfmFIhkL4SyhfFH8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CHQATjcC7EAOERUnM5ZL9HJwpg691IaJ+f2TApx7WtKZy+OqDbtq4WkVS7AqQz+5nCo1gV+T82Iw2by+de2viKKUFoOpY4XeA3Lhk6Wci+hrInJ1kjKGcjUGRKs71en/HBn4prkB/RViMmH95Ym+CHa4NQ95htekXv7TA1r/pf4= 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=cCS0km45; arc=none smtp.client-ip=192.198.163.7 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="cCS0km45" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728447407; x=1759983407; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FNZtLfJ5rXbaDZePK51gpgINvo8ZfmFIhkL4SyhfFH8=; b=cCS0km45F5nBYyZjWgNtM4+jwKP9S7LNvmVjrtCrKJ5aio/gm6vwGp0Y OZs7k7BM7yEVhkQ+2GB3rcDmTLihjt8v4M0MHEr3/glV9XMeGHWAB9LaC MRNvavSugChxmoPOGY9RjgTXETvprzHzFjbI67VEaKpXZMyUp54Tr/zFs IcRlMLK5QBcm24Xa+iEPLYkFAzbstrn4xPBn1OiEadeMbQTCxDvShYCS4 0NECaHek1vssv1bv0YBg4J33SckJYcqvt3Y5nWi5r5YVv3SkR+dJsar0A IzbkBUZUmPdco0eZAfKTXsKcfI8Cb1afiuhVAvL3e4L/MyXg5vFgh6uZE Q==; X-CSE-ConnectionGUID: hK8v/oFFTlytsmstXy/rJA== X-CSE-MsgGUID: /ds4GKQJQYmiY9joqAq9mw== X-IronPort-AV: E=McAfee;i="6700,10204,11219"; a="53127018" X-IronPort-AV: E=Sophos;i="6.11,189,1725346800"; d="scan'208";a="53127018" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2024 21:16:47 -0700 X-CSE-ConnectionGUID: 5W+A5CHwRjGF5/AsJMPzkg== X-CSE-MsgGUID: qyyee3xYTNuRtsRlsQMXVw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,189,1725346800"; d="scan'208";a="80095743" Received: from allen-box.sh.intel.com ([10.239.159.127]) by fmviesa003.fm.intel.com with ESMTP; 08 Oct 2024 21:16:41 -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, Lyude Paul , Beleswar Padhi , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu , Thierry Reding Subject: [PATCH v4 3/4] drm/nouveau/tegra: Use iommu_paging_domain_alloc() Date: Wed, 9 Oct 2024 12:11:46 +0800 Message-ID: <20241009041147.28391-4-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241009041147.28391-1-baolu.lu@linux.intel.com> References: <20241009041147.28391-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: quoted-printable Content-Type: text/plain; charset="utf-8" In nvkm_device_tegra_probe_iommu(), a paging domain is allocated for @dev and attached to it on success. Use iommu_paging_domain_alloc() to make it explicit. Signed-off-by: Lu Baolu Acked-by: Thierry Reding Reviewed-by: Lyude Paul --- drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/g= pu/drm/nouveau/nvkm/engine/device/tegra.c index d1c294f00665..78a83f904bbd 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c @@ -120,8 +120,8 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra = *tdev) mutex_init(&tdev->iommu.mutex); =20 if (device_iommu_mapped(dev)) { - tdev->iommu.domain =3D iommu_domain_alloc(&platform_bus_type); - if (!tdev->iommu.domain) + tdev->iommu.domain =3D iommu_paging_domain_alloc(dev); + if (IS_ERR(tdev->iommu.domain)) goto error; =20 /* --=20 2.43.0 From nobody Wed Nov 27 17:34:24 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 58C7B15383B for ; Wed, 9 Oct 2024 04:16:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728447414; cv=none; b=MByKQpuLHuABbUf2OTEZR5OdC+D0xO6Q8paQBfdL/Pi3TNI19txMSghodtyk6oaxV8Io/lbOj/QWTnZ0p/XRgssjl+UEbkxxzLkZiLdmTKV+hLI3fj7zS/+G9BXyc3QXNfAdbJB0HQw+6tuGtS4E8hOtzYUR5CxzICjD6S6tKsY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728447414; c=relaxed/simple; bh=F/5wX0qVJczRA+WzF+0h7RDUQ6Vlg1N7b7JHM6GAw3Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zo1uf3QuMXXfudOMDVM+5sjaotH00sjfZrnK638Pm1ENiHSPzTNhY8a4WJ1OdacCGkF0JkLhPxmw7yLCEjA7V6R+gkJf+qVncPghis+7ifHkp7mStZamhVEF228Bs7W6zq9udUA9FR99V17se38dv3zTyeL1lQMoz8srB+icMUE= 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=YyuTNNC/; arc=none smtp.client-ip=192.198.163.7 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YyuTNNC/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728447413; x=1759983413; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=F/5wX0qVJczRA+WzF+0h7RDUQ6Vlg1N7b7JHM6GAw3Q=; b=YyuTNNC/EA6muneZ0r2BPaS8psAsX1xzrSoJk25hloEOSBJdXNx0WFX5 hL5133PWC2yuqmgcrg2DRsnu8CIxcHL4mZim8TbJxy4MFX0hHyY5yEOVy VocY0jjzvqj0Pdj45zOa3TwEewqZOr+V/G89ylArTA9GNvA/TNNhrE1IK +H0Rw+6bB8y0YHZ9RNI6Ri1CdUitZjHY1eVsJ38BLis+w4J7wBDD2okfp NEl+ggkHM8NWzIdtpWj4XNuZeyPm4ZQ86uo73xrROWvt6pmZMRf1ihNCa TboyM8v5YYcwUu/4WmfP/OAiMdEivNR6DxefHD6OX1NR+efcWjuWemBq9 g==; X-CSE-ConnectionGUID: kDGrvnBURsG9Ku83sL/qSQ== X-CSE-MsgGUID: fa7Po//DT7aL4e6xOWBuYA== X-IronPort-AV: E=McAfee;i="6700,10204,11219"; a="53127030" X-IronPort-AV: E=Sophos;i="6.11,189,1725346800"; d="scan'208";a="53127030" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2024 21:16:52 -0700 X-CSE-ConnectionGUID: zKivlZtaRWO54jYgwlDlNw== X-CSE-MsgGUID: hSstibpsRNKP9XCVIJnPUg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,189,1725346800"; d="scan'208";a="80095760" Received: from allen-box.sh.intel.com ([10.239.159.127]) by fmviesa003.fm.intel.com with ESMTP; 08 Oct 2024 21:16:47 -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, Lyude Paul , Beleswar Padhi , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu , Jason Gunthorpe Subject: [PATCH v4 4/4] iommu: Remove iommu_domain_alloc() Date: Wed, 9 Oct 2024 12:11:47 +0800 Message-ID: <20241009041147.28391-5-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241009041147.28391-1-baolu.lu@linux.intel.com> References: <20241009041147.28391-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: quoted-printable Content-Type: text/plain; charset="utf-8" The iommu_domain_alloc() interface is no longer used in the tree anymore. Remove it to avoid dead code. There is increasing demand for supporting multiple IOMMU drivers, and this is the last bus-based thing standing in the way of that. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe --- include/linux/iommu.h | 6 ------ drivers/iommu/iommu.c | 36 ------------------------------------ 2 files changed, 42 deletions(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index bd722f473635..6d809f6e6c8d 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -788,7 +788,6 @@ 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); struct iommu_domain *iommu_paging_domain_alloc(struct device *dev); extern void iommu_domain_free(struct iommu_domain *domain); extern int iommu_attach_device(struct iommu_domain *domain, @@ -1091,11 +1090,6 @@ static inline bool device_iommu_capable(struct devic= e *dev, enum iommu_cap cap) return false; } =20 -static inline struct iommu_domain *iommu_domain_alloc(const struct bus_typ= e *bus) -{ - return NULL; -} - static inline struct iommu_domain *iommu_paging_domain_alloc(struct device= *dev) { return ERR_PTR(-ENODEV); diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 83c8e617a2c5..521471706400 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -1994,42 +1994,6 @@ __iommu_group_domain_alloc(struct iommu_group *group= , unsigned int type) return __iommu_domain_alloc(dev_iommu_ops(dev), dev, type); } =20 -static int __iommu_domain_alloc_dev(struct device *dev, void *data) -{ - const struct iommu_ops **ops =3D data; - - if (!dev_has_iommu(dev)) - return 0; - - if (WARN_ONCE(*ops && *ops !=3D dev_iommu_ops(dev), - "Multiple IOMMU drivers present for bus %s, which the public IOMMU= API can't fully support yet. You will still need to disable one or more fo= r this to work, sorry!\n", - dev_bus_name(dev))) - return -EBUSY; - - *ops =3D dev_iommu_ops(dev); - return 0; -} - -/* - * The iommu ops in bus has been retired. Do not use this interface in - * new drivers. - */ -struct iommu_domain *iommu_domain_alloc(const struct bus_type *bus) -{ - const struct iommu_ops *ops =3D NULL; - int err =3D bus_for_each_dev(bus, NULL, &ops, __iommu_domain_alloc_dev); - struct iommu_domain *domain; - - if (err || !ops) - return NULL; - - domain =3D __iommu_domain_alloc(ops, NULL, IOMMU_DOMAIN_UNMANAGED); - if (IS_ERR(domain)) - return NULL; - return domain; -} -EXPORT_SYMBOL_GPL(iommu_domain_alloc); - /** * iommu_paging_domain_alloc() - Allocate a paging domain * @dev: device for which the domain is allocated --=20 2.43.0