From patchwork Sat Sep 6 15:26:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 4857741 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E2502C0338 for ; Sat, 6 Sep 2014 15:30:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1D1CD200C1 for ; Sat, 6 Sep 2014 15:30:34 +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 2983E2012F for ; Sat, 6 Sep 2014 15:30:33 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s86FTZXP007863; Sat, 6 Sep 2014 10:29:35 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s86FTYgB013502; Sat, 6 Sep 2014 10:29:34 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Sat, 6 Sep 2014 10:29:34 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s86FTYsa017855; Sat, 6 Sep 2014 10:29:34 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id B4C7B80626; Sat, 6 Sep 2014 10:29:34 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflxv17.itg.ti.com (dflxv17.itg.ti.com [128.247.5.93]) by linux.omap.com (Postfix) with ESMTP id 65E0E80627 for ; Sat, 6 Sep 2014 10:27:48 -0500 (CDT) Received: from medina.ext.ti.com (medina.ext.ti.com [192.91.81.31]) by dflxv17.itg.ti.com (8.14.3/8.13.8) with ESMTP id s86FRmFm028219 for ; Sat, 6 Sep 2014 10:27:48 -0500 Received: from mail6.bemta8.messagelabs.com (mail6.bemta8.messagelabs.com [216.82.243.55]) by medina.ext.ti.com (8.13.7/8.13.7) with ESMTP id s86FRlg6001637 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 6 Sep 2014 10:27:48 -0500 Received: from [216.82.241.195:38201] by server-12.bemta-8.messagelabs.com id 17/E6-26875-3F72B045; Sat, 06 Sep 2014 15:27:47 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-12.tower-119.messagelabs.com!1410017264!29062151!1 X-Originating-IP: [74.125.82.174] 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 15360 invoked from network); 6 Sep 2014 15:27:45 -0000 Received: from mail-we0-f174.google.com (HELO mail-we0-f174.google.com) (74.125.82.174) by server-12.tower-119.messagelabs.com with RC4-SHA encrypted SMTP; 6 Sep 2014 15:27:45 -0000 Received: by mail-we0-f174.google.com with SMTP id w61so1587921wes.5 for ; Sat, 06 Sep 2014 08:27:44 -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=IKJcbcrJLnRVcvSOo4xTzgRbnDTiH9uE73DHh6deHoY=; b=HHz5bR9aKy3OQVfDaZ3lQJcHs0Xl17A6VeMoILZNhOICvGGGcC++gSFqxtqj4+vqb8 Nvp5laZyXej7h+vpmx17xPhYdZnd6MDnIx8Cme35T6O8U+HUcdbXQ/ze5onyrXIfGvVK 6gqr0KZZSVmJCX51+iqUm4v5mBc51tE9dIdDLBPC7U5JHpHG8YnQr0TIBTvJuSwfNa13 tAK0C+Ujw1dQVsW+Ltu4YUND37l609uVCLwDARGlVjlfom3rMTRh8NSOANj1BT/X7AT/ rye3W8SvIVhciYKf9gGqjodaSQIS09gThjsnMKjfBu2Oqxw+fIXQawrWP5gb7iXrzfkU BKkA== X-Received: by 10.180.160.229 with SMTP id xn5mr10793115wib.64.1410017264370; Sat, 06 Sep 2014 08:27:44 -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.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 06 Sep 2014 08:27:43 -0700 (PDT) From: "Lad, Prabhakar" To: LMML Subject: [PATCH 4/5] media: davinci: vpif_display: fix the check on suspend/resume callbacks Date: Sat, 6 Sep 2014 16:26:50 +0100 Message-ID: <1410017211-15438-5-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_display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index 76f829d..8d6ced5 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c @@ -1400,7 +1400,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); @@ -1432,7 +1432,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);