From patchwork Fri Sep 14 13:53:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 1458951 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by patchwork2.kernel.org (Postfix) with ESMTP id A9D5CDF280 for ; Fri, 14 Sep 2012 13:54:13 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id q8EDsDlu013181 for ; Fri, 14 Sep 2012 08:54:13 -0500 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8EDsDv8031637 for ; Fri, 14 Sep 2012 08:54:13 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Fri, 14 Sep 2012 08:54:12 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8EDsCo3025074 for ; Fri, 14 Sep 2012 08:54:12 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 9CAFA80628 for ; Fri, 14 Sep 2012 08:54:12 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 01EFA80626 for ; Fri, 14 Sep 2012 08:54:07 -0500 (CDT) Received: from red.ext.ti.com (red.ext.ti.com [192.94.93.37]) by dflp52.itg.ti.com (8.13.7/8.13.8) with ESMTP id q8EDs6GX016736 for ; Fri, 14 Sep 2012 08:54:06 -0500 (CDT) Received: from psmtp.com (na3sys009amx239.postini.com [74.125.149.123]) by red.ext.ti.com (8.13.7/8.13.7) with SMTP id q8EDs5R7006775 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 14 Sep 2012 08:54:06 -0500 Received: from mail-pb0-f45.google.com ([209.85.160.45]) (using TLSv1) by na3sys009amx239.postini.com ([74.125.148.10]) with SMTP; Fri, 14 Sep 2012 08:54:06 CDT Received: by pbbrp12 with SMTP id rp12so5926463pbb.4 for ; Fri, 14 Sep 2012 06:54:05 -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:x-mailer; bh=a3hJ96bWKLvTUbBF1BWL+Ymg9TkrHuG5ZNviLBhVyco=; b=Pdytq3BIMTXDZQ7sEGAPgl4d/Kf0qQDzxILdpnLnMdFYMgSG19t13vzvNI0hXDvDOd o0glY+ZqzcRRGNwtRwr9nyzxr/kSS6A5FNf1YcfD9YTceCD+/5UefG7ZgtznDPi40G60 lUP3j1nb1Z6YhcN7j2Tv51wZ6tV0Va9yjFKR2WM1kbTQUAL5EMjnYEm8dBt0mbCujq61 tIpXl8XHStN9YvXoINqFgedeD2q3fYqOiP3M9hi7uOEoq7sX2Onui6bJgjSUfbcZZTLH GA0apSGgFXOFenWqZsd0A3M2E0+p5ENEvwQf+ZSuHt3fcz1LQSDgrzWMXJb8EG5WUdiI ByZw== Received: by 10.68.223.3 with SMTP id qq3mr5156813pbc.88.1347630845069; Fri, 14 Sep 2012 06:54:05 -0700 (PDT) Received: from localhost.localdomain ([122.166.13.141]) by mx.google.com with ESMTPS id tt6sm1020328pbc.51.2012.09.14.06.54.01 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 14 Sep 2012 06:54:04 -0700 (PDT) From: Prabhakar Lad To: LMML Subject: [PATCH] davinci: vpif: capture/display: fix race condition Date: Fri, 14 Sep 2012 19:23:56 +0530 Message-ID: <1347630836-7545-1-git-send-email-prabhakar.lad@ti.com> X-Mailer: git-send-email 1.7.4.1 X-pstn-levels: (S:46.62549/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-dkim: 1 skipped:not-enabled X-pstn-settings: 2 (0.5000:0.0050) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [82/3] CC: DLOS , David Oleszkiewicz , LKML , Hans Verkuil , 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+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com From: Lad, Prabhakar channel_first_int[][] variable is used as a flag for the ISR, This flag was being set after enabling the interrupts, There where suitaions when the isr ocuurend even before the flag was set dues to which it was causing the applicaiotn hang. This patch sets channel_first_int[][] flag just before enabling the interrupt. Reported-by: David Oleszkiewicz Signed-off-by: Lad, Prabhakar Signed-off-by: Manjunath Hadli Cc: Hans Verkuil --- drivers/media/platform/davinci/vpif_capture.c | 2 +- drivers/media/platform/davinci/vpif_display.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index 1b625b0..f64919b 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c @@ -339,6 +339,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) * Set interrupt for both the fields in VPIF Register enable channel in * VPIF register */ + channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1; if ((VPIF_CHANNEL0_VIDEO == ch->channel_id)) { channel0_intr_assert(); channel0_intr_enable(1); @@ -350,7 +351,6 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) channel1_intr_enable(1); enable_channel1(1); } - channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1; return 0; } diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index 4a24848..523a840 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c @@ -302,6 +302,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) /* Set interrupt for both the fields in VPIF Register enable channel in VPIF register */ + channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1; if (VPIF_CHANNEL2_VIDEO == ch->channel_id) { channel2_intr_assert(); channel2_intr_enable(1); @@ -318,7 +319,6 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) if (vpif_config_data->ch3_clip_en) channel3_clipping_enable(1); } - channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1; return 0; }