From patchwork Tue Oct 25 23:55:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 9395739 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 E700460233 for ; Tue, 25 Oct 2016 23:58:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0074296A2 for ; Tue, 25 Oct 2016 23:58:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94293296A6; Tue, 25 Oct 2016 23:58:22 +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 2B4C5296A2 for ; Tue, 25 Oct 2016 23:58:21 +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 1bzBaW-0002OK-E5; Tue, 25 Oct 2016 23:57:00 +0000 Received: from mail-pf0-x234.google.com ([2607:f8b0:400e:c00::234]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bzBZX-0001la-NJ for linux-arm-kernel@lists.infradead.org; Tue, 25 Oct 2016 23:56:02 +0000 Received: by mail-pf0-x234.google.com with SMTP id s8so127628370pfj.2 for ; Tue, 25 Oct 2016 16:55:43 -0700 (PDT) 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=pdNT/4PUa4tIEJ8uk0c1ipYBmSbRPQQD4DGtYDgmCq0=; b=uc04i5MZ/TjNAvux14t5Iv1syJEQXdvpC5+9/RjDuuPjsr53HqoAxrx1n7vsztSHPF q3vDhLaFb5c/bhw0OfgdAbRKh2BgLHweBV/M5iSlTHYkOJnEOCv9ipv4Ss+iqt5o+Xss JCVJZU0oG8zPdoPVk7lbnGMEu1F/C9rq+tpZAMedktFDLqVpUQKSuiMI24TjNLaxZdPE 2EMSa/zsTK1RtahokHxs8rVb6OeS1x8XnPMw8ivl3bGmMfk3Y2UlNQyzGkYtqleSDWnc +xmW626HkOWkNxy2iqvQliaX+ZXbpetg2RCifjhpHYSScAwBYpKR5ExWUdX7faWHWBtU pLNw== 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=pdNT/4PUa4tIEJ8uk0c1ipYBmSbRPQQD4DGtYDgmCq0=; b=aYzYrV5qRvwB4mNcwDiWFP4x6+ftXl9KcVe/+Ca0x/P4g6kYhuIurjkINED5yPhncf qm5DDTBXhR2EuJIPCN84VAMZepVXsiZ9JtzR95+3rbq641cRVE2aKBIZHH5mundmJp0o 3Oj7wEO1yGZAOD3owBhDiaeebO72vgq8bQGyuRbNNRbxyteZeo/nNmOq+GKFzvDrwhpg y5DITb/kGd6DpiSYoVqOZjakl9n9fB/cPy/cHE6KUWL6jlnNws3m7lmjfZvlHBMAAOea 98lCdrhkiiu0CQ1OJcDojV2q4eVC0DPdiV54WPNwNEuFSKY25rh52ZLDIoIRousSeJxN ZiZg== X-Gm-Message-State: ABUngvfdYbGTSUi6/e5i+KxVOn/nnGrHU/hBjjhPaG1CSnEprPEXRdXmaxZM9CczETINqcaZ X-Received: by 10.99.101.65 with SMTP id z62mr36404806pgb.89.1477439742556; Tue, 25 Oct 2016 16:55:42 -0700 (PDT) Received: from localhost (c-98-203-232-209.hsd1.wa.comcast.net. [98.203.232.209]) by smtp.gmail.com with ESMTPSA id xv9sm35982081pab.36.2016.10.25.16.55.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Oct 2016 16:55:42 -0700 (PDT) From: Kevin Hilman To: Hans Verkuil , Laurent Pinchart , linux-media@vger.kernel.org Subject: [RFC PATCH 5/6] [media] davinci: vpif_capture: don't lock over s_stream Date: Tue, 25 Oct 2016 16:55:35 -0700 Message-Id: <20161025235536.7342-6-khilman@baylibre.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161025235536.7342-1-khilman@baylibre.com> References: <20161025235536.7342-1-khilman@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161025_165559_964253_135DFAB1 X-CRM114-Status: GOOD ( 10.22 ) 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: David Lechner , Axel Haslam , Sekhar Nori , =?UTF-8?q?Bartosz=20Go=C5=82aszewski?= , Alexandre Bailon , 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index 79cef74e164f..becc3e63b472 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c @@ -193,12 +193,16 @@ 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); if (ret && ret != -ENOIOCTLCMD && ret != -ENODEV) { vpif_dbg(1, debug, "stream on failed in subdev\n"); goto err; } + spin_lock_irqsave(&common->irqlock, flags); + /* Call vpif_set_params function to set the parameters and addresses */ ret = vpif_set_video_params(vpif, ch->channel_id); if (ret < 0) {