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.h

index 0cef0ff..852f598 100644 (file)
@@ -273,6 +273,8 @@ struct mxc_isi_dev {
        u32 interface[MAX_PORTS];
        u32 flags;
 
+       atomic_t open_count;
+
        /* scale factor */
        u32     xfactor;
        u32     yfactor;