Commit cb21f3f8 authored by Rob Clark's avatar Rob Clark

drm/msm/atomic: Drop per-CRTC locks in reverse order

lockdep dislikes seeing locks unwound in a non-nested fashion.

Fixes: b3d91800 ("drm/msm: Fix race condition in msm driver with async layer updates")
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
Reviewed-by: default avatarAbhinav Kumar <abhinavk@codeaurora.org>
parent b3d91800
...@@ -67,7 +67,7 @@ static void unlock_crtcs(struct msm_kms *kms, unsigned int crtc_mask) ...@@ -67,7 +67,7 @@ static void unlock_crtcs(struct msm_kms *kms, unsigned int crtc_mask)
{ {
struct drm_crtc *crtc; struct drm_crtc *crtc;
for_each_crtc_mask(kms->dev, crtc, crtc_mask) for_each_crtc_mask_reverse(kms->dev, crtc, crtc_mask)
mutex_unlock(&kms->commit_lock[drm_crtc_index(crtc)]); mutex_unlock(&kms->commit_lock[drm_crtc_index(crtc)]);
} }
......
...@@ -196,4 +196,8 @@ int dpu_mdss_init(struct drm_device *dev); ...@@ -196,4 +196,8 @@ int dpu_mdss_init(struct drm_device *dev);
drm_for_each_crtc(crtc, dev) \ drm_for_each_crtc(crtc, dev) \
for_each_if (drm_crtc_mask(crtc) & (crtc_mask)) for_each_if (drm_crtc_mask(crtc) & (crtc_mask))
#define for_each_crtc_mask_reverse(dev, crtc, crtc_mask) \
drm_for_each_crtc_reverse(crtc, dev) \
for_each_if (drm_crtc_mask(crtc) & (crtc_mask))
#endif /* __MSM_KMS_H__ */ #endif /* __MSM_KMS_H__ */
...@@ -1266,4 +1266,14 @@ static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev, ...@@ -1266,4 +1266,14 @@ static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev,
#define drm_for_each_crtc(crtc, dev) \ #define drm_for_each_crtc(crtc, dev) \
list_for_each_entry(crtc, &(dev)->mode_config.crtc_list, head) list_for_each_entry(crtc, &(dev)->mode_config.crtc_list, head)
/**
* drm_for_each_crtc_reverse - iterate over all CRTCs in reverse order
* @crtc: a &struct drm_crtc as the loop cursor
* @dev: the &struct drm_device
*
* Iterate over all CRTCs of @dev.
*/
#define drm_for_each_crtc_reverse(crtc, dev) \
list_for_each_entry_reverse(crtc, &(dev)->mode_config.crtc_list, head)
#endif /* __DRM_CRTC_H__ */ #endif /* __DRM_CRTC_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment