]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
v4l: xilinx: scd: Don't mark channel as disabled in .s_stream(0)
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Wed, 3 Apr 2019 20:01:59 +0000 (13:01 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 5 Apr 2019 11:03:50 +0000 (13:03 +0200)
Commit 2e77607047c6 ("xilinx: v4l2: dma: Add multiple output support")
incorrectly calls .s_stream(0) on all channels when one of them gets
disabled, causing all the other channels to hang. Work around this by
not disabling the channel in .s_stream(0). The channel will be disabled
in xscd_dma_terminate_all() which should be safe as long as
dmaengine_terminate_all() is called after xvip_pipeline_set_stream().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
drivers/media/platform/xilinx/xilinx-scenechange-dma.c

index c7f173cf5b05e3db03fda4258ec4bd4b818a5e55..58437a769605d319e5574f4850d85a9179224f73 100644 (file)
@@ -146,9 +146,21 @@ void xscd_dma_enable_channel(struct xscd_dma_chan *chan, bool enable)
 {
        struct xscd_device *xscd = chan->xscd;
 
-       spin_lock_irq(&chan->lock);
-       chan->enabled = enable;
-       spin_unlock_irq(&chan->lock);
+       if (enable) {
+               /*
+                * FIXME: Don't set chan->enabled to false here, it will be
+                * done in xscd_dma_terminate_all(). This works around a bug
+                * introduced in commit 2e77607047c6 ("xilinx: v4l2: dma: Add
+                * multiple output support") that stops all channels when the
+                * first one is stopped, even though they are part of
+                * independent pipelines. This workaround should be safe as
+                * long as dmaengine_terminate_all() is called after
+                * xvip_pipeline_set_stream().
+                */
+               spin_lock_irq(&chan->lock);
+               chan->enabled = true;
+               spin_unlock_irq(&chan->lock);
+       }
 
        if (xscd->memory_based) {
                if (enable) {