MLK-19108: ISI: fix isi hang issue when open it many times
authorGuoniu.Zhou <guoniu.zhou@nxp.com>
Tue, 31 Jul 2018 07:58:41 +0000 (15:58 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
When one ISI channel is receiving data, if an other process
just open it at the same time and then close, it will lead
to this channel hang. The reason is soft reset in release
callback, so it make the channel stop work. Add an counter
for open isi channel and really soft reset the channel when
the counter equal to zero.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby.Cai <robby.cai@nxp.com>
drivers/media/platform/imx8/mxc-isi-core.c

index 3663223..d43b008 100644 (file)
@@ -131,6 +131,7 @@ static int mxc_isi_probe(struct platform_device *pdev)
        init_waitqueue_head(&mxc_isi->irq_queue);
        spin_lock_init(&mxc_isi->slock);
        mutex_init(&mxc_isi->lock);
+       atomic_set(&mxc_isi->open_count, 0);
 
        mxc_isi->clk = devm_clk_get(dev, NULL);
        if (IS_ERR(mxc_isi->clk)) {