From patchwork Sun Mar 29 13:04:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Kaneko X-Patchwork-Id: 6115621 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E93159F32E for ; Sun, 29 Mar 2015 13:06:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1050A20266 for ; Sun, 29 Mar 2015 13:06:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A8FB02020F for ; Sun, 29 Mar 2015 13:06:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752684AbbC2NGG (ORCPT ); Sun, 29 Mar 2015 09:06:06 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:36728 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751647AbbC2NGF (ORCPT ); Sun, 29 Mar 2015 09:06:05 -0400 Received: by padcy3 with SMTP id cy3so141188434pad.3; Sun, 29 Mar 2015 06:06:04 -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=x9wgUANMSO9BtyeEV/6U5hCIGRvWPOBgsc/M3tuK2XE=; b=ZikjuFw3Z83H8UaRtzSzGll5JW9YLAjOf+c7LlPDXeEryV/Wzq+LgiL/yNzDNnjA4o ptxiS/paR9suRy7RAgqggbHTdvuNyvQakJKgYPo4xf5Jxgoi938d+PBa6CnCzu9eAghC sz/DWvWneAkV8GH822/ah94u1qZDH1rQgd3Bok8uf3QJjZ9eWaAfyG2EUTsyMTSnNSIV v0Z9UbFTzT715svO31nGtPVxmz8wdYRZTD3ucFS1azlb2E4Dv6sj+geJdYj3aKCNJOkY CY29MMNMJOxYBDeFoZP3A0Wi2hw8pp/q3lPqJ3DsjPOzm10hioUpx6SoPvJQ5FDGd33U hJLg== X-Received: by 10.68.224.69 with SMTP id ra5mr19020494pbc.161.1427634364673; Sun, 29 Mar 2015 06:06:04 -0700 (PDT) Received: from localhost.localdomain (KD118152108246.ppp-bb.dion.ne.jp. [118.152.108.246]) by mx.google.com with ESMTPSA id k9sm7542132pdp.24.2015.03.29.06.06.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 29 Mar 2015 06:06:03 -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 v2 repost] media: soc_camera: rcar_vin: Fix wait_for_completion Date: Sun, 29 Mar 2015 22:04:56 +0900 Message-Id: <1427634296-3778-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. v2 [Yoshihiro Kaneko] * remove the original line that I forgot. * fix an indent to make it easy to read. drivers/media/platform/soc_camera/rcar_vin.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index 279ab9f..e55d7ba 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, @@ -820,7 +822,10 @@ static void rcar_vin_wait_stop_streaming(struct rcar_vin_priv *priv) if (priv->state == STOPPING) { 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); } }