Message ID | 20161119003208.10550-2-khilman@baylibre.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Hans Verkuil |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from <linux-media-owner@vger.kernel.org>) id 1c7tZv-0003Y1-26; Sat, 19 Nov 2016 00:32:23 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.84_2/mailfrontend-6) with esmtp id 1c7tZs-0003Gc-5m; Sat, 19 Nov 2016 01:32:22 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753364AbcKSAcO (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); 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 <rfc822;linux-media@vger.kernel.org>); Fri, 18 Nov 2016 19:32:12 -0500 Received: by mail-pg0-f51.google.com with SMTP id x23so105241560pgx.1 for <linux-media@vger.kernel.org>; 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 <khilman@baylibre.com> To: linux-media@vger.kernel.org, Hans Verkuil <hverkuil@xs4all.nl> Cc: devicetree@vger.kernel.org, Sekhar Nori <nsekhar@ti.com>, Axel Haslam <ahaslam@baylibre.com>, =?UTF-8?q?Bartosz=20Go=C5=82aszewski?= <bgolaszewski@baylibre.com>, Alexandre Bailon <abailon@baylibre.com>, David Lechner <david@lechnology.com> 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 Content-Transfer-Encoding: 8bit Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2016.11.19.2716 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1200_1299 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, DKIM_SIGNATURE 0, IN_REP_TO 0, LEGITIMATE_NEGATE 0, LEGITIMATE_SIGNS 0, MSG_THREAD 0, MULTIPLE_REAL_RCPTS 0, NO_URI_HTTPS 0, REFERENCES 0, SINGLE_URI_IN_BODY 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CC_NAME 0, __CC_NAME_DIFF_FROM_ACC 0, __CC_REAL_NAMES 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __CTE 0, __FROM_DOMAIN_IN_ANY_CC2 0, __FROM_DOMAIN_IN_RCPT 0, __HAS_CC_HDR 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __NO_HTML_TAG_RAW 0, __REFERENCES 0, __SANE_MSGID 0, __SINGLE_URI_TEXT 0, __TO_MALFORMED_2 0, __TO_NAME 0, __TO_NAME_DIFF_FROM_ACC 0, __TO_NO_NAME 0, __TO_REAL_NAMES 0, __URI_IN_BODY 0, __URI_NO_WWW 0, __URI_NS , __URI_WITH_PATH 0, __YOUTUBE_RCVD 0' |
Commit Message
Kevin Hilman
Nov. 19, 2016, 12:32 a.m. UTC
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 <khilman@baylibre.com>
---
drivers/media/platform/davinci/vpif_capture.c | 4 ++++
1 file changed, 4 insertions(+)
Comments
On 19/11/16 01:32, Kevin Hilman wrote: > 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 <khilman@baylibre.com> > --- > 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); This needs to be moved to right after the v4l2_subdev_call, otherwise the goto err above will not have the spinlock. Hans > + > /* Call vpif_set_params function to set the parameters and addresses */ > ret = vpif_set_video_params(vpif, ch->channel_id); > if (ret < 0) { > -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hans Verkuil <hverkuil@xs4all.nl> writes: > On 19/11/16 01:32, Kevin Hilman wrote: >> 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 <khilman@baylibre.com> >> --- >> 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); > > This needs to be moved to right after the v4l2_subdev_call, otherwise the > goto err above will not have the spinlock. Yes indeed. Will respin. Kevin -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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) {