From patchwork Tue Nov 29 23:57:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 9453263 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 CB9ED6071C for ; Wed, 30 Nov 2016 00:00:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE0D42848B for ; Wed, 30 Nov 2016 00:00:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2AC528495; Wed, 30 Nov 2016 00:00:33 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 527CE2848B for ; Wed, 30 Nov 2016 00:00:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cBsIp-0003HP-1i; Tue, 29 Nov 2016 23:59:11 +0000 Received: from mail-pg0-x22c.google.com ([2607:f8b0:400e:c05::22c]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cBsHO-0002Ib-S4 for linux-arm-kernel@lists.infradead.org; Tue, 29 Nov 2016 23:57:44 +0000 Received: by mail-pg0-x22c.google.com with SMTP id x23so74806641pgx.1 for ; Tue, 29 Nov 2016 15:57:15 -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=KQY5Seqr/M6hCfsYXzeqPzAURciWFUOYAcbkAozB2nQ=; b=yixB13yBD0SseJeBuqWeRKzOmRBX8Vk+OprjdzgRWyNSibOo4LdujrrkwMTl/hEoIk OJo5knrA/JXWT9d7pmnLgMd4cpooYvhkSE9vh+cbV2o4L094mIvHWevgUEve9Zf7I7c8 OKH/iXTo7VzgdIya+0xO+2rLRO+OjhAfkgx3umGu3z1jU0NfkW0CWs+A5qFstj7WuxJ+ JSf+4VBuIKV/ydbzNVKKJXGMX5WImKNC1M7g344B6P6CTOA/cYWi+ECKIKFkHgawmgYG xVb1gGE9R8MZ0WFBtVl3oBm81099uQV1AuEBMECxcMQ0/Z7EZVFfIgpx8WE1F9XR9NUl B0qg== 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=KQY5Seqr/M6hCfsYXzeqPzAURciWFUOYAcbkAozB2nQ=; b=Z/SksU+uzRU9oO9Yj7g7PB6vcyOjFcXLG+hYzf3jocHbbaq0sTy0mAn13Pez/NXlqq ySXwmttQN1lGQjRWmGS22TSZWkZd3yQmxy0OffA2iYjiq8acQNhEkBSe7UaeQIZOMECI 2j6V9fX7c0/o16sLa5iUX14y7QpvJKTlogS3rZenxtVYw9qmrWmJF85OgzeAxwtJOFht ozYF6qdCfVZAEtaimJ5vCTCxtm871uDbOcvakAr5xdj8wx9WaTYOTCm+G55y9gu5mDYb TBmGQw3E+W1j2wyEbk+e2hhunCMrlDIOtQgUQblt1v0uZl5T6VHI5xnntzcN4vXElzPS 3qCw== X-Gm-Message-State: AKaTC039dCCO5bEllJMuBtoS1aOp/2ZQcXGrto7VLnQrLEVTAtn6SHPQtGxz4df1PyOOYY64 X-Received: by 10.84.216.25 with SMTP id m25mr67176438pli.117.1480463835526; Tue, 29 Nov 2016 15:57:15 -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 t25sm54655244pgo.9.2016.11.29.15.57.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Nov 2016 15:57:15 -0800 (PST) From: Kevin Hilman To: linux-media@vger.kernel.org Subject: [PATCH v4 1/4] [media] davinci: vpif_capture: don't lock over s_stream Date: Tue, 29 Nov 2016 15:57:09 -0800 Message-Id: <20161129235712.29846-2-khilman@baylibre.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161129235712.29846-1-khilman@baylibre.com> References: <20161129235712.29846-1-khilman@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161129_155743_170379_81DAE890 X-CRM114-Status: UNSURE ( 9.48 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Sekhar Nori , Hans Verkuil , Sakari Ailus , Laurent Pinchart , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 5104cc0ee40e..9f8f41c0f251 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;