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: 9395727 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 97E1860233 for ; Tue, 25 Oct 2016 23:55:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50E9E2957C for ; Tue, 25 Oct 2016 23:55:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45AE529591; Tue, 25 Oct 2016 23:55:52 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 1282029590 for ; Tue, 25 Oct 2016 23:55:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754408AbcJYXzr (ORCPT ); Tue, 25 Oct 2016 19:55:47 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:34774 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754125AbcJYXzn (ORCPT ); Tue, 25 Oct 2016 19:55:43 -0400 Received: by mail-pf0-f171.google.com with SMTP id n85so11119760pfi.1 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=aSm6gqRStUjA8HQk2f+L1vRUJNsXpJxczzCNNifmcgiRWrn9fL6A8F/R0VBmiQ+LDi eBtkE6IzFRFvXyLUkiSta5R1tb21MIQC34cbp4ZEc84l5My+9uFvGNQFjbnd9iI5k4ie 8X2qXH8i2fsv558W/m61ALsDfTpralOpPL5ReP8F9DUt7yyS0hjTlgngG+BByqaqPOle nrWb9dqWEgwTYen4bltThy/EhqXs4ZC3c/8P4PzUsLgZ1a5qi89TS1ugDlirimmj+hq2 s/wFu72rzQL22prHsy7xEpWtM/kf38Bwcs5hg0olRV08kfM90G1LKmSNw3czo5lJ8dtO f3Dw== X-Gm-Message-State: ABUngvfkdDh73WaQMO574vXq7u7yeFfuNc6xxep54W6eUCorpjZmbUk6QCPHi0mvx9Gt2XTh 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 Cc: Sekhar Nori , Axel Haslam , =?UTF-8?q?Bartosz=20Go=C5=82aszewski?= , Alexandre Bailon , David Lechner , linux-arm-kernel@lists.infradead.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 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) {