From patchwork Fri Jan 24 09:31:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233143 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2996C2D0DB for ; Fri, 24 Jan 2020 10:03:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B61C121556 for ; Fri, 24 Jan 2020 10:03:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579860196; bh=pOWZgtTgHHlotF6QT7b3kDeyYUXeuvWpUTA61QfPb+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ji+fTg8dYf1Su+JhTZLjuoVMVCdZaVDychqXhEFb6EsYK0XQtaB5peUAE3pEBsBWC /jr/YrajQsUfw7i6TjobC7UXQF1ZqrOFBdsssU4bvuqKZbbQglpEWTeCH5TDrN2bWQ AmTHCUj56u8ZcKSGEIsYU/D5O5E1IBKycW5LLAvk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388752AbgAXKDI (ORCPT ); Fri, 24 Jan 2020 05:03:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:38740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388984AbgAXKDG (ORCPT ); Fri, 24 Jan 2020 05:03:06 -0500 Received: from localhost (unknown [145.15.244.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8A4AD20709; Fri, 24 Jan 2020 10:03:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579860186; bh=pOWZgtTgHHlotF6QT7b3kDeyYUXeuvWpUTA61QfPb+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mCQJNAHlWeQdD+NwRgJHoQP3r4ivSpiFpkCSPufKvv0OynwHP8LdLSPmAwRzrVaI0 VRMEvqgP+RwbzRL7SQZQLMC0x45mEjVZxgbCfQWAwgftu1mND8XXaexTy/YUYIbXnl rNoOyTtaCNU9ctrp6wvaskLH+6FgA+lYchcgF5VU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexandre Kroupski , Eugen Hristev , Sakari Ailus , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.14 279/343] media: atmel: atmel-isi: fix timeout value for stop streaming Date: Fri, 24 Jan 2020 10:31:37 +0100 Message-Id: <20200124092956.783978655@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124092919.490687572@linuxfoundation.org> References: <20200124092919.490687572@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Alexandre Kroupski [ Upstream commit 623fd246bb40234fe68dd4e7c1f1f081f9c45a3d ] In case of sensor malfunction, stop streaming timeout takes much longer than expected. This is due to conversion of time to jiffies: milliseconds multiplied with HZ (ticks/second) gives out a value of jiffies with 10^3 greater. We need to also divide by 10^3 to obtain the right jiffies value. In other words FRAME_INTERVAL_MILLI_SEC must be in seconds in order to multiply by HZ and get the right jiffies value to add to the current jiffies for the timeout expire time. Fixes: 195ebc43bf76 ("[media] V4L: at91: add Atmel Image Sensor Interface (ISI) support") Signed-off-by: Alexandre Kroupski Reviewed-by: Eugen Hristev Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/atmel/atmel-isi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c index 891fa2505efa0..2f962a3418f63 100644 --- a/drivers/media/platform/atmel/atmel-isi.c +++ b/drivers/media/platform/atmel/atmel-isi.c @@ -496,7 +496,7 @@ static void stop_streaming(struct vb2_queue *vq) spin_unlock_irq(&isi->irqlock); if (!isi->enable_preview_path) { - timeout = jiffies + FRAME_INTERVAL_MILLI_SEC * HZ; + timeout = jiffies + (FRAME_INTERVAL_MILLI_SEC * HZ) / 1000; /* Wait until the end of the current frame. */ while ((isi_readl(isi, ISI_STATUS) & ISI_CTRL_CDC) && time_before(jiffies, timeout))