Skip to content

Commit a0f2084

Browse files
ChristianKoenigAMDalexdeucher
authored andcommitted
drm/amdgpu: nuke amdgpu_bo_list_free
The RCU grace period is harmless and avoiding it is not worth the effort of doubling the implementation. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 81c6dab commit a0f2084

3 files changed

Lines changed: 2 additions & 14 deletions

File tree

‎drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -231,17 +231,6 @@ void amdgpu_bo_list_put(struct amdgpu_bo_list *list)
231231
kref_put(&list->refcount, amdgpu_bo_list_release_rcu);
232232
}
233233

234-
void amdgpu_bo_list_free(struct amdgpu_bo_list *list)
235-
{
236-
unsigned i;
237-
238-
for (i = 0; i < list->num_entries; ++i)
239-
amdgpu_bo_unref(&list->array[i].robj);
240-
241-
kvfree(list->array);
242-
kfree(list);
243-
}
244-
245234
int amdgpu_bo_create_list_entry_array(struct drm_amdgpu_bo_list_in *in,
246235
struct drm_amdgpu_bo_list_entry **info_param)
247236
{
@@ -310,7 +299,7 @@ int amdgpu_bo_list_ioctl(struct drm_device *dev, void *data,
310299
r = idr_alloc(&fpriv->bo_list_handles, list, 1, 0, GFP_KERNEL);
311300
mutex_unlock(&fpriv->bo_list_lock);
312301
if (r < 0) {
313-
amdgpu_bo_list_free(list);
302+
amdgpu_bo_list_put(list);
314303
return r;
315304
}
316305

‎drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ int amdgpu_bo_list_get(struct amdgpu_fpriv *fpriv, int id,
5656
void amdgpu_bo_list_get_list(struct amdgpu_bo_list *list,
5757
struct list_head *validated);
5858
void amdgpu_bo_list_put(struct amdgpu_bo_list *list);
59-
void amdgpu_bo_list_free(struct amdgpu_bo_list *list);
6059
int amdgpu_bo_create_list_entry_array(struct drm_amdgpu_bo_list_in *in,
6160
struct drm_amdgpu_bo_list_entry **info_param);
6261

‎drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
967967
amdgpu_bo_unref(&pd);
968968

969969
idr_for_each_entry(&fpriv->bo_list_handles, list, handle)
970-
amdgpu_bo_list_free(list);
970+
amdgpu_bo_list_put(list);
971971

972972
idr_destroy(&fpriv->bo_list_handles);
973973
mutex_destroy(&fpriv->bo_list_lock);

0 commit comments

Comments
 (0)