From patchwork Thu Apr 19 15:41:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 10351073 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 947CA602B7 for ; Thu, 19 Apr 2018 15:47:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 869F22893C for ; Thu, 19 Apr 2018 15:47:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 852F82897A; Thu, 19 Apr 2018 15:47:14 +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=unavailable 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 7071128AAE for ; Thu, 19 Apr 2018 15:44:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753148AbeDSPny (ORCPT ); Thu, 19 Apr 2018 11:43:54 -0400 Received: from mail.bootlin.com ([62.4.15.54]:42476 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752995AbeDSPnv (ORCPT ); Thu, 19 Apr 2018 11:43:51 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 93EEA20861; Thu, 19 Apr 2018 17:43:49 +0200 (CEST) Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 2B1FC2072F; Thu, 19 Apr 2018 17:43:49 +0200 (CEST) From: Paul Kocialkowski To: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Cc: Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Maxime Ripard , Chen-Yu Tsai , Pawel Osciak , Marek Szyprowski , Kyungmin Park , Hans Verkuil , Sakari Ailus , Philipp Zabel , Arnd Bergmann , Alexandre Courbot , Tomasz Figa , Paul Kocialkowski Subject: [PATCH v2 01/10] media: v4l2-ctrls: Add missing v4l2 ctrl unlock Date: Thu, 19 Apr 2018 17:41:15 +0200 Message-Id: <20180419154124.17512-2-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180419154124.17512-1-paul.kocialkowski@bootlin.com> References: <20180419154124.17512-1-paul.kocialkowski@bootlin.com> 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 This adds a missing v4l2_ctrl_unlock call that is required to avoid deadlocks. Signed-off-by: Paul Kocialkowski --- drivers/media/v4l2-core/v4l2-ctrls.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index f67e9f5531fa..ba05a8b9a095 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -3614,10 +3614,12 @@ void v4l2_ctrl_request_complete(struct media_request *req, continue; v4l2_ctrl_lock(ctrl); + if (ref->req) ptr_to_ptr(ctrl, ref->req->p_req, ref->p_req); else ptr_to_ptr(ctrl, ctrl->p_cur, ref->p_req); + v4l2_ctrl_unlock(ctrl); } @@ -3677,8 +3679,11 @@ void v4l2_ctrl_request_setup(struct media_request *req, } } } - if (!have_new_data) + + if (!have_new_data) { + v4l2_ctrl_unlock(master); continue; + } for (i = 0; i < master->ncontrols; i++) { if (master->cluster[i]) {