From patchwork Sat Nov 19 00:32:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 9437701 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 D1DB260469 for ; Sat, 19 Nov 2016 00:32:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C298729A6D for ; Sat, 19 Nov 2016 00:32:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B787329A6F; Sat, 19 Nov 2016 00:32:21 +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 F224529A6E for ; Sat, 19 Nov 2016 00:32:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753364AbcKSAcO (ORCPT ); Fri, 18 Nov 2016 19:32:14 -0500 Received: from mail-pg0-f51.google.com ([74.125.83.51]:34522 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753016AbcKSAcM (ORCPT ); Fri, 18 Nov 2016 19:32:12 -0500 Received: by mail-pg0-f51.google.com with SMTP id x23so105241560pgx.1 for ; Fri, 18 Nov 2016 16:32:12 -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=pdNT/4PUa4tIEJ8uk0c1ipYBmSbRPQQD4DGtYDgmCq0=; b=HWRa942/MWU5FxF2Zq1L1Ho3qpJ6fLg9wQaNRhUpLbXPS8GB50PqSeT8ehjlmlcUQC BBzBuPchaFGX71BMGWL40oIgHiHtW+XjYKyyVu3DC0bFvwyGszAPrQvycRnDxvqDJZV1 YzIvc09qpf9zY0ufyT4eUSJx9IoSvng82DPzg9JlcNbHU+6LFaAreRffRCD4gTCz8v6y i10qD0I6U+8gnnt9qlGStbuLwEIYrOXkeM2WIb9oPdkBTYQW618dSrEZtZdU0Snqva6b 4gdZaWHiL2+8YpRdRK2G+feA3fGeDb+dk88tBiw+hsxAAq1XwUhuRm6tFpmKqe+Yd3EH ETeQ== 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=Ut3LgNSudaRD3tbHOWlESC8ymaPOi2abKbAs8qjYccT13HlyHfkcAZiBV7bEDogX5M A5E3b5RMhdqrnykktI6emujLu/OtTFK6LVUXeDHM8LLsotEKRjQKQdfydN/cfT1t0iF8 c483AD/8NmCE4zhrc6f6W/RQsDz7gsuaVzLnD2JGYOoRTgBX3oVVShtJP91O/b8U+8oY IYWkqI8ozMDKy9XHi5VpWQOTysLlenE+/ZTwlrpjHIWzGRoOved7ue0mBvI5U4K+gr59 X9MVU+uCP6V9QQqI6ybF07yt4tfOtS5rTtJAMuMkfcDK9zJrxq7uBzu2P7LiVjFYsMZd w44g== X-Gm-Message-State: AKaTC03LE8oBVJqD+Ai2rUGpU/lnUikyq6nh5rD8/igjAOVvi5E7U8EJ6UpVhuaOXpcOLdYG X-Received: by 10.99.37.2 with SMTP id l2mr5043505pgl.160.1479515531485; Fri, 18 Nov 2016 16:32:11 -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 w5sm20508154pfl.31.2016.11.18.16.32.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Nov 2016 16:32:10 -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 2/4] [media] davinci: vpif_capture: don't lock over s_stream Date: Fri, 18 Nov 2016 16:32:06 -0800 Message-Id: <20161119003208.10550-2-khilman@baylibre.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161119003208.10550-1-khilman@baylibre.com> References: <20161119003208.10550-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 | 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) {