mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
PM / devfreq: clk-ddr: using drm_modeset mutex when get lcdc type
Because ddr freq scanning may get clk mutex than get drm general mutex to get lcdc_type. But when drm status change, drm may get drm general mutex first and than get clk mutex. This may cause deadlock. So when get lcdc type we change to use drm_modeset mutex to avoid deadlock. Change-Id: Ibaa1c07b14df7e1a861162efd9f7e086b8a55042 Signed-off-by: Tang Yun ping <typ@rock-chips.com>
This commit is contained in:
committed by
Huang, Tao
parent
e5c0ce02f2
commit
404f22df36
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
#include <drm/drmP.h>
|
||||
#include <drm/drm_modeset_lock.h>
|
||||
#include <dt-bindings/display/rk_fb.h>
|
||||
#include <linux/arm-smccc.h>
|
||||
#include <linux/clk.h>
|
||||
@@ -52,14 +53,14 @@ static int rk_drm_get_lcdc_type(void)
|
||||
if (drm) {
|
||||
struct drm_connector *conn;
|
||||
|
||||
mutex_lock(&drm->mode_config.mutex);
|
||||
drm_modeset_lock(&drm->mode_config.connection_mutex, NULL);
|
||||
drm_for_each_connector(conn, drm) {
|
||||
if (conn->encoder) {
|
||||
lcdc_type = conn->connector_type;
|
||||
break;
|
||||
}
|
||||
}
|
||||
mutex_unlock(&drm->mode_config.mutex);
|
||||
drm_modeset_unlock(&drm->mode_config.connection_mutex);
|
||||
}
|
||||
|
||||
switch (lcdc_type) {
|
||||
|
||||
Reference in New Issue
Block a user