[COMMON] media: scaler: fix power-off bug for scaler
authorWon Jung <w00.jung@samsung.com>
Fri, 6 Jan 2017 01:26:02 +0000 (10:26 +0900)
committerSeungchul Kim <sc377.kim@samsung.com>
Mon, 28 May 2018 05:28:21 +0000 (14:28 +0900)
There is a possibility which g2d block power off
while scaler is running. A scaler is in the g2d block.
In interrupt handler, rm_runtim functions, pm_runtime_get
or pm_runtime_put, are uesed as asynchronous mode.
But since a wating job can be called in interrupt handler,
g2d block power is turned off due to the asyncchronous
pm_runtime_put function while the job is performing.
Therefore, the pm_runtime_put should be called after
the wating job which performs in irq handler is done.

Change-Id: If342b2cc4b57714d6183486b4b54b1b21b1c1472
Signed-off-by: Won Jung <w00.jung@samsung.com>
drivers/media/platform/exynos/scaler/scaler-core.c

index 0a2fb06959ea95ff977a2b418df63cea81e2404f..a64587095de08f6e2a1aefdeb7c218b455e90538 100644 (file)
@@ -2679,8 +2679,6 @@ static irqreturn_t sc_irq_handler(int irq, void *priv)
        clear_bit(DEV_RUN, &sc->state);
        clear_bit(CTX_RUN, &ctx->flags);
 
-       sc_clk_power_disable(sc);
-
        if (ctx->context_type == SC_CTX_V4L2_TYPE) {
                BUG_ON(ctx != v4l2_m2m_get_curr_priv(sc->m2m.m2m_dev));
 
@@ -2733,6 +2731,7 @@ static irqreturn_t sc_irq_handler(int irq, void *priv)
 
        sc_run_next_job(sc);
 
+       sc_clk_power_disable(sc);
 isr_unlock:
        spin_unlock(&sc->slock);