Received: by 2002:a05:6622:f08:0:0:0:0 with SMTP id l8csp4478633ivc; Tue, 3 Nov 2020 13:05:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVQhnXg9qISJ1ZmdLQfJciFT+9V/f2BWysWR1Y+gVAMzVHa1fCnrVJe5DTwrLiWlhuXeg4 X-Received: by 2002:a17:906:c20f:: with SMTP id d15mr21340354ejz.341.1604437529052; Tue, 03 Nov 2020 13:05:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604437529; cv=none; d=google.com; s=arc-20160816; b=ek+ETHSFC+y6KxgVeQXKTpSAC/PaD7wdVhTVbMRgp89q/UKA6ExNWRorYyEtINPTZ/ UqeVwhBmnnLREex6YNISyT4MGFkNTSziSib3ljzLGhLXRLPDukhq8y7BXvpc34NX6X4I 8ydYwo/m8rYVWU1gemRtaomAun2qnaBGzzWeMBwjWiA4ZApYgOhYWcuJKx6w+PI4Ybwu BfnJWIwZokAsmMCAvJX7nE8KhSAxpWnBjpX9W5hYLLy4YKfpofEAeEEdaZO6VSrltPNY jtVcgNcKwnw/dI3VJRfX8PLVSqGzJycLTjycPK+nMuwqyxiFfPkQqy5sQT6tT7KNV5WK PsDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qSNSwktEFgII2hZYlhmOjEKGcSvx+8PermSNrh1Mqug=; b=IZ89fzju9qwVR+BZKzZgBgGIpFctib48DBeBQelc5vMObkXLGgk7OwcM6PxyyIMJRD a2axJoWHONQ6H6USPRTk0e41/gum+u7edW0l0S39cJdZ7GGxGj189YnBgCnCXK2NMA8x fpWpoN+e5/U7WGipEB684hIQWk4Yud92HGXxSlukUrU2wRVAGpvxGzZrUcOO5mL5Vc2o odynXB2rGcfcO5bPBSgxLLjQMBp3MPVv70AR8p5rdPnKHI7LmoiWT/6UmD1GNyWqyN8t +ZUxP7zpKUfPowM8vCGD+pO12Q8Zf+rFxayEh7sdtC7/ckBtgLLvfMKWPImy47p608kT mfEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ehjuYBmr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si13781593edy.584.2020.11.03.13.05.06; Tue, 03 Nov 2020 13:05:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ehjuYBmr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732296AbgKCVDz (ORCPT + 99 others); Tue, 3 Nov 2020 16:03:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:41614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733274AbgKCVDv (ORCPT ); Tue, 3 Nov 2020 16:03:51 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 1673422226; Tue, 3 Nov 2020 21:03:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437430; bh=DpHkQOwzxUaz1MEXJtLnP9egLMImF6ntRtFcCZN60YU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ehjuYBmrsXKbCTp8vH8CDBaEkkh0LQOBFMunferxQRvhPbtWBefUu9jmsOEMocHBv mlVE4GwBeWkk6QfMtLGcByNmmGmw5B+n41joTFCxykwX1wlSH7pGQAAHjNsLKJNRL4 Dh9nmDxv48avK4++gVK+RULX9BTVQU3aTQHiagg4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans Verkuil , Luca Ceresoli , Sakari Ailus , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.19 073/191] media: imx274: fix frame interval handling Date: Tue, 3 Nov 2020 21:36:05 +0100 Message-Id: <20201103203241.209557099@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203232.656475008@linuxfoundation.org> References: <20201103203232.656475008@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans Verkuil [ Upstream commit 49b20d981d723fae5a93843c617af2b2c23611ec ] 1) the numerator and/or denominator might be 0, in that case fall back to the default frame interval. This is per the spec and this caused a v4l2-compliance failure. 2) the updated frame interval wasn't returned in the s_frame_interval subdev op. Signed-off-by: Hans Verkuil Reviewed-by: Luca Ceresoli Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/i2c/imx274.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/imx274.c b/drivers/media/i2c/imx274.c index 8cc3bdb7f608c..0fe8b869245b8 100644 --- a/drivers/media/i2c/imx274.c +++ b/drivers/media/i2c/imx274.c @@ -1239,6 +1239,8 @@ static int imx274_s_frame_interval(struct v4l2_subdev *sd, ret = imx274_set_frame_interval(imx274, fi->interval); if (!ret) { + fi->interval = imx274->frame_interval; + /* * exposure time range is decided by frame interval * need to update it after frame interval changes @@ -1760,9 +1762,9 @@ static int imx274_set_frame_interval(struct stimx274 *priv, __func__, frame_interval.numerator, frame_interval.denominator); - if (frame_interval.numerator == 0) { - err = -EINVAL; - goto fail; + if (frame_interval.numerator == 0 || frame_interval.denominator == 0) { + frame_interval.denominator = IMX274_DEF_FRAME_RATE; + frame_interval.numerator = 1; } req_frame_rate = (u32)(frame_interval.denominator -- 2.27.0