* [PATCH] drm/amdkfd: Remove unused functions
@ 2025-01-12 13:41 linux
2025-01-13 17:00 ` Alex Deucher
0 siblings, 1 reply; 2+ messages in thread
From: linux @ 2025-01-12 13:41 UTC (permalink / raw)
To: Felix.Kuehling, alexander.deucher, christian.koenig, Xinhui.Pan
Cc: airlied, simona, amd-gfx, dri-devel, linux-kernel,
Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
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 <linux@treblig.org>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/amdkfd: Remove unused functions
2025-01-12 13:41 [PATCH] drm/amdkfd: Remove unused functions linux
@ 2025-01-13 17:00 ` Alex Deucher
0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2025-01-13 17:00 UTC (permalink / raw)
To: linux
Cc: Felix.Kuehling, alexander.deucher, christian.koenig, Xinhui.Pan,
airlied, simona, amd-gfx, dri-devel, linux-kernel
Applied. Thanks!
Alex
On Sun, Jan 12, 2025 at 9:39 AM <linux@treblig.org> wrote:
>
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> 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 <linux@treblig.org>
> ---
> 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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-13 17:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-12 13:41 [PATCH] drm/amdkfd: Remove unused functions linux
2025-01-13 17:00 ` Alex Deucher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).