Skip to contentSkip to conversation

drm/stm: ltdc: fix deferred endpoint management

PATCH In review Philippe Cornu 2 participants 3 messages Apr 17, 2018 – Apr 27, 2018

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

PATCH 1/1 drm/stm: ltdc: fix deferred endpoint management

When a driver related to one of the endpoints is deferred due to probe dependencies (i2c, spi...) but the other one is ready, ltdc probe continues and the deferred driver will never be probed again.

The fix consists in waiting for all deferred endpoints before continuing the ltdc probe.

---
 drivers/gpu/drm/stm/ltdc.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/gpu/drm/stm/ltdc.c +5 -6
index e3121d9e4230..014cef8cef37 100644
@@ -987,14 +987,13 @@ int ltdc_load(struct drm_device *ddev)
 						  &bridge[i]);
 
 		/*
-		 * If at least one endpoint is ready, continue probing,
-		 * else if at least one endpoint is -EPROBE_DEFER and
-		 * there is no previous ready endpoints, defer probing.
+		 * If at least one endpoint is -EPROBE_DEFER, defer probing,
+		 * else if at least one endpoint is ready, continue probing.
 		 */
-		if (!ret)
+		if (ret == -EPROBE_DEFER)
+			return ret;
+		else if (!ret)
 			endpoint_not_ready = 0;
-		else if (ret == -EPROBE_DEFER && endpoint_not_ready)
-			endpoint_not_ready = -EPROBE_DEFER;
 	}
 
 	if (endpoint_not_ready)
Signature · 6 lines
2.15.1

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

Hi Philippe,

Quoted 38 lines · Philippe Cornu

When a driver related to one of the endpoints is deferred due to probe dependencies (i2c, spi...) but the other one is ready, ltdc probe continues and the deferred driver will never be probed again.

The fix consists in waiting for all deferred endpoints before continuing the ltdc probe.

---
  drivers/gpu/drm/stm/ltdc.c | 11 +++++------
  1 file changed, 5 insertions(+), 6 deletions(-)
drivers/gpu/drm/stm/ltdc.c +5 -6
index e3121d9e4230..014cef8cef37 100644
@@ -987,14 +987,13 @@ int ltdc_load(struct drm_device *ddev)
  						  &bridge[i]);
 
  		/*
-		 * If at least one endpoint is ready, continue probing,
-		 * else if at least one endpoint is -EPROBE_DEFER and
-		 * there is no previous ready endpoints, defer probing.
+		 * If at least one endpoint is -EPROBE_DEFER, defer probing,
+		 * else if at least one endpoint is ready, continue probing.
  		 */
-		if (!ret)
+		if (ret == -EPROBE_DEFER)
+			return ret;
+		else if (!ret)
  			endpoint_not_ready = 0;
-		else if (ret == -EPROBE_DEFER && endpoint_not_ready)
-			endpoint_not_ready = -EPROBE_DEFER;
  	}
 
  	if (endpoint_not_ready)
#2 lore raw
Quoted 3 lines · Yannick FERTRE

Hi Philippe,

Applied on drm-misc-next.
Many thanks,
Philippe :-)

Quoted 39 lines · Philippe Cornu
Quoted 36 lines

When a driver related to one of the endpoints is deferred due to probe dependencies (i2c, spi...) but the other one is ready, ltdc probe continues and the deferred driver will never be probed again.

The fix consists in waiting for all deferred endpoints before continuing the ltdc probe.

---
   drivers/gpu/drm/stm/ltdc.c | 11 +++++------
   1 file changed, 5 insertions(+), 6 deletions(-)
drivers/gpu/drm/stm/ltdc.c +5 -6
index e3121d9e4230..014cef8cef37 100644
@@ -987,14 +987,13 @@ int ltdc_load(struct drm_device *ddev)
   						  &bridge[i]);
 
   		/*
-		 * If at least one endpoint is ready, continue probing,
-		 * else if at least one endpoint is -EPROBE_DEFER and
-		 * there is no previous ready endpoints, defer probing.
+		 * If at least one endpoint is -EPROBE_DEFER, defer probing,
+		 * else if at least one endpoint is ready, continue probing.
   		 */
-		if (!ret)
+		if (ret == -EPROBE_DEFER)
+			return ret;
+		else if (!ret)
   			endpoint_not_ready = 0;
-		else if (ret == -EPROBE_DEFER && endpoint_not_ready)
-			endpoint_not_ready = -EPROBE_DEFER;
   	}
 
Quoted 1 line

drivers/gpu/drm/stm/ltdc.c int ltdc_load(struct drm_device *ddev) · line 999

Quoted 1 line
drivers/gpu/drm/stm/ltdc.c +0 -0
   	if (endpoint_not_ready)

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