public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/mediatek: fix a loop timeout
@ 2017-04-20 10:24 Dan Carpenter
  2017-04-20 11:05 ` Philipp Zabel
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2017-04-20 10:24 UTC (permalink / raw)
  To: CK Hu, shaoming chen
  Cc: kernel-janitors, dri-devel, linux-mediatek, Matthias Brugger

We expected to end with "timeout_ms" set to zero, but it's a post-op so
the current code ends with -1.  Let's fix this by changing it to a
pre-op.

Fixes: 21898816831f ("drm/mediatek: add dsi transfer function")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index 808b995a990f..3a0b6d1057a2 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -902,7 +902,7 @@ static void mtk_dsi_wait_for_idle(struct mtk_dsi *dsi)
 {
 	u32 timeout_ms = 500000; /* total 1s ~ 2s timeout */
 
-	while (timeout_ms--) {
+	while (--timeout_ms) {
 		if (!(readl(dsi->regs + DSI_INTSTA) & DSI_BUSY))
 			break;
 

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

end of thread, other threads:[~2017-04-20 11:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-20 10:24 [PATCH] drm/mediatek: fix a loop timeout Dan Carpenter
2017-04-20 11:05 ` Philipp Zabel
2017-04-20 11:53   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox