Skip to contentSkip to conversation

drm/exynos: dsi: do not try to find bridge

PATCH In review Inki Dae 3 participants 5 messages Jun 16, 2017 – Jun 19, 2017 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20170616075016epcas5p34938dd82d07390a03e7690f1634e9229@epcas5p3.samsung.com

Inki Dae

author maintainer
#1 lore raw

PATCH 1/1 drm/exynos: dsi: do not try to find bridge

It doesn't need to try to find a bridge if bridge node doesn't exist.

---
 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dsi.c +5 -3
index d404de8..e337cd2 100644
@@ -1687,9 +1687,11 @@ static int exynos_dsi_bind(struct device *dev, struct device *master,
 		return ret;
 	}
 
-	bridge = of_drm_find_bridge(dsi->bridge_node);
-	if (bridge)
-		drm_bridge_attach(encoder, bridge, NULL);
+	if (dsi->bridge_node) {
+		bridge = of_drm_find_bridge(dsi->bridge_node);
+		if (bridge)
+			drm_bridge_attach(encoder, bridge, NULL);
+	}
 
 	return mipi_dsi_host_register(&dsi->dsi_host);
 }
Signature · 1 line
1.9.1
Reviewed-by on v1 1/1
#2 lore raw

Hi Inki,

Quoted 12 lines · Inki Dae

It doesn't need to try to find a bridge if bridge node doesn't exist.

---
 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dsi.c +0 -0
index d404de8..e337cd2 100644

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_bind(struct device *dev, struct device *master, · line 1690

Quoted 4 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +0 -1
@@ -1687,9 +1687,11 @@ static int exynos_dsi_bind(struct device *dev, struct device *master,
                return ret;
        }
 
-       bridge = of_drm_find_bridge(dsi->bridge_node);

This is more of question than comment. I am seeing in some places, such as mtk_dpi_probe(), of_node_put() is called right after of_drm_find_bridge() whether or not bridge_node is found.

In this case, of_node_put() is done from exynos_dsi_remove() which looks correct to me.

However, there is the discrepancy. One of these is incorrect perhaps? When is the right time to call of_node_put()?

Quoted 11 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +5 -3
-       if (bridge)
-               drm_bridge_attach(encoder, bridge, NULL);
+       if (dsi->bridge_node) {
+               bridge = of_drm_find_bridge(dsi->bridge_node);
+               if (bridge)
+                       drm_bridge_attach(encoder, bridge, NULL);
+       }
 
        return mipi_dsi_host_register(&dsi->dsi_host);
 }
--
Quoted 1 line

1.9.1

Looks good to me.

thanks,
-- Shuah

Tested-by
#3 lore raw
Quoted 38 lines · Shuah Khan

Hi Inki,

Quoted 12 lines · Inki Dae

It doesn't need to try to find a bridge if bridge node doesn't exist.

---
 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dsi.c +0 -0
index d404de8..e337cd2 100644

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_bind(struct device *dev, struct device *master, · line 1690

Quoted 4 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +0 -1
@@ -1687,9 +1687,11 @@ static int exynos_dsi_bind(struct device *dev, struct device *master,
                return ret;
        }
 
-       bridge = of_drm_find_bridge(dsi->bridge_node);

This is more of question than comment. I am seeing in some places, such as mtk_dpi_probe(), of_node_put() is called right after of_drm_find_bridge() whether or not bridge_node is found.

In this case, of_node_put() is done from exynos_dsi_remove() which looks correct to me.

However, there is the discrepancy. One of these is incorrect perhaps? When is the right time to call of_node_put()?

Quoted 8 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +5 -2
-       if (bridge)
-               drm_bridge_attach(encoder, bridge, NULL);
+       if (dsi->bridge_node) {
+               bridge = of_drm_find_bridge(dsi->bridge_node);
+               if (bridge)
+                       drm_bridge_attach(encoder, bridge, NULL);
+       }
 
Quoted 9 lines
Quoted 4 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +0 -1
        return mipi_dsi_host_register(&dsi->dsi_host);
 }
--

1.9.1

Looks good to me.

I tested this on odroid-xu4

thanks,
-- Shuah

