public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] AMDGPU deadcode
@ 2024-09-23  1:24 linux
  2024-09-23  1:24 ` [PATCH 1/5] drm/amdgpu: Remove unused amdgpu_device_ip_is_idle linux
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: linux @ 2024-09-23  1:24 UTC (permalink / raw)
  To: 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>

Hi,
  This is a bunch of deadcode removal in amdgpu;
some of the functions are ones which were previously
used but haven't been for a while, others are functions
that were added a few years ago and haven't ever been used.

  There are some others that I've not removed, which have
been added in the last few years but not been used,
I was worried maybe there are patches in someones tree
about to use them (e.g. amdgpu_lsdma_copy_mem, amdgpu_mes_reg_wait,
amdgpu_ras_unbind_aca, amdgpu_seq64_alloc, and
amdgpu_xcp_prepare_resume) - I'd be happy to take those as
well.

  One other thing I wasn't sure of; I removed
amdgpu_device_ip_is_idle
which has been unused since about 2016, but does that make
the 'is_idle' methods unused or is there something else that calls
them?

(Sent from this kernel booted on my RX550 GPU)

Dave

Dr. David Alan Gilbert (5):
  drm/amdgpu: Remove unused amdgpu_device_ip_is_idle
  drm/amdgpu: Remove unused amdgpu_atpx functions
  drm/amdgpu: Remove unused amdgpu_gmc_vram_cpu_pa
  drm/amdgpu: Remove unused amdgpu_gfx_bit_to_me_queue
  drm/amdgpu: Remove unused amdgpu_i2c functions

 drivers/gpu/drm/amd/amdgpu/amdgpu.h           | 10 --------
 .../gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c  | 12 ---------
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    | 24 ------------------
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c       | 10 --------
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h       |  2 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c       | 12 ---------
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h       |  1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c       | 25 -------------------
 drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.h       |  4 ---
 9 files changed, 100 deletions(-)

-- 
2.46.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/5] drm/amdgpu: Remove unused amdgpu_device_ip_is_idle
  2024-09-23  1:24 [PATCH 0/5] AMDGPU deadcode linux
@ 2024-09-23  1:24 ` linux
  2024-09-23  1:24 ` [PATCH 2/5] drm/amdgpu: Remove unused amdgpu_atpx functions linux
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: linux @ 2024-09-23  1:24 UTC (permalink / raw)
  To: 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>

amdgpu_device_ip_is_idle is unused.
It was renamed from 'amdgpu_is_idle' which was originally added in
commit 5dbbb60ba61e ("drm/amdgpu: add IP helpers for wait_for_idle and is_idle")

but hasn't been used.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  2 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 24 ----------------------
 2 files changed, 26 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index dcd59040c449..c654668e2a56 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -365,8 +365,6 @@ void amdgpu_device_ip_get_clockgating_state(struct amdgpu_device *adev,
 					    u64 *flags);
 int amdgpu_device_ip_wait_for_idle(struct amdgpu_device *adev,
 				   enum amd_ip_block_type block_type);
-bool amdgpu_device_ip_is_idle(struct amdgpu_device *adev,
-			      enum amd_ip_block_type block_type);
 
 #define AMDGPU_MAX_IP_NUM 16
 
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index f4628412dac4..dc4679e53463 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2169,30 +2169,6 @@ int amdgpu_device_ip_wait_for_idle(struct amdgpu_device *adev,
 
 }
 
-/**
- * amdgpu_device_ip_is_idle - is the hardware IP idle
- *
- * @adev: amdgpu_device pointer
- * @block_type: Type of hardware IP (SMU, GFX, UVD, etc.)
- *
- * Check if the hardware IP is idle or not.
- * Returns true if it the IP is idle, false if not.
- */
-bool amdgpu_device_ip_is_idle(struct amdgpu_device *adev,
-			      enum amd_ip_block_type block_type)
-{
-	int i;
-
-	for (i = 0; i < adev->num_ip_blocks; i++) {
-		if (!adev->ip_blocks[i].status.valid)
-			continue;
-		if (adev->ip_blocks[i].version->type == block_type)
-			return adev->ip_blocks[i].version->funcs->is_idle((void *)adev);
-	}
-	return true;
-
-}
-
 /**
  * amdgpu_device_ip_get_ip_block - get a hw IP pointer
  *
-- 
2.46.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/5] drm/amdgpu: Remove unused amdgpu_atpx functions
  2024-09-23  1:24 [PATCH 0/5] AMDGPU deadcode linux
  2024-09-23  1:24 ` [PATCH 1/5] drm/amdgpu: Remove unused amdgpu_device_ip_is_idle linux
@ 2024-09-23  1:24 ` linux
  2024-09-23  1:24 ` [PATCH 3/5] drm/amdgpu: Remove unused amdgpu_gmc_vram_cpu_pa linux
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: linux @ 2024-09-23  1:24 UTC (permalink / raw)
  To: 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>

amdgpu_atpx_dgpu_req_power_for_displays has been unused since
commit bdb1ccb080da ("drm/amdgpu: remove ATPX_DGPU_REQ_POWER_FOR_DISPLAYS
check when hotplug-in")

amdgpu_atpx_get_dhandle has been unused since commit
f9b7f3703ff9 ("drm/amdgpu/acpi: make ATPX/ATCS structures global (v2)")

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h              |  8 --------
 drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 12 ------------
 2 files changed, 20 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index c654668e2a56..f360296fc9da 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1452,23 +1452,15 @@ void amdgpu_register_atpx_handler(void);
 void amdgpu_unregister_atpx_handler(void);
 bool amdgpu_has_atpx_dgpu_power_cntl(void);
 bool amdgpu_is_atpx_hybrid(void);
-bool amdgpu_atpx_dgpu_req_power_for_displays(void);
 bool amdgpu_has_atpx(void);
 #else
 static inline void amdgpu_register_atpx_handler(void) {}
 static inline void amdgpu_unregister_atpx_handler(void) {}
 static inline bool amdgpu_has_atpx_dgpu_power_cntl(void) { return false; }
 static inline bool amdgpu_is_atpx_hybrid(void) { return false; }
-static inline bool amdgpu_atpx_dgpu_req_power_for_displays(void) { return false; }
 static inline bool amdgpu_has_atpx(void) { return false; }
 #endif
 
-#if defined(CONFIG_VGA_SWITCHEROO) && defined(CONFIG_ACPI)
-void *amdgpu_atpx_get_dhandle(void);
-#else
-static inline void *amdgpu_atpx_get_dhandle(void) { return NULL; }
-#endif
-
 /*
  * KMS
  */
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
index 375f02002579..3893e6fc2f03 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
@@ -89,18 +89,6 @@ bool amdgpu_is_atpx_hybrid(void)
 	return amdgpu_atpx_priv.atpx.is_hybrid;
 }
 
-bool amdgpu_atpx_dgpu_req_power_for_displays(void)
-{
-	return amdgpu_atpx_priv.atpx.dgpu_req_power_for_displays;
-}
-
-#if defined(CONFIG_ACPI)
-void *amdgpu_atpx_get_dhandle(void)
-{
-	return amdgpu_atpx_priv.dhandle;
-}
-#endif
-
 /**
  * amdgpu_atpx_call - call an ATPX method
  *
-- 
2.46.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/5] drm/amdgpu: Remove unused amdgpu_gmc_vram_cpu_pa
  2024-09-23  1:24 [PATCH 0/5] AMDGPU deadcode linux
  2024-09-23  1:24 ` [PATCH 1/5] drm/amdgpu: Remove unused amdgpu_device_ip_is_idle linux
  2024-09-23  1:24 ` [PATCH 2/5] drm/amdgpu: Remove unused amdgpu_atpx functions linux
@ 2024-09-23  1:24 ` linux
  2024-09-23  1:24 ` [PATCH 4/5] drm/amdgpu: Remove unused amdgpu_gfx_bit_to_me_queue linux
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: linux @ 2024-09-23  1:24 UTC (permalink / raw)
  To: 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>

amdgpu_gmc_vram_cpu_pa has been unused since commit
087451f372bf ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's.")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 12 ------------
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h |  1 -
 2 files changed, 13 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
index 17a19d49d30a..58b5c436ad15 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
@@ -1065,18 +1065,6 @@ uint64_t amdgpu_gmc_vram_pa(struct amdgpu_device *adev, struct amdgpu_bo *bo)
 	return amdgpu_gmc_vram_mc2pa(adev, amdgpu_bo_gpu_offset(bo));
 }
 
-/**
- * amdgpu_gmc_vram_cpu_pa - calculate vram buffer object's physical address
- * from CPU's view
- *
- * @adev: amdgpu_device pointer
- * @bo: amdgpu buffer object
- */
-uint64_t amdgpu_gmc_vram_cpu_pa(struct amdgpu_device *adev, struct amdgpu_bo *bo)
-{
-	return amdgpu_bo_gpu_offset(bo) - adev->gmc.vram_start + adev->gmc.aper_base;
-}
-
 int amdgpu_gmc_vram_checking(struct amdgpu_device *adev)
 {
 	struct amdgpu_bo *vram_bo = NULL;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
index 4d951a1baefa..e0bed91dd5a0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
@@ -447,7 +447,6 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev);
 void amdgpu_gmc_init_pdb0(struct amdgpu_device *adev);
 uint64_t amdgpu_gmc_vram_mc2pa(struct amdgpu_device *adev, uint64_t mc_addr);
 uint64_t amdgpu_gmc_vram_pa(struct amdgpu_device *adev, struct amdgpu_bo *bo);
-uint64_t amdgpu_gmc_vram_cpu_pa(struct amdgpu_device *adev, struct amdgpu_bo *bo);
 int amdgpu_gmc_vram_checking(struct amdgpu_device *adev);
 int amdgpu_gmc_sysfs_init(struct amdgpu_device *adev);
 void amdgpu_gmc_sysfs_fini(struct amdgpu_device *adev);
-- 
2.46.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/5] drm/amdgpu: Remove unused amdgpu_gfx_bit_to_me_queue
  2024-09-23  1:24 [PATCH 0/5] AMDGPU deadcode linux
                   ` (2 preceding siblings ...)
  2024-09-23  1:24 ` [PATCH 3/5] drm/amdgpu: Remove unused amdgpu_gmc_vram_cpu_pa linux
@ 2024-09-23  1:24 ` linux
  2024-09-23  1:24 ` [PATCH 5/5] drm/amdgpu: Remove unused amdgpu_i2c functions linux
  2024-09-24 17:13 ` [PATCH 0/5] AMDGPU deadcode Alex Deucher
  5 siblings, 0 replies; 9+ messages in thread
From: linux @ 2024-09-23  1:24 UTC (permalink / raw)
  To: 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>

amdgpu_gfx_bit_to_me_queue has been unused since it was added in
commit 7470bfcf2014 ("drm/amdgpu: add helper function for gfx queue/bitmap
transition")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 10 ----------
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h |  2 --
 2 files changed, 12 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index 83e54697f0ee..0fbb7c7b736d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -87,16 +87,6 @@ int amdgpu_gfx_me_queue_to_bit(struct amdgpu_device *adev,
 	return bit;
 }
 
-void amdgpu_gfx_bit_to_me_queue(struct amdgpu_device *adev, int bit,
-				int *me, int *pipe, int *queue)
-{
-	*queue = bit % adev->gfx.me.num_queue_per_pipe;
-	*pipe = (bit / adev->gfx.me.num_queue_per_pipe)
-		% adev->gfx.me.num_pipe_per_me;
-	*me = (bit / adev->gfx.me.num_queue_per_pipe)
-		/ adev->gfx.me.num_pipe_per_me;
-}
-
 bool amdgpu_gfx_is_me_queue_enabled(struct amdgpu_device *adev,
 				    int me, int pipe, int queue)
 {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
index 5644e10a86a9..f710178a21bc 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
@@ -540,8 +540,6 @@ bool amdgpu_gfx_is_high_priority_graphics_queue(struct amdgpu_device *adev,
 						struct amdgpu_ring *ring);
 int amdgpu_gfx_me_queue_to_bit(struct amdgpu_device *adev, int me,
 			       int pipe, int queue);
-void amdgpu_gfx_bit_to_me_queue(struct amdgpu_device *adev, int bit,
-				int *me, int *pipe, int *queue);
 bool amdgpu_gfx_is_me_queue_enabled(struct amdgpu_device *adev, int me,
 				    int pipe, int queue);
 void amdgpu_gfx_off_ctrl(struct amdgpu_device *adev, bool enable);
-- 
2.46.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/5] drm/amdgpu: Remove unused amdgpu_i2c functions
  2024-09-23  1:24 [PATCH 0/5] AMDGPU deadcode linux
                   ` (3 preceding siblings ...)
  2024-09-23  1:24 ` [PATCH 4/5] drm/amdgpu: Remove unused amdgpu_gfx_bit_to_me_queue linux
@ 2024-09-23  1:24 ` linux
  2024-09-24 17:05   ` Alex Deucher
  2024-09-24 17:13 ` [PATCH 0/5] AMDGPU deadcode Alex Deucher
  5 siblings, 1 reply; 9+ messages in thread
