[PATCH 16/18] drm/radeon: Don't take dev->struct_mutex in pm functions

2015-08-10 Thread Thierry Reding
On Thu, Jul 09, 2015 at 11:32:48PM +0200, Daniel Vetter wrote:
> We already grab 2 device-global locks (write-sema rdev->pm.mclk_lock
> and rdev->ring_lock), adding another global mutex won't serialize this
> code more. And since there's really nothing interesting that gets
> protected in radeon by dev->struct mutex (we only have the global z
> buffer owners and it's still serializing gem bo destruction in the drm
> core - which is irrelevant since radeon uses ttm anyway internally)
> this doesn't add protection. Remove it.
> 
> Cc: Alex Deucher 
> Cc: "Christian König" 
> Signed-off-by: Daniel Vetter 
> ---
>  drivers/gpu/drm/radeon/radeon_pm.c | 5 -
>  1 file changed, 5 deletions(-)

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 16/18] drm/radeon: Don't take dev->struct_mutex in pm functions

2015-07-09 Thread Daniel Vetter
We already grab 2 device-global locks (write-sema rdev->pm.mclk_lock
and rdev->ring_lock), adding another global mutex won't serialize this
code more. And since there's really nothing interesting that gets
protected in radeon by dev->struct mutex (we only have the global z
buffer owners and it's still serializing gem bo destruction in the drm
core - which is irrelevant since radeon uses ttm anyway internally)
this doesn't add protection. Remove it.

Cc: Alex Deucher 
Cc: "Christian König" 
Signed-off-by: Daniel Vetter 
---
 drivers/gpu/drm/radeon/radeon_pm.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_pm.c 
b/drivers/gpu/drm/radeon/radeon_pm.c
index c1ba83a8dd8c..05751f3f8444 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -253,7 +253,6 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev)
(rdev->pm.requested_power_state_index == 
rdev->pm.current_power_state_index))
return;

-   mutex_lock(&rdev->ddev->struct_mutex);
down_write(&rdev->pm.mclk_lock);
mutex_lock(&rdev->ring_lock);

@@ -268,7 +267,6 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev)
/* needs a GPU reset dont reset here */
mutex_unlock(&rdev->ring_lock);
up_write(&rdev->pm.mclk_lock);
-   mutex_unlock(&rdev->ddev->struct_mutex);
return;
}
}
@@ -304,7 +302,6 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev)

mutex_unlock(&rdev->ring_lock);
up_write(&rdev->pm.mclk_lock);
-   mutex_unlock(&rdev->ddev->struct_mutex);
 }

 static void radeon_pm_print_states(struct radeon_device *rdev)
@@ -1062,7 +1059,6 @@ force:
radeon_dpm_print_power_state(rdev, rdev->pm.dpm.requested_ps);
}

-   mutex_lock(&rdev->ddev->struct_mutex);
down_write(&rdev->pm.mclk_lock);
mutex_lock(&rdev->ring_lock);

@@ -1113,7 +1109,6 @@ force:
 done:
mutex_unlock(&rdev->ring_lock);
up_write(&rdev->pm.mclk_lock);
-   mutex_unlock(&rdev->ddev->struct_mutex);
 }

 void radeon_dpm_enable_uvd(struct radeon_device *rdev, bool enable)
-- 
2.1.4