From patchwork Sun Mar 15 14:39:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Kaneko X-Patchwork-Id: 6013171 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E6372BF90F for ; Sun, 15 Mar 2015 14:39:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A50D2025B for ; Sun, 15 Mar 2015 14:39:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2FD012024C for ; Sun, 15 Mar 2015 14:39:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752440AbbCOOjq (ORCPT ); Sun, 15 Mar 2015 10:39:46 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:35854 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752455AbbCOOjp (ORCPT ); Sun, 15 Mar 2015 10:39:45 -0400 Received: by padcy3 with SMTP id cy3so38006852pad.3; Sun, 15 Mar 2015 07:39: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; bh=6eq1ExWS+IdjW8dfx6sRWt16xnZi9xFudlYJLGdRDFQ=; b=DLVWkwslF7PgieVmNVrxH7i0J8ueKowijfu5Hm26jZwQyJ4il9LZAVlD4+dPie8ucj GhV8sggJpy1f/P4IQ9U5wmpieIchZNcfunoQclCp5gqAIEDIuxuUTQuVo5gGPg5PukNz MfWYhNxMonNe+06eyADKLOj4EhD5bLaoiq+XB3Hdu+f1vdLkk2mu5naPRAThQ8OntJuc xplyhoeERkIT5FKLHU6HyYYlJ/A8lp4tuP+/3+OnlxnPjtoYsT/tpONd8G4fTg5ss8eX zoQKkxIHo7shARJNBHywRVVJNh9VTR0sVImpqzzNKCKkl9dkTorytLlXRLVhAyD86iLM 2C5Q== X-Received: by 10.66.234.2 with SMTP id ua2mr104590545pac.137.1426430385381; Sun, 15 Mar 2015 07:39:45 -0700 (PDT) Received: from localhost.localdomain (KD118152108246.ppp-bb.dion.ne.jp. [118.152.108.246]) by mx.google.com with ESMTPSA id c16sm12683159pdk.94.2015.03.15.07.39.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 15 Mar 2015 07:39:44 -0700 (PDT) From: Yoshihiro Kaneko To: linux-media@vger.kernel.org Cc: Guennadi Liakhovetski , Simon Horman , Magnus Damm , linux-sh@vger.kernel.org Subject: [PATCH/RFC] media: soc_camera: rcar_vin: Fix wait_for_completion Date: Sun, 15 Mar 2015 23:39:33 +0900 Message-Id: <1426430373-3443-1-git-send-email-ykaneko0929@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org 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, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Koji Matsuoka When stopping abnormally, a driver can't return from wait_for_completion. This patch resolved this problem by changing wait_for_completion_timeout from wait_for_completion. Signed-off-by: Koji Matsuoka Signed-off-by: Yoshihiro Kaneko --- This patch is against master branch of linuxtv.org/media_tree.git. drivers/media/platform/soc_camera/rcar_vin.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index 279ab9f..ff0359b 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c @@ -135,6 +135,8 @@ #define VIN_MAX_WIDTH 2048 #define VIN_MAX_HEIGHT 2048 +#define TIMEOUT_MS 100 + enum chip_id { RCAR_GEN2, RCAR_H1, @@ -821,6 +823,10 @@ static void rcar_vin_wait_stop_streaming(struct rcar_vin_priv *priv) priv->request_to_stop = true; spin_unlock_irq(&priv->lock); wait_for_completion(&priv->capture_stop); + if (!wait_for_completion_timeout( + &priv->capture_stop, + msecs_to_jiffies(TIMEOUT_MS))) + priv->state = STOPPED; spin_lock_irq(&priv->lock); } }