From patchwork Tue Nov 22 01:44: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: 9440419 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 EC9E060235 for ; Tue, 22 Nov 2016 01:44:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3D1A28384 for ; Tue, 22 Nov 2016 01:44:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4E6928AEC; Tue, 22 Nov 2016 01:44: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 C81F928384 for ; Tue, 22 Nov 2016 01:44:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754313AbcKVBoX (ORCPT ); Mon, 21 Nov 2016 20:44:23 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:33865 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754314AbcKVBoT (ORCPT ); Mon, 21 Nov 2016 20:44:19 -0500 Received: by mail-pf0-f175.google.com with SMTP id c4so829818pfb.1 for ; Mon, 21 Nov 2016 17:44:13 -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=XlBWMjpjhMUKgTmZLLpZTQVCdXmu7rUs9oyqq8tkrKA=; b=loyNxm7bDvGehmlFADx+/7B3tMglWL6kt13fYymp2nFNXj24h/tTIpRGd7ILabuKfA tfdd1k9vsDfoNjc69ZYa3qAVZnc66ECDcHf/w1CamgVm5t3k3UWbOVxPO20koXA0DMuj j0YNelfLea4jSP4tBzHSe0BugaoKjC8RO8THn7phLERzADL3kQp91IRPvb5oKLthG70u hv4xwhcIF2sp/mtdDXIleFu8yrx9DaDpRzf5ptTtEh0CIDXxJS1UzJUu0wv+cxUF/kbT Wz+NvcxIKu02FGN78kFasW+lUJUBjASINEgKkYJL2vfTsv3DxkxkJH5ahbrPCEjo1Hpu 3TaA== 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=XlBWMjpjhMUKgTmZLLpZTQVCdXmu7rUs9oyqq8tkrKA=; b=IBnOYJAqCFVGfstsMXM4+RXqByfHAbU7TPdP4gTuOxcKBpUWTcG4E1hBursMia0u29 CVUzirTl6hPXnOtoOUDs1wmKeVbrKIa+coi8N9cLV3o03IoPhuBub+Y2TR+EmU4jvotX 7MVaG/As+NlINaYeVcv5W0wC7VfxpkiXVzlUE56xaLDFU09XM5+QZ041LmsoH1XSMWlJ XV7fRYPkWBkyWphHJ2h5gKzi0f4pKaOLGOhhanEZUzDSp+7YC0NnJk6tFruawJhrVThV eR4acCQFojw2rPW4LoR2VFcsYLDsF56KPPlCO1+KcUd08jPSKtYU9OnAiVVdx0JUL5U9 xndA== X-Gm-Message-State: AKaTC01AvhYIHKPox9NfFOMJfaf/unfTmWjQa2rY8iKmPrZuTFHVFJqQzgEdUcxkizDLdH+L X-Received: by 10.98.68.140 with SMTP id m12mr22421634pfi.19.1479779052525; Mon, 21 Nov 2016 17:44:12 -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 r74sm40212408pfl.79.2016.11.21.17.44.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Nov 2016 17:44:12 -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 v2 2/4] [media] davinci: vpif_capture: don't lock over s_stream Date: Mon, 21 Nov 2016 17:44:06 -0800 Message-Id: <20161122014408.22388-3-khilman@baylibre.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161122014408.22388-1-khilman@baylibre.com> References: <20161122014408.22388-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 87ee1e2c3864..94ee6cf03f02 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;