Skip to contentSkip to conversation

video, da8xx-fb: fix time out in wait_for_event()

PATCH New Heinrich Schuchardt 2 participants 2 messages Mar 18, 2018 – Mar 19, 2018 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video, da8xx-fb: fix time out in wait_for_event()

If an event does not occur the current coding stays in an endless loop.

---
 drivers/video/da8xx-fb.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/video/da8xx-fb.c +3 -2
index 6ec4f89e34..26db73b138 100644
@@ -853,9 +853,10 @@ static u32 wait_for_event(u32 event)
 	do {
 		ret = lcdc_irq_handler();
 		udelay(1000);
-	} while (!(ret & event));
+		--timeout;
+	} while (!(ret & event) && timeout);
 
-	if (timeout <= 0) {
+	if (!(ret & event)) {
 		printf("%s: event %d not hit\n", __func__, event);
 		return -1;
 	}
Signature · 1 line
2.16.2
#1 lore raw

PATCH 1/1 video, da8xx-fb: fix time out in wait_for_event()

Quoted 6 lines · On Sun, 18 Mar 2018 14:48:06 +0100 Heinrich Schuchardt xypron.glpk at gmx.de…

If an event does not occur the current coding stays in an endless loop.

---
 drivers/video/da8xx-fb.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Applied to u-boot-video/master, thanks!

--
Anatolij