From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (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 938A61B4F1A for ; Sun, 12 Jan 2025 13:41:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736689275; cv=none; b=taVtapYupyLse8wmWf+y1zEmmqisfiQdGCzm7XLUTlD+VgGFwz6LQj/YoiGiVelWRvLqMqpQX6B+UnSUbnPCGfmyJ7JnwvleoTdazdv49Dwy+Jti3TCY1p4ELRp/s43jmiEeGdc6RCC75K6AyqcAbwTcuUFZ9/aoYY9ClgD3QJ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736689275; c=relaxed/simple; bh=RYBwKrfdeJUlMAqJFByySssjVDWsmANtunP2qMHCCXo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pMEi23JuBfggkI6nF2RgxHJJmwn6tgRKxwl59e99LVPrLUfXkgP0unU/4mfNVP8TZDSrPbwtWIZlBSZ1ooOXZ1aZrii53pizA3D6XFozBGj3k+2XY7gwfrjjRjt1OP5SR9OydGw0gcliWEKtG77j7fEMNQ70DDSPCiouVtm7gaY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=ITIz29fB; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="ITIz29fB" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=GBw/kTc50JMCdL9NraUxTr2TqlNGdHlCJYiN4J/1AHo=; b=ITIz29fBjXiKUzVk XVN7N8JFH0gA2YyY+KeeyPgLLQYb3mMvljJWc0lymDxYZC0h870pe+BIiyvXazBqbGp/BtvhasASL ThuIbJm62mnA4vGurNZ8//c+V5ZHN+3pQFzc03iZGbPKxPDW+fZB73T+kjbY4O3jcIHXF6FdQdNVP 5Mg+9GVqnaFCdV2JY8nk1nvgsMRYXzAtC/H4EmWxm3TTlFSVJc6L97WoRmRcUEf47wh0On6GfabRf KarInBA7f6OgFq/7Gz/YHNa3VdeYTFWYJqaH3rxl+ifutBP+2PQofLWYEWEQDqS1U7MKrLmbtR6Po QdWnA+iBuBgGKfdwNg==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1tWyDA-009jBX-29; Sun, 12 Jan 2025 13:41:04 +0000 From: linux@treblig.org To: Felix.Kuehling@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com Cc: airlied@gmail.com, simona@ffwll.ch, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH] drm/amdkfd: Remove unused functions Date: Sun, 12 Jan 2025 13:41:03 +0000 Message-ID: <20250112134103.72081-1-linux@treblig.org> X-Mailer: git-send-email 2.47.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Dr. David Alan Gilbert" kfd_device_by_pci_dev(), kfd_get_pasid_limit() and kfd_set_pasid_limit() have been unused since 2023's commit c99a2e7ae291 ("drm/amdkfd: drop IOMMUv2 support") Remove them. Signed-off-by: Dr. David Alan Gilbert --- drivers/gpu/drm/amd/amdkfd/kfd_pasid.c | 24 ----------------------- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 3 --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 18 ----------------- 3 files changed, 45 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c b/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c index e3b250918f39..8896426e0556 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c @@ -28,30 +28,6 @@ static unsigned int pasid_bits = 16; static bool pasids_allocated; /* = false */ -bool kfd_set_pasid_limit(unsigned int new_limit) -{ - if (new_limit < 2) - return false; - - if (new_limit < (1U << pasid_bits)) { - if (pasids_allocated) - /* We've already allocated user PASIDs, too late to - * change the limit - */ - return false; - - while (new_limit < (1U << pasid_bits)) - pasid_bits--; - } - - return true; -} - -unsigned int kfd_get_pasid_limit(void) -{ - return 1U << pasid_bits; -} - u32 kfd_pasid_alloc(void) { int r = amdgpu_pasid_alloc(pasid_bits); diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h index 9e5ca0b93b2a..0b5979b29bbc 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h @@ -1086,8 +1086,6 @@ struct kfd_process *kfd_lookup_process_by_pid(struct pid *pid); /* PASIDs */ int kfd_pasid_init(void); void kfd_pasid_exit(void); -bool kfd_set_pasid_limit(unsigned int new_limit); -unsigned int kfd_get_pasid_limit(void); u32 kfd_pasid_alloc(void); void kfd_pasid_free(u32 pasid); @@ -1137,7 +1135,6 @@ struct kfd_topology_device *kfd_topology_device_by_proximity_domain_no_lock( uint32_t proximity_domain); struct kfd_topology_device *kfd_topology_device_by_id(uint32_t gpu_id); struct kfd_node *kfd_device_by_id(uint32_t gpu_id); -struct kfd_node *kfd_device_by_pci_dev(const struct pci_dev *pdev); static inline bool kfd_irq_is_from_node(struct kfd_node *node, uint32_t node_id, uint32_t vmid) { diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c index 9476e30d6baa..a9bc9ab7e31d 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c @@ -108,24 +108,6 @@ struct kfd_node *kfd_device_by_id(uint32_t gpu_id) return top_dev->gpu; } -struct kfd_node *kfd_device_by_pci_dev(const struct pci_dev *pdev) -{ - struct kfd_topology_device *top_dev; - struct kfd_node *device = NULL; - - down_read(&topology_lock); - - list_for_each_entry(top_dev, &topology_device_list, list) - if (top_dev->gpu && top_dev->gpu->adev->pdev == pdev) { - device = top_dev->gpu; - break; - } - - up_read(&topology_lock); - - return device; -} - /* Called with write topology_lock acquired */ static void kfd_release_topology_device(struct kfd_topology_device *dev) { -- 2.47.1