Received: by 10.192.165.148 with SMTP id m20csp276435imm; Fri, 20 Apr 2018 06:40:04 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/hFFk8XFCRq0JCninzVwni1/cl2QZ/Ls1jocIueGME7KeLptZ8C4LDhhwfkhuN0CdbqkMb X-Received: by 2002:a17:902:b595:: with SMTP id a21-v6mr10395031pls.68.1524231604238; Fri, 20 Apr 2018 06:40:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524231604; cv=none; d=google.com; s=arc-20160816; b=O4qnw19I2JlnpTNmvMu60X45vMasPhOBYxbZLfIUqXwrgil+Sr9h/YQqC9VNq1ghwK w5/PzcZ27ODcCkS7P8eQ4+07/7/Mt9dmfo4NhjfZ77Uwbpd7ubcTTnOHabNqCUkG2Cjn rQGPvdZKZU4rFjaLTSp7WitfYFaZ9VQyllKIjBGSZKXF6bA23oAK4xG9oGvQ7FafH1Ap W9SgExNd6mD8or2ZsSQFGUKkf5h4riGcG6eN6414gxUj5gdZnysMWttu34YPaJQdj6T3 niR+IROM2DNCO9I2htXIG5+XFC0Upy4Fi7NIKUfdrPv0EKRHct0EebNUFcbvKJP28GY0 KVkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=R3t1hWwAtJL8IxLnZwkOREf5c0RF91cc3OgNOPaHQqI=; b=m/xCCOX0zr/yuwWeNbkedZqZpYLdwgvWWIO9O9L+fOF1f8NsSDTX5A9S9P0cNOQ23b EMMhfqQzkbkxG1OqPaJy8dZQxWCuEcufD3AlLho9jdG0HHNFCOD8e6+kxO6mXUOzX/V0 yIN0WtutWOaC9X+U2L0PZeDOyCSHOUnS7FF9xm63/DuVt4oURY9aa8xGv/dU8Wgvqewe /Pp6holEGcg01hIMNniO4bMZUB7Nk4kX0BYlDjH1h91MqOLA/v/kKefrI9ceffP2/1XZ I+nDeN8aij0bA7yVCzgVjo7ZdCNyzmEeMyD/Wm3mc01+NR2kEB9zilAS3j/d/DlXwHyH igog== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r11si5469777pff.160.2018.04.20.06.39.49; Fri, 20 Apr 2018 06:40:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755111AbeDTNio (ORCPT + 99 others); Fri, 20 Apr 2018 09:38:44 -0400 Received: from lb3-smtp-cloud9.xs4all.net ([194.109.24.30]:55680 "EHLO lb3-smtp-cloud9.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754934AbeDTNim (ORCPT ); Fri, 20 Apr 2018 09:38:42 -0400 Received: from [IPv6:2001:420:44c1:2579:b9bc:5629:432c:e3ba] ([IPv6:2001:420:44c1:2579:b9bc:5629:432c:e3ba]) by smtp-cloud9.xs4all.net with ESMTPA id 9WFEf0pwTnprp9WFIf2V4K; Fri, 20 Apr 2018 15:38:41 +0200 Subject: Re: [PATCH v2 01/10] media: v4l2-ctrls: Add missing v4l2 ctrl unlock To: Paul Kocialkowski , 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 References: <20180419154124.17512-1-paul.kocialkowski@bootlin.com> <20180419154124.17512-2-paul.kocialkowski@bootlin.com> From: Hans Verkuil Message-ID: <47861cbd-e385-66c0-798d-f6ff3f454bac@xs4all.nl> Date: Fri, 20 Apr 2018 15:38:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20180419154124.17512-2-paul.kocialkowski@bootlin.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfAh2FHCUgoRH2I9lRUIPo9prfxSDF8srF4VqsJzeK1/By9zeG/VUe1iP1BQ5DeIpBdFygjTiJitCZZgd7AVuGXATJ/Qg3GazWwKU7NhGmJ0NUnG+Ppuv ij4y85lGQC+YjnmAfINfZbIm1W8/fWpA1UAtfJV+EQLengcdx4wv4vdpxkOWY3oltLMwV9kCsqfValWHjE0qe+vFq+ZJNWne/ymSXNIc5uvUy6comW7ghbaB T7UVr6VViAOkX5Sl9FE7yuDHkY5I3ZHsVMBzaqWPm08diCLcgOqkaUHgOOKkY1zQeZUKrArWZcDJEcEDU/KL9pjrTq9dLSi9IeF+fYGouYjXJmt5bgbV1gGi yU5uwIvOu0KZxihmkgiH4N4kVZOkSBklpL9qGXUDeyht81ytZfAC9YNjCMkSuNCngM8RmKW9mwbQu36HSfYO64GYe1sPycuDm59xPREU3wcRNwebsH/xfhU1 CM7+xNLC1oo2IODobBNpJOTbrrmWtZ8rBZT98JzaLj8gyPAFikHuLmk5+os3ir6fj1uJyLG2zq0j/3X/LwMcBr7XFWhaeHSI+VD97K1TbIrcLryLPLVuSaot 65qkTnBVojMdGUys/3AHIrUqx+m2zxyIJvDELwuSSBNI+DdIawYFgd8gP542wogH2zpCzMP6XUXtKUyTbMv/czwuH6HdgCV1ijLaYNok4K7uBGeUexxXPuis +dhiBX0e00D2rvESd+9/m3xF5i0HQ4z4nL9Xb0JdpLEXNF7MMBhmNgDxpUZQvOtwfxQe8+BeJWUDF8VAh12FJFXM6SuGomtOg+3NseT4ZpDOIBEisp1gYqaP 9HtUCtAz/rCvuDjblzqzn7TcRIE+8QoqwoXyPfRQRlscMemAw1dWcKGyBzPTNpBUwc9wBUClDD7LjqplJI0d21CA2S1LJuJvh3iXeBSxPhLxR+cBwZjEOd4L GL0F+Gbex+iQVDnE2egjiUgpyD58NHzdzGZGMfvShwwwxA4nHUszJM9oIczC/oROmOUO6myvBmCK3UWNlpyBzUZ2YG6dyYKwJoQ5Na6deWl2pm8MK8BZpFv4 tReoC/R6muGXuogmQmW9xBTR36bcWIB4fypePcASxxF4CA4XE2DDuU23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/19/18 17:41, Paul Kocialkowski wrote: > 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; > + } Oops! Thanks for finding this. I'll fold this into the relevant patch in my tree. > > for (i = 0; i < master->ncontrols; i++) { > if (master->cluster[i]) { > Regards, Hans