From: linux @ 2024-09-23  1:24 UTC (permalink / raw)
  To: 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>

amdgpu_i2c_add and amdgpu_i2c_init were added in 2015's commit
d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)")
but never used.

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c | 25 -------------------------
 drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.h |  4 ----
 2 files changed, 29 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
index 00d6211e0fbf..f0765ccde668 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
@@ -225,15 +225,6 @@ void amdgpu_i2c_destroy(struct amdgpu_i2c_chan *i2c)
 	kfree(i2c);
 }
 
-/* Add the default buses */
-void amdgpu_i2c_init(struct amdgpu_device *adev)
-{
-	if (amdgpu_hw_i2c)
-		DRM_INFO("hw_i2c forced on, you may experience display detection problems!\n");
-
-	amdgpu_atombios_i2c_init(adev);
-}
-
 /* remove all the buses */
 void amdgpu_i2c_fini(struct amdgpu_device *adev)
 {
@@ -247,22 +238,6 @@ void amdgpu_i2c_fini(struct amdgpu_device *adev)
 	}
 }
 
-/* Add additional buses */
-void amdgpu_i2c_add(struct amdgpu_device *adev,
-		    const struct amdgpu_i2c_bus_rec *rec,
-		    const char *name)
-{
-	struct drm_device *dev = adev_to_drm(adev);
-	int i;
-
-	for (i = 0; i < AMDGPU_MAX_I2C_BUS; i++) {
-		if (!adev->i2c_bus[i]) {
-			adev->i2c_bus[i] = amdgpu_i2c_create(dev, rec, name);
-			return;
-		}
-	}
-}
-
 /* looks up bus based on id */
 struct amdgpu_i2c_chan *
 amdgpu_i2c_lookup(struct amdgpu_device *adev,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.h
index 63c2ff7499e1..21e3d1dad0a1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.h
@@ -28,11 +28,7 @@ struct amdgpu_i2c_chan *amdgpu_i2c_create(struct drm_device *dev,
 					  const struct amdgpu_i2c_bus_rec *rec,
 					  const char *name);
 void amdgpu_i2c_destroy(struct amdgpu_i2c_chan *i2c);
-void amdgpu_i2c_init(struct amdgpu_device *adev);
 void amdgpu_i2c_fini(struct amdgpu_device *adev);
-void amdgpu_i2c_add(struct amdgpu_device *adev,
-		    const struct amdgpu_i2c_bus_rec *rec,
-		    const char *name);
 struct amdgpu_i2c_chan *
 amdgpu_i2c_lookup(struct amdgpu_device *adev,
 		  const struct amdgpu_i2c_bus_rec *i2c_bus);
-- 
2.46.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 5/5] drm/amdgpu: Remove unused amdgpu_i2c functions
  2024-09-23  1:24 ` [PATCH 5/5] drm/amdgpu: Remove unused amdgpu_i2c functions linux
@ 2024-09-24 17:05   ` Alex Deucher
  0 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2024-09-24 17:05 UTC (permalink / raw)
  To: linux
  Cc: alexander.deucher, christian.koenig, Xinhui.Pan, airlied, simona,
	amd-gfx, dri-devel, linux-kernel

Applied the series.  Thanks!

Alex

