All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] video, da8xx-fb: fix time out in wait_for_event()
@ 2018-03-18 13:48 Heinrich Schuchardt
  2018-03-19  9:18 ` Anatolij Gustschin
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2018-03-18 13:48 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/video/da8xx-fb.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 6ec4f89e34..26db73b138 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -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;
 	}
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH 1/1] video, da8xx-fb: fix time out in wait_for_event()
  2018-03-18 13:48 [U-Boot] [PATCH 1/1] video, da8xx-fb: fix time out in wait_for_event() Heinrich Schuchardt
@ 2018-03-19  9:18 ` Anatolij Gustschin
  0 siblings, 0 replies; 2+ messages in thread
From: Anatolij Gustschin @ 2018-03-19  9:18 UTC (permalink / raw)
  To: u-boot

On Sun, 18 Mar 2018 14:48:06 +0100
Heinrich Schuchardt xypron.glpk at gmx.de wrote:

> If an event does not occur the current coding stays in an endless loop.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  drivers/video/da8xx-fb.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

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

--
Anatolij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-19  9:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-18 13:48 [U-Boot] [PATCH 1/1] video, da8xx-fb: fix time out in wait_for_event() Heinrich Schuchardt
2018-03-19  9:18 ` Anatolij Gustschin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.