From patchwork Tue Nov 22 15:52:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 9441391 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 00B696075D for ; Tue, 22 Nov 2016 15:53:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8952285A1 for ; Tue, 22 Nov 2016 15:53:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD65C285C6; Tue, 22 Nov 2016 15:53:08 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 8525B285C5 for ; Tue, 22 Nov 2016 15:53:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755526AbcKVPw6 (ORCPT ); Tue, 22 Nov 2016 10:52:58 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:35457 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755539AbcKVPws (ORCPT ); Tue, 22 Nov 2016 10:52:48 -0500 Received: by mail-pf0-f180.google.com with SMTP id i88so4808655pfk.2 for ; Tue, 22 Nov 2016 07:52:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XlBWMjpjhMUKgTmZLLpZTQVCdXmu7rUs9oyqq8tkrKA=; b=qHcYRsZxMqeNF68tt/Tt6FNdTW9CxvhnKbFdJ/5gBiyu3jmokcJ4zhXRUO1AIID5eP XTCJ6Z4ZwU6OwhIPt4gK/RV2NgsTGuV8/UMmkyGSsRmHtvY25PtotfP60ZCXIWdwRKET nDLHqhAJ6eHGt22lddxr5giQSAZ3XwhHgcfgd6oCVuSBfxML0fYaAPhQ/52hyHScriEW MGnsysGsN12iv6lZz5gqOClW6bNwrNO22jQ4Qiotu5mz9MnpzLl706MVjshlQ9Es5HTJ I65zdKiHxBjfpDH/eypIUc4NQZH2w5rnIKD59U8Xo67eZfB6ndBtsZGPZ2+ycjO1MDcZ /70g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XlBWMjpjhMUKgTmZLLpZTQVCdXmu7rUs9oyqq8tkrKA=; b=czLiY+K5jiSXS15gu+y469uzlGD/WTuZzfd0ez8Cw14xmZh8e2cKoe9zyGQu/6i/XE yVOQYrI1oDr9BFyl0YOKOjbtMp9/8FlE5xqO5Uur4lli6O4bJtW8PVisbytsSQx5Fl0L T1FEJJABKI58c8BWMceNK6J6K3x4eAgJSnBYlNrcupHmWYr+iVOQ3peZoSnlwsO7QPtE nF6X4QYixRW7aM//N58lNJjppvp2LW8kDpd9+HYCgLBqlEaZFaOyQN9vsh3z6HlRG7AF zuUSaH6741DaX9uOA2MmUews5z4arxPtM9xWGZubSjzn1/XAmPxkDuu8WcJjYpN8wopa 8YkA== X-Gm-Message-State: AKaTC0195qQ1E9HdMBt6ckKvS+eWS2X/MgLr+U7r8DSqu2vwOYBIz8nW/nfW3Qi9z/Fn8RmM X-Received: by 10.84.197.165 with SMTP id n34mr972870pld.34.1479829968138; Tue, 22 Nov 2016 07:52:48 -0800 (PST) Received: from localhost (c-98-203-232-209.hsd1.wa.comcast.net. [98.203.232.209]) by smtp.gmail.com with ESMTPSA id r88sm46202386pfe.93.2016.11.22.07.52.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Nov 2016 07:52:47 -0800 (PST) From: Kevin Hilman To: linux-media@vger.kernel.org, Hans Verkuil Cc: devicetree@vger.kernel.org, Sekhar Nori , Axel Haslam , =?UTF-8?q?Bartosz=20Go=C5=82aszewski?= , Alexandre Bailon , David Lechner Subject: [PATCH v3 2/4] [media] davinci: vpif_capture: don't lock over s_stream Date: Tue, 22 Nov 2016 07:52:42 -0800 Message-Id: <20161122155244.802-3-khilman@baylibre.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161122155244.802-1-khilman@baylibre.com> References: <20161122155244.802-1-khilman@baylibre.com> MIME-Version: 1.0 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 Video capture subdevs may be over I2C and may sleep during xfer, so we cannot do IRQ-disabled locking when calling the subdev. Signed-off-by: Kevin Hilman --- drivers/media/platform/davinci/vpif_capture.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index 87ee1e2c3864..94ee6cf03f02 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c @@ -193,7 +193,10 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) } } + spin_unlock_irqrestore(&common->irqlock, flags); ret = v4l2_subdev_call(ch->sd, video, s_stream, 1); + spin_lock_irqsave(&common->irqlock, flags); + if (ret && ret != -ENOIOCTLCMD && ret != -ENODEV) { vpif_dbg(1, debug, "stream on failed in subdev\n"); goto err;