It is possible to call STREAMON without having any buffers queued. So vb2_is_streaming() can return true without start_streaming() having been called. Only after at least one buffer has been queued will start_streaming be called. The check vb2_is_streaming() is incorrect as this would start the DMA without having proper DMA pointers set up. this patch uses vb2_start_streaming_called() instead to check is streaming was called.
Unified · Split
| @@ -1596,7 +1596,7 @@ static int vpif_suspend(struct device *dev) · 1595 unmodified lines | |||
| 1596 | ch = vpif_obj.dev[i]; | 1596 | ch = vpif_obj.dev[i]; |
| 1597 | common = &ch->common[VPIF_VIDEO_INDEX]; | 1597 | common = &ch->common[VPIF_VIDEO_INDEX]; |
| 1598 | 1598 | ||
| 1599 | if (!vb2_is_streaming(&common->buffer_queue)) | 1599 | if (!vb2_start_streaming_called(&common->buffer_queue)) |
| 1600 | continue; | 1600 | continue; |
| 1601 | 1601 | ||
| 1602 | mutex_lock(&common->lock); | 1602 | mutex_lock(&common->lock); |
| @@ -1630,7 +1630,7 @@ static int vpif_resume(struct device *dev) · 27 unmodified lines | |||
| 1630 | ch = vpif_obj.dev[i]; | 1630 | ch = vpif_obj.dev[i]; |
| 1631 | common = &ch->common[VPIF_VIDEO_INDEX]; | 1631 | common = &ch->common[VPIF_VIDEO_INDEX]; |
| 1632 | 1632 | ||
| 1633 | if (!vb2_is_streaming(&common->buffer_queue)) | 1633 | if (!vb2_start_streaming_called(&common->buffer_queue)) |
| 1634 | continue; | 1634 | continue; |
| 1635 | 1635 | ||
| 1636 | mutex_lock(&common->lock); | 1636 | mutex_lock(&common->lock); |