Message ID | 20210115002148.4079591-2-niklas.soderlund+renesas@ragnatech.se (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | rcar-csi2: Update handling of transfer error | expand |
Hi Niklas, On Fri, Jan 15, 2021 at 01:21:45AM +0100, Niklas Söderlund wrote: > Do not attempt to stop the streaming if the stream is not running. > > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> With the comment on v1 clarified for the double stoppage case: Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Thanks j > --- > drivers/media/platform/rcar-vin/rcar-dma.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c > index 48280ddb15b9b0ee..f30dafbdf61ca15f 100644 > --- a/drivers/media/platform/rcar-vin/rcar-dma.c > +++ b/drivers/media/platform/rcar-vin/rcar-dma.c > @@ -1301,6 +1301,11 @@ void rvin_stop_streaming(struct rvin_dev *vin) > > spin_lock_irqsave(&vin->qlock, flags); > > + if (vin->state == STOPPED) { > + spin_unlock_irqrestore(&vin->qlock, flags); > + return; > + } > + > vin->state = STOPPING; > > /* Wait until only scratch buffer is used, max 3 interrupts. */ > -- > 2.30.0 >
diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c index 48280ddb15b9b0ee..f30dafbdf61ca15f 100644 --- a/drivers/media/platform/rcar-vin/rcar-dma.c +++ b/drivers/media/platform/rcar-vin/rcar-dma.c @@ -1301,6 +1301,11 @@ void rvin_stop_streaming(struct rvin_dev *vin) spin_lock_irqsave(&vin->qlock, flags); + if (vin->state == STOPPED) { + spin_unlock_irqrestore(&vin->qlock, flags); + return; + } + vin->state = STOPPING; /* Wait until only scratch buffer is used, max 3 interrupts. */
Do not attempt to stop the streaming if the stream is not running. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> --- drivers/media/platform/rcar-vin/rcar-dma.c | 5 +++++ 1 file changed, 5 insertions(+)