author maintainer
#4 lore raw

Hi Shuah,

2017년 06월 17일 05:16에 Shuah Khan 이(가) 쓴 글:

Quoted 25 lines · Shuah Khan
Quoted 24 lines

Hi Inki,

Quoted 12 lines · Inki Dae

It doesn't need to try to find a bridge if bridge node doesn't exist.

---
 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dsi.c +0 -0
index d404de8..e337cd2 100644

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_bind(struct device *dev, struct device *master, · line 1690

Quoted 4 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +0 -1
@@ -1687,9 +1687,11 @@ static int exynos_dsi_bind(struct device *dev, struct device *master,
                return ret;
        }
 
-       bridge = of_drm_find_bridge(dsi->bridge_node);

This is more of question than comment. I am seeing in some places, such as mtk_dpi_probe(), of_node_put() is called right after of_drm_find_bridge() whether or not bridge_node is found.

Quoted 5 lines
Quoted 5 lines

In this case, of_node_put() is done from exynos_dsi_remove() which looks correct to me.

However, there is the discrepancy. One of these is incorrect perhaps? When is the right time to call of_node_put()?

No problem but seems more reasonable to call of_node_put() right after of_drm_find_bridge() because there is no reason to keep bridge_node after binding it. Could you clean up this?

Thanks,
Inki Dae

Quoted 23 lines
Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +5 -2
-       if (bridge)
-               drm_bridge_attach(encoder, bridge, NULL);
+       if (dsi->bridge_node) {
+               bridge = of_drm_find_bridge(dsi->bridge_node);
+               if (bridge)
+                       drm_bridge_attach(encoder, bridge, NULL);
+       }
 
Quoted 9 lines
Quoted 4 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +0 -1
        return mipi_dsi_host_register(&dsi->dsi_host);
 }
--

1.9.1

Looks good to me.

I tested this on odroid-xu4

Quoted 10 lines

thanks,
-- Shuah

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

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

#5 lore raw

Hi Inki,

Quoted 31 lines · Inki Dae

Hi Shuah,

2017년 06월 17일 05:16에 Shuah Khan 이(가) 쓴 글:

Quoted 28 lines · Shuah Khan
Quoted 27 lines

Hi Inki,

Quoted 12 lines · Inki Dae

It doesn't need to try to find a bridge if bridge node doesn't exist.

---
 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dsi.c +0 -0
index d404de8..e337cd2 100644

drivers/gpu/drm/exynos/exynos_drm_dsi.c static int exynos_dsi_bind(struct device *dev, struct device *master, · line 1690

Quoted 4 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +0 -1
@@ -1687,9 +1687,11 @@ static int exynos_dsi_bind(struct device *dev, struct device *master,
                return ret;
        }
 
-       bridge = of_drm_find_bridge(dsi->bridge_node);

This is more of question than comment. I am seeing in some places, such as mtk_dpi_probe(), of_node_put() is called right after of_drm_find_bridge() whether or not bridge_node is found.

In this case, of_node_put() is done from exynos_dsi_remove() which looks correct to me.

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

However, there is the discrepancy. One of these is incorrect perhaps? When is the right time to call of_node_put()?

No problem but seems more reasonable to call of_node_put() right after of_drm_find_bridge() because there is no reason to keep bridge_node after binding it. Could you clean up this?

Thanks,
Inki Dae

Yes I will take care of cleaning this up.

thanks,
-- Shuah

Quoted 34 lines
Quoted 34 lines
Quoted 10 lines
Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +5 -2
-       if (bridge)
-               drm_bridge_attach(encoder, bridge, NULL);
+       if (dsi->bridge_node) {
+               bridge = of_drm_find_bridge(dsi->bridge_node);
+               if (bridge)
+                       drm_bridge_attach(encoder, bridge, NULL);
+       }
 
Quoted 9 lines
Quoted 4 lines
drivers/gpu/drm/exynos/exynos_drm_dsi.c +0 -1
        return mipi_dsi_host_register(&dsi->dsi_host);
 }
--

1.9.1

Looks good to me.

I tested this on odroid-xu4

thanks,
-- Shuah

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html