drm/bridge/sii8620: fix message worker function 09/92609/1
authorAndrzej Hajda <a.hajda@samsung.com>
Mon, 17 Oct 2016 12:37:47 +0000 (14:37 +0200)
committerAndrzej Hajda <a.hajda@samsung.com>
Mon, 17 Oct 2016 13:26:35 +0000 (15:26 +0200)
Messages should not be handled in error and busy state. Also state should
be update on success.

Change-Id: Ib6ac51f920cb44f75628cbec78b3bb32774816ff
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
drivers/gpu/drm/bridge/sii8620.c

index 56d310de69595ac9a2b8f80114a6de6fd20383df..384e592ba6e561c25b73211fa0db11d12bdcbdfc 100644 (file)
@@ -244,10 +244,13 @@ static void sii8620_mt_work(struct sii8620 *ctx)
 {
        struct sii8620_mt_msg *msg;
 
-       if (list_empty(&ctx->mt_queue))
+       if (ctx->error)
+               return;
+       if (ctx->mt_state == MT_STATE_BUSY || list_empty(&ctx->mt_queue))
                return;
 
        if (ctx->mt_state == MT_STATE_DONE) {
+               ctx->mt_state = MT_STATE_READY;
                msg = list_first_entry(&ctx->mt_queue, struct sii8620_mt_msg,
                                       node);
                if (msg->recv)