From patchwork Mon Mar 16 16:11: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: 6022751 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 72191BF90F for ; Mon, 16 Mar 2015 16:12:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9F8F7204CF for ; Mon, 16 Mar 2015 16:12:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B987E20481 for ; Mon, 16 Mar 2015 16:12:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933060AbbCPQMB (ORCPT ); Mon, 16 Mar 2015 12:12:01 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:35352 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755074AbbCPQMA (ORCPT ); Mon, 16 Mar 2015 12:12:00 -0400 Received: by pabyw6 with SMTP id yw6so68921288pab.2; Mon, 16 Mar 2015 09:11:59 -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=j6LkVIHU/5UPwWuPhm28zA7ivvIcF3lDwwJNv+BXs9WMUSaZq7sKS6faUWgkWoae0z 06Gx1QlZZdq93shfnllF/zx/PEPas1VajFE/l9DKczggoWQXK7OaM6Yri5bbIfzoBizi zbOW0Dq933M+3rjizNOiFTbw3qoZBWnOeTJSnXIU4S1hiCsdSo7CLMW9nZK9s7ILI/cI phQQwK6dDB2LK1/cnfNK2x4Otnd+I5ynoUpbarV/HhIEpZmD0Xoxpy2w4zQYTluwdmHX l4E4LE7ExTHs+VslPIzQvsO8Arrp/LbWAAlIlFJEQhQ9g8xJIXR5Rnx2psASGIdJlvzs iyIQ== X-Received: by 10.70.18.97 with SMTP id v1mr110849365pdd.152.1426522319295; Mon, 16 Mar 2015 09:11:59 -0700 (PDT) Received: from localhost.localdomain (KD118152108246.ppp-bb.dion.ne.jp. [118.152.108.246]) by mx.google.com with ESMTPSA id r8sm18038877pdp.10.2015.03.16.09.11.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Mar 2015 09:11:58 -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] media: soc_camera: rcar_vin: Fix wait_for_completion Date: Tue, 17 Mar 2015 01:11:33 +0900 Message-Id: <1426522293-25700-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); } }