[PATCH 17/18] drm/amdgpu: Don't take dev->struct_mutex in bo_force_delete

2015-08-10 Thread Thierry Reding
On Thu, Jul 09, 2015 at 11:32:49PM +0200, Daniel Vetter wrote:
> It really doesn't protect anything which doesn't have other locks
> already. Also this is run from driver unload code so not much need for
> locks anyway.
> 
> Same changes as for readone really.

s/radeone/radeon/

Otherwise:

Reviewed-by: Thierry Reding 
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: 



[PATCH 17/18] drm/amdgpu: Don't take dev->struct_mutex in bo_force_delete

2015-07-10 Thread Daniel Vetter
It really doesn't protect anything which doesn't have other locks
already. Also this is run from driver unload code so not much need for
locks anyway.

Same changes as for readone really.

Cc: Alex Deucher 
Cc: "Christian König" 
Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 8da64245b31b..97422bf3b7d5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -478,7 +478,6 @@ void amdgpu_bo_force_delete(struct amdgpu_device *adev)
}
dev_err(adev->dev, "Userspace still has active objects !\n");
list_for_each_entry_safe(bo, n, >gem.objects, list) {
-   mutex_lock(>ddev->struct_mutex);
dev_err(adev->dev, "%p %p %lu %lu force free\n",
>gem_base, bo, (unsigned long)bo->gem_base.size,
*((unsigned long *)>gem_base.refcount));
@@ -486,8 +485,7 @@ void amdgpu_bo_force_delete(struct amdgpu_device *adev)
list_del_init(>list);
mutex_unlock(>adev->gem.mutex);
/* this should unref the ttm bo */
-   drm_gem_object_unreference(>gem_base);
-   mutex_unlock(>ddev->struct_mutex);
+   drm_gem_object_unreference_unlocked(>gem_base);
}
 }

-- 
2.1.4