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: 9453245 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 B65756071C for ; Tue, 29 Nov 2016 23:57:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9F802835B for ; Tue, 29 Nov 2016 23:57:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9EBE72846F; Tue, 29 Nov 2016 23:57:26 +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 4A9EF2835B for ; Tue, 29 Nov 2016 23:57:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754914AbcK2X5X (ORCPT ); Tue, 29 Nov 2016 18:57:23 -0500 Received: from mail-pf0-f174.google.com ([209.85.192.174]:35739 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752570AbcK2X5Q (ORCPT ); Tue, 29 Nov 2016 18:57:16 -0500 Received: by mail-pf0-f174.google.com with SMTP id i88so34649466pfk.2 for ; Tue, 29 Nov 2016 15:57:16 -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=RYl6Ox1xk1fVcp7hZ/bl0KW+aacJqf3+XsaWAfUkFiPxvR1/rTY3dZTqMwlKTWZhsz TsSrcO5EQgXtkSfbIbhr19OH6gVFhcsPoBIdwsDYjKY1ZFu17b79N18rvSRh4uUJ8pll okXFuKbNyMANtFm/lMaQjfTvfiTh0nJ6/RMxNnKD4cQfn+n89B4mvdVj62CNmGw0sCkN ak8cqDgI7TReYTr+mLxWFaQ/ojIw8R6OfipxIbXsMLnU7m4Yv+3ayAz9XAzPYcUVNB0Z nwnY+AVCrzjc5UjXaAPq22QD8FXK3ht2rr2KjSplnW9z1TZj1+VWEtDm15jKxOzGm/3h Usxg== X-Gm-Message-State: AKaTC00KTL2GpkRdtKkV6DPfBirkggtnwViXTf7n7ATMfJV3mrPZoIAwMqF12dBO0EX+gPjy 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 Cc: Hans Verkuil , Laurent Pinchart , Sakari Ailus , linux-arm-kernel@lists.infradead.org, Sekhar Nori , Rob Herring , devicetree@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 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 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;