From patchwork Wed Nov 28 08:37:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 10702061 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3C13313BB for ; Wed, 28 Nov 2018 08:37:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BEED2C0E5 for ; Wed, 28 Nov 2018 08:37:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1ED8E2C976; Wed, 28 Nov 2018 08:37:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C96B72C0E5 for ; Wed, 28 Nov 2018 08:37:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727854AbeK1Tiq (ORCPT ); Wed, 28 Nov 2018 14:38:46 -0500 Received: from lb1-smtp-cloud8.xs4all.net ([194.109.24.21]:54335 "EHLO lb1-smtp-cloud8.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727829AbeK1Tin (ORCPT ); Wed, 28 Nov 2018 14:38:43 -0500 Received: from tschai.fritz.box ([212.251.195.8]) by smtp-cloud8.xs4all.net with ESMTPA id RvLvgzI1KEPjORvM0gfqbK; Wed, 28 Nov 2018 09:37:53 +0100 From: hverkuil-cisco@xs4all.nl To: linux-media@vger.kernel.org Cc: Sakari Ailus , Tomasz Figa , Paul Kocialkowski , Hans Verkuil Subject: [PATCH for v4.20 4/5] vb2: don't unbind/put the object when going to state QUEUED Date: Wed, 28 Nov 2018 09:37:46 +0100 Message-Id: <20181128083747.18530-5-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181128083747.18530-1-hverkuil-cisco@xs4all.nl> References: <20181128083747.18530-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfCu6xK2VWMECD3Cu6WQRQXLg0iiKMTkVMtoqGxRPY70TSUMwDWlJsaVW4w+AvgsSsuwck/1bnQwsuX5Jga4GqhPA9CNg0M8etcWTP4Ncmr5YSkFUahl6 mXSLhDGKE5KXtAe7QuFWbbqq21pqqqKSE9hrrygmvLTXdg0xUiLbqkxktjq86RR9FweVoOljUG4FCR7cjqytmuEgnkZ+jka/kWnbFSSMYq768sW0q1CZWiwn FuVN9v3LLaSZVm/yJ/myY+mVAMZ3rzsmG2O2BjSnHWTDFdwdecZ+27tLwo9YiYzOapC973Ci/GbhPlK3XfUn2dXCDCj8Uqo+sbMzVM0Lw8I= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hans Verkuil When a buffer is returned to state QUEUED (that happens when start_streaming fails), then do not unbind and put the object from the request. Nothing has changed yet, so just keep it as is. Signed-off-by: Hans Verkuil --- drivers/media/common/videobuf2/videobuf2-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index 86a12b335aac..70e8c3366f9c 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -948,7 +948,7 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state) } atomic_dec(&q->owned_by_drv_count); - if (vb->req_obj.req) { + if (state != VB2_BUF_STATE_QUEUED && vb->req_obj.req) { /* This is not supported at the moment */ WARN_ON(state == VB2_BUF_STATE_REQUEUEING); media_request_object_unbind(&vb->req_obj);