[COMMON] media: smfc: fix inconsistency in hardware state
authorCho KyongHo <pullip.cho@samsung.com>
Mon, 18 May 2015 07:37:49 +0000 (16:37 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:18 +0000 (20:22 +0300)
Setting SMFC_DEV_RUNNING is after configuring H/W to start working.
If IRQ is occurred before configuring the flag, the IRQ handler
is called before the flag set.

Change-Id: I3f408f569b7265eb368b9efc38cffdb13d79fff2
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
drivers/media/platform/exynos/smfc/smfc.c

index c601f5b94ebe516aa95cbd8e61f3669789c079f3..7a2cc4343fbf9950b423f27b345158a1ef018641 100644 (file)
@@ -1215,12 +1215,13 @@ static void smfc_m2m_device_run(void *priv)
                smfc_hwconfigure_2nd_tables(ctx, thumb_quality_factor);
                smfc_hwconfigure_2nd_image(ctx);
        }
-       smfc_hwconfigure_start(ctx, restart_interval, !!enable_hwfc);
 
        spin_lock_irqsave(&ctx->smfc->flag_lock, flags);
        ctx->smfc->flags |= SMFC_DEV_RUNNING;
        spin_unlock_irqrestore(&ctx->smfc->flag_lock, flags);
 
+       smfc_hwconfigure_start(ctx, restart_interval, !!enable_hwfc);
+
        return;
 err_hwfc:
        if (!IS_ERR(ctx->smfc->clk_gate)) {