On Sun, Sep 22, 2024 at 9:43 PM <linux@treblig.org> wrote:
>
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> amdgpu_i2c_add and amdgpu_i2c_init were added in 2015's commit
> d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)")
> but never used.
>
> Remove them.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c | 25 -------------------------
>  drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.h |  4 ----
>  2 files changed, 29 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
> index 00d6211e0fbf..f0765ccde668 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
> @@ -225,15 +225,6 @@ void amdgpu_i2c_destroy(struct amdgpu_i2c_chan *i2c)
>         kfree(i2c);
>  }
>
> -/* Add the default buses */
> -void amdgpu_i2c_init(struct amdgpu_device *adev)
> -{
> -       if (amdgpu_hw_i2c)
> -               DRM_INFO("hw_i2c forced on, you may experience display detection problems!\n");
> -
> -       amdgpu_atombios_i2c_init(adev);
> -}
> -
>  /* remove all the buses */
>  void amdgpu_i2c_fini(struct amdgpu_device *adev)
>  {
> @@ -247,22 +238,6 @@ void amdgpu_i2c_fini(struct amdgpu_device *adev)
>         }
>  }
>
> -/* Add additional buses */
> -void amdgpu_i2c_add(struct amdgpu_device *adev,
> -                   const struct amdgpu_i2c_bus_rec *rec,
> -                   const char *name)
> -{
> -       struct drm_device *dev = adev_to_drm(adev);
> -       int i;
> -
> -       for (i = 0; i < AMDGPU_MAX_I2C_BUS; i++) {
> -               if (!adev->i2c_bus[i]) {
> -                       adev->i2c_bus[i] = amdgpu_i2c_create(dev, rec, name);
> -                       return;
> -               }
> -       }
> -}
> -
>  /* looks up bus based on id */
>  struct amdgpu_i2c_chan *
>  amdgpu_i2c_lookup(struct amdgpu_device *adev,
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.h
> index 63c2ff7499e1..21e3d1dad0a1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.h
> @@ -28,11 +28,7 @@ struct amdgpu_i2c_chan *amdgpu_i2c_create(struct drm_device *dev,
>                                           const struct amdgpu_i2c_bus_rec *rec,
>                                           const char *name);
>  void amdgpu_i2c_destroy(struct amdgpu_i2c_chan *i2c);
> -void amdgpu_i2c_init(struct amdgpu_device *adev);
>  void amdgpu_i2c_fini(struct amdgpu_device *adev);
> -void amdgpu_i2c_add(struct amdgpu_device *adev,
> -                   const struct amdgpu_i2c_bus_rec *rec,
> -                   const char *name);
>  struct amdgpu_i2c_chan *
>  amdgpu_i2c_lookup(struct amdgpu_device *adev,
>                   const struct amdgpu_i2c_bus_rec *i2c_bus);
> --
> 2.46.1
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/5] AMDGPU deadcode
  2024-09-23  1:24 [PATCH 0/5] AMDGPU deadcode linux
                   ` (4 preceding siblings ...)
  2024-09-23  1:24 ` [PATCH 5/5] drm/amdgpu: Remove unused amdgpu_i2c functions linux
@ 2024-09-24 17:13 ` Alex Deucher
  2024-09-24 17:38   ` Dr. David Alan Gilbert
  5 siblings, 1 reply; 9+ messages in thread
From: Alex Deucher @ 2024-09-24 17:13 UTC (permalink / raw)
  To: linux
  Cc: alexander.deucher, christian.koenig, Xinhui.Pan, airlied, simona,
	amd-gfx, dri-devel, linux-kernel

On Sun, Sep 22, 2024 at 9:43 PM <linux@treblig.org> wrote:
>
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> Hi,
>   This is a bunch of deadcode removal in amdgpu;
> some of the functions are ones which were previously
> used but haven't been for a while, others are functions
> that were added a few years ago and haven't ever been used.
>
>   There are some others that I've not removed, which have
> been added in the last few years but not been used,
> I was worried maybe there are patches in someones tree
> about to use them (e.g. amdgpu_lsdma_copy_mem, amdgpu_mes_reg_wait,
> amdgpu_ras_unbind_aca, amdgpu_seq64_alloc, and
> amdgpu_xcp_prepare_resume) - I'd be happy to take those as
> well.

There are patches in flight that make use of at least some of these.
For example, the seq64 functions are used by the user queues patches
which are being reviewed now.  Feel free to send out patches though if
you are inclined.  If someone has plans to use something, they can
bring that up in the patch review.

>
>   One other thing I wasn't sure of; I removed
> amdgpu_device_ip_is_idle
> which has been unused since about 2016, but does that make
> the 'is_idle' methods unused or is there something else that calls
> them?

They've been used on and off in proposed patches over the years.  Some
of the IP specific code may call the IP specific is idle functions
directly rather than using the callbacks.

Alex

>
> (Sent from this kernel booted on my RX550 GPU)
>
> Dave
>
> Dr. David Alan Gilbert (5):
>   drm/amdgpu: Remove unused amdgpu_device_ip_is_idle
>   drm/amdgpu: Remove unused amdgpu_atpx functions
>   drm/amdgpu: Remove unused amdgpu_gmc_vram_cpu_pa
>   drm/amdgpu: Remove unused amdgpu_gfx_bit_to_me_queue
>   drm/amdgpu: Remove unused amdgpu_i2c functions
>
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h           | 10 --------
>  .../gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c  | 12 ---------
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    | 24 ------------------
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c       | 10 --------
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h       |  2 --
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c       | 12 ---------
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h       |  1 -
>  drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c       | 25 -------------------
>  drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.h       |  4 ---
>  9 files changed, 100 deletions(-)
>
> --
> 2.46.1
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/5] AMDGPU deadcode
  2024-09-24 17:13 ` [PATCH 0/5] AMDGPU deadcode Alex Deucher
@ 2024-09-24 17:38   ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 9+ messages in thread
From: Dr. David Alan Gilbert @ 2024-09-24 17:38 UTC (permalink / raw)
  To: Alex Deucher
  Cc: alexander.deucher, christian.koenig, Xinhui.Pan, airlied, simona,
	amd-gfx, dri-devel, linux-kernel

* Alex Deucher (alexdeucher@gmail.com) wrote:
> On Sun, Sep 22, 2024 at 9:43 PM <linux@treblig.org> wrote:
> >
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> >
> > Hi,
> >   This is a bunch of deadcode removal in amdgpu;
> > some of the functions are ones which were previously
> > used but haven't been for a while, others are functions
> > that were added a few years ago and haven't ever been used.
> >
> >   There are some others that I've not removed, which have
> > been added in the last few years but not been used,
> > I was worried maybe there are patches in someones tree
> > about to use them (e.g. amdgpu_lsdma_copy_mem, amdgpu_mes_reg_wait,
> > amdgpu_ras_unbind_aca, amdgpu_seq64_alloc, and
> > amdgpu_xcp_prepare_resume) - I'd be happy to take those as
> > well.

Hi Alex,
  Thanks for taking the series, and the reply.

> There are patches in flight that make use of at least some of these.
> For example, the seq64 functions are used by the user queues patches
> which are being reviewed now.  Feel free to send out patches though if
> you are inclined.  If someone has plans to use something, they can
> bring that up in the patch review.

OK, I've made myself a note and will swing back at some point.

> >   One other thing I wasn't sure of; I removed
> > amdgpu_device_ip_is_idle
> > which has been unused since about 2016, but does that make
> > the 'is_idle' methods unused or is there something else that calls
> > them?
> 
> They've been used on and off in proposed patches over the years.  Some
> of the IP specific code may call the IP specific is idle functions
> directly rather than using the callbacks.

Do you think the 'is_idle' member itself should go?

Dave

> Alex
> 
> >
> > (Sent from this kernel booted on my RX550 GPU)
> >
> > Dave
> >
> > Dr. David Alan Gilbert (5):
> >   drm/amdgpu: Remove unused amdgpu_device_ip_is_idle
> >   drm/amdgpu: Remove unused amdgpu_atpx functions
> >   drm/amdgpu: Remove unused amdgpu_gmc_vram_cpu_pa
> >   drm/amdgpu: Remove unused amdgpu_gfx_bit_to_me_queue
> >   drm/amdgpu: Remove unused amdgpu_i2c functions
> >
> >  drivers/gpu/drm/amd/amdgpu/amdgpu.h           | 10 --------
> >  .../gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c  | 12 ---------
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    | 24 ------------------
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c       | 10 --------
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h       |  2 --
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c       | 12 ---------
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h       |  1 -
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c       | 25 -------------------
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.h       |  4 ---
> >  9 files changed, 100 deletions(-)
> >
> > --
> > 2.46.1
> >
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-09-24 17:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-23  1:24 [PATCH 0/5] AMDGPU deadcode linux
2024-09-23  1:24 ` [PATCH 1/5] drm/amdgpu: Remove unused amdgpu_device_ip_is_idle linux
2024-09-23  1:24 ` [PATCH 2/5] drm/amdgpu: Remove unused amdgpu_atpx functions linux
2024-09-23  1:24 ` [PATCH 3/5] drm/amdgpu: Remove unused amdgpu_gmc_vram_cpu_pa linux
2024-09-23  1:24 ` [PATCH 4/5] drm/amdgpu: Remove unused amdgpu_gfx_bit_to_me_queue linux
2024-09-23  1:24 ` [PATCH 5/5] drm/amdgpu: Remove unused amdgpu_i2c functions linux
2024-09-24 17:05   ` Alex Deucher
2024-09-24 17:13 ` [PATCH 0/5] AMDGPU deadcode Alex Deucher
2024-09-24 17:38   ` Dr. David Alan Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox