Skip to contentSkip to conversation

drm/msm: remove unbalanced mutex unlock

PATCH RESEND In review Daniel Mack 2 participants 4 messages May 3, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/2 drm/msm: remove unbalanced mutex unlock

This regression stems from 0e08270a1f01 ("drm/msm: Separate locking of buffer resources from struct_mutex").

Cc Sushmita Susheelendra <[email protected]>
Cc Rob Clark <[email protected]>
Fixes 0e08270a1f01 ("drm/msm: Separate locking of buffer resources from struct_mutex")

---
I'm resending these two patches as I got no reply last time.

 drivers/gpu/drm/msm/dsi/dsi_host.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +0 -1
index 0f7324a686ca..27637d8a99ff 100644
@@ -994,7 +994,6 @@ static int dsi_tx_buf_alloc(struct msm_dsi_host *msm_host, int size)
 
 		ret = msm_gem_get_iova(msm_host->tx_gem_obj,
 				priv->kms->aspace, &iova);
-		mutex_unlock(&dev->struct_mutex);
 		if (ret) {
 			pr_err("%s: failed to get iova, %d\n", __func__, ret);
 			return ret;
Signature · 6 lines
2.14.3

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH RESEND 2/2 drm/msm: use correct aspace pointer in msm_gem_put_iova()

Even though msm_gem_put_iova() is currently a NOP function, the caller should pass in the address space pointer it used to obtain the object.

Other call sites were changed in 8bdcd949bbe7e ("drm/msm: pass address-space to _get_iova() and friends"), but this one seems to have been forgotten.

---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +2 -1
index c9b14948dc25..f844ca1f8e5a 100644
@@ -1059,9 +1059,10 @@ static int dsi_tx_buf_alloc(struct msm_dsi_host *msm_host, int size)
 static void dsi_tx_buf_free(struct msm_dsi_host *msm_host)
 {
 	struct drm_device *dev = msm_host->dev;
+	struct msm_drm_private *priv = dev->dev_private;
 
 	if (msm_host->tx_gem_obj) {
-		msm_gem_put_iova(msm_host->tx_gem_obj, 0);
+		msm_gem_put_iova(msm_host->tx_gem_obj, priv->kms->aspace);
 		drm_gem_object_put_unlocked(msm_host->tx_gem_obj);
 		msm_host->tx_gem_obj = NULL;
 	}
Signature · 6 lines
2.14.3

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
In reply to Daniel Mack
Quoted 9 lines · Daniel Mack

This regression stems from 0e08270a1f01 ("drm/msm: Separate locking of buffer resources from struct_mutex").

Cc Sushmita Susheelendra <[email protected]>
Cc Rob Clark <[email protected]>
Fixes 0e08270a1f01 ("drm/msm: Separate locking of buffer resources from struct_mutex")

---
I'm resending these two patches as I got no reply last time.

I've applied these two to msm-next. Sorry I missed them before... for some reason they don't seem to show up in the dri-devel patchworks[1]

BR,
-R

[1] https://patchwork.freedesktop.org/project/dri-devel/series/

Quoted 17 lines
 drivers/gpu/drm/msm/dsi/dsi_host.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +0 -2
index 0f7324a686ca..27637d8a99ff 100644
@@ -994,7 +994,6 @@ static int dsi_tx_buf_alloc(struct msm_dsi_host *msm_host, int size)
 
                ret = msm_gem_get_iova(msm_host->tx_gem_obj,
                                priv->kms->aspace, &iova);
-               mutex_unlock(&dev->struct_mutex);
                if (ret) {
                        pr_err("%s: failed to get iova, %d\n", __func__, ret);
                        return ret;
--
Quoted 2 lines

2.14.3

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 11 lines · Rob Clark
Quoted 9 lines · Daniel Mack

This regression stems from 0e08270a1f01 ("drm/msm: Separate locking of buffer resources from struct_mutex").

Cc Sushmita Susheelendra <[email protected]>
Cc Rob Clark <[email protected]>
Fixes 0e08270a1f01 ("drm/msm: Separate locking of buffer resources from struct_mutex")

---
I'm resending these two patches as I got no reply last time.

Quoted 3 lines

I've applied these two to msm-next. Sorry I missed them before... for some reason they don't seem to show up in the dri-devel patchworks[1]

No problem, and thanks for applying them :)

Daniel

Quoted 16 lines

BR,
-R

[1] https://patchwork.freedesktop.org/project/dri-devel/series/

Quoted 10 lines
 drivers/gpu/drm/msm/dsi/dsi_host.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +0 -0
index 0f7324a686ca..27637d8a99ff 100644
@@ -994,7 +994,6 @@ static int dsi_tx_buf_alloc(struct msm_dsi_host *msm_host, int size)
 
Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/msm/dsi/dsi_host.c +0 -2
                ret = msm_gem_get_iova(msm_host->tx_gem_obj,
                                priv->kms->aspace, &iova);
-               mutex_unlock(&dev->struct_mutex);
                if (ret) {
                        pr_err("%s: failed to get iova, %d\n", __func__, ret);
                        return ret;
--

2.14.3

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel