From patchwork Sat Sep 6 15:26:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar X-Patchwork-Id: 4857731 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3E2629F32F for ; Sat, 6 Sep 2014 15:30:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AB06E2013D for ; Sat, 6 Sep 2014 15:30:26 +0000 (UTC) Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AB89420138 for ; Sat, 6 Sep 2014 15:30:25 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s86FTadD007880; Sat, 6 Sep 2014 10:29:36 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s86FTaMU004374; Sat, 6 Sep 2014 10:29:36 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Sat, 6 Sep 2014 10:29:36 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s86FTaTt023285; Sat, 6 Sep 2014 10:29:36 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 3E8C68062E; Sat, 6 Sep 2014 10:29:36 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dlelxv84.itg.ti.com (dlelxv84.itg.ti.com [172.17.0.246]) by linux.omap.com (Postfix) with ESMTP id 36DAC80626 for ; Sat, 6 Sep 2014 10:27:48 -0500 (CDT) Received: from neches.ext.ti.com (neches.ext.ti.com [192.91.81.29]) by dlelxv84.itg.ti.com (8.14.3/8.13.8) with ESMTP id s86FRlZj015211 for ; Sat, 6 Sep 2014 10:27:47 -0500 Received: from mail6.bemta8.messagelabs.com (mail6.bemta8.messagelabs.com [216.82.243.55]) by neches.ext.ti.com (8.13.7/8.13.7) with ESMTP id s86FRlI0026595 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 6 Sep 2014 10:27:47 -0500 Received: from [216.82.241.195:46609] by server-11.bemta-8.messagelabs.com id B1/C2-25814-3F72B045; Sat, 06 Sep 2014 15:27:47 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-3.tower-119.messagelabs.com!1410017265!31682528!1 X-Originating-IP: [209.85.212.171] X-SpamReason: No, hits=0.2 required=7.0 tests=ML_RADAR_SPEW_LINKS_14, RCVD_ILLEGAL_IP,spamassassin: X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 15475 invoked from network); 6 Sep 2014 15:27:46 -0000 Received: from mail-wi0-f171.google.com (HELO mail-wi0-f171.google.com) (209.85.212.171) by server-3.tower-119.messagelabs.com with RC4-SHA encrypted SMTP; 6 Sep 2014 15:27:46 -0000 Received: by mail-wi0-f171.google.com with SMTP id hi2so708708wib.10 for ; Sat, 06 Sep 2014 08:27:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CUWBmRCCs+iMPEkupLacFDVEBICgmFKqsijxuTnViRE=; b=x5f9CRSly0QyP0tBFaZP2XRcmf7uSyhkJDi4wx+a7UwsZE2MuuTVOWdNF5KqcNROUM bkka/hRMUwHcVB3RsgR/qKdxXpuVVoiyYLJWpphse6aBB7lehnR7baLwvVYrJKbmXgzf V0ROPD8wXWK/KZOmfo7IVf9th7EZQ7m1yqoeVQwsLn9s6RmzxgXV0wpVzdqEVgoxV44u JcwnCz3P6xxqIvV7H5WTcyhhT9DEBo1kTrmUp4pAklTsVr1JnUWtP5b7Lm6ANLXB26qr aGjnzQ7U1mJMq7wY0xLJeSTyGCNtCDUlYP7+AwOWc1BD4qI8N8IZY6m7Gc0mk6y3ZVQy ZWWg== X-Received: by 10.180.184.20 with SMTP id eq20mr10430169wic.61.1410017265422; Sat, 06 Sep 2014 08:27:45 -0700 (PDT) Received: from tango-charlie.Home ([2.127.193.40]) by mx.google.com with ESMTPSA id bg10sm4831620wjc.47.2014.09.06.08.27.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 06 Sep 2014 08:27:44 -0700 (PDT) From: "Lad, Prabhakar" To: LMML Subject: [PATCH 5/5] media: davinci: vpif_capture: fix the check on suspend/resume callbacks Date: Sat, 6 Sep 2014 16:26:51 +0100 Message-ID: <1410017211-15438-6-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1410017211-15438-1-git-send-email-prabhakar.csengg@gmail.com> References: <1410017211-15438-1-git-send-email-prabhakar.csengg@gmail.com> CC: DLOS , Hans Verkuil , LKML , Mauro Carvalho Chehab X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is possible to call STREAMON without having any buffers queued. So vb2_is_streaming() can return true without start_streaming() having been called. Only after at least one buffer has been queued will start_streaming be called. The check vb2_is_streaming() is incorrect as this would start the DMA without having proper DMA pointers set up. this patch uses vb2_start_streaming_called() instead to check is streaming was called. Signed-off-by: Lad, Prabhakar --- drivers/media/platform/davinci/vpif_capture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index 881efcd..3ccb26f 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c @@ -1596,7 +1596,7 @@ static int vpif_suspend(struct device *dev) ch = vpif_obj.dev[i]; common = &ch->common[VPIF_VIDEO_INDEX]; - if (!vb2_is_streaming(&common->buffer_queue)) + if (!vb2_start_streaming_called(&common->buffer_queue)) continue; mutex_lock(&common->lock); @@ -1630,7 +1630,7 @@ static int vpif_resume(struct device *dev) ch = vpif_obj.dev[i]; common = &ch->common[VPIF_VIDEO_INDEX]; - if (!vb2_is_streaming(&common->buffer_queue)) + if (!vb2_start_streaming_called(&common->buffer_queue)) continue; mutex_lock(&common->lock);