From patchwork Tue Sep 13 23:16:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 9330069 X-Patchwork-Delegate: geert@linux-m68k.org 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 38A58608A0 for ; Tue, 13 Sep 2016 23:16:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 282F5297F6 for ; Tue, 13 Sep 2016 23:16:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D3DC297F9; Tue, 13 Sep 2016 23:16:37 +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 BC8A0297F8 for ; Tue, 13 Sep 2016 23:16:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759310AbcIMXQf (ORCPT ); Tue, 13 Sep 2016 19:16:35 -0400 Received: from galahad.ideasonboard.com ([185.26.127.97]:46920 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758819AbcIMXQe (ORCPT ); Tue, 13 Sep 2016 19:16:34 -0400 Received: from avalon.bb.dnainternet.fi (85-23-193-79.bb.dnainternet.fi [85.23.193.79]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id E1E1D208A1; Wed, 14 Sep 2016 01:16:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1473808561; bh=CDnXiqMLayqjTJ83oF05j4v6GHQceSd2abO4QLkb37c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OKFAmMt3ip9/8MAryXG1ae1JJGEpdoTLiqf1SUldSX7FyW9jP0mNn97OOw6hT7GiJ vdB1QkQU2Xme9av66re79GyIfeYLLbjVJrlP5TFSg2CYhwkTSJDEe0FcsE9AWAGgWR PPiPiLk8sBL+2IfRvKubSaYogSTa2F3LIHzfxGg0= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Kieran Bingham Subject: [PATCH 03/13] v4l: vsp1: Ensure pipeline locking in resume path Date: Wed, 14 Sep 2016 02:16:56 +0300 Message-Id: <1473808626-19488-4-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1473808626-19488-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> References: <1473808626-19488-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kieran Bingham The vsp1_pipeline_ready() and vsp1_pipeline_run() functions must be called with the pipeline lock held, fix the resume code path. Signed-off-by: Kieran Bingham Signed-off-by: Laurent Pinchart Acked-by: Niklas Söderlund --- drivers/media/platform/vsp1/vsp1_pipe.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/platform/vsp1/vsp1_pipe.c b/drivers/media/platform/vsp1/vsp1_pipe.c index 3e75fb3fcace..474de82165d8 100644 --- a/drivers/media/platform/vsp1/vsp1_pipe.c +++ b/drivers/media/platform/vsp1/vsp1_pipe.c @@ -365,6 +365,7 @@ void vsp1_pipelines_suspend(struct vsp1_device *vsp1) void vsp1_pipelines_resume(struct vsp1_device *vsp1) { + unsigned long flags; unsigned int i; /* Resume all running pipelines. */ @@ -379,7 +380,9 @@ void vsp1_pipelines_resume(struct vsp1_device *vsp1) if (pipe == NULL) continue; + spin_lock_irqsave(&pipe->irqlock, flags); if (vsp1_pipeline_ready(pipe)) vsp1_pipeline_run(pipe); + spin_unlock_irqrestore(&pipe->irqlock, flags); } }