From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.3 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_SANE_1 autolearn=ham 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 EE741C4332D for ; Thu, 19 Mar 2020 14:50:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE4D320782 for ; Thu, 19 Mar 2020 14:50:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jfzfIlN0"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="c/jB37cd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE4D320782 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VXyALF5R7ZKLe5m4G/SoIqUIZ6YwxEggD4UKOBJyGO0=; b=jfzfIlN05+Hbdx 5sXMLLrEIaHsDZtvim98/MzA1EBdh/V3CuZ0Sso+RJSifNDPaLKM46x37WfvUjdz7wCqTQHT8sJhc 79nPjMSMgOyEkr/fxdPxI4q6eJRWJZ/pm+Z1J0+ecFc2VC9jFx57GVu/WgLCNyLrIfgjgsA2TLuVt KHz+VSrmUhkzzGbvu1GSbSOkZQJAx8lG5S3t8su4qTkBTSQ5+2lud/Cl9PwYvCPWPfUe7eOvhPYTa uSsSSMDsKcVS/yOYlj6ZaMNBSRizJS7eVyPKNDpfjvOz2wNjS6KbSn1w2XHPXTI2L2BGv2QRNXpX2 gsJtmyDvyVzLvuXHMWLA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jEwVA-00021g-9b; Thu, 19 Mar 2020 14:50:28 +0000 Received: from perceval.ideasonboard.com ([2001:4b98:dc2:55:216:3eff:fef7:d647]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jEwV6-000215-IY for linux-arm-kernel@lists.infradead.org; Thu, 19 Mar 2020 14:50:25 +0000 Received: from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A5D2AA53; Thu, 19 Mar 2020 15:50:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1584629417; bh=Pby7Rfq98gCjrIQMddd1yja9dLfow5voxs2h3guV+As=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=c/jB37cddxIH58tafwLvJabTiL6v7j8NXqUDy/OZfrKwJ5UmZYFYTKUgxkadrlMD+ oXxrR2AZLl9dopTWTs2TaZczsuCSoZbZR6/N4YkrMlNAOp5huLu0H1288VEg2YJhsQ BRnZmQnWGxtddFyZ652yVvb07WU+SF2oFyagIiMw= Date: Thu, 19 Mar 2020 16:50:12 +0200 From: Laurent Pinchart To: Lad Prabhakar Subject: Re: [PATCH v4 3/5] media: i2c: ov5645: Increase tolerance of external clock frequency Message-ID: <20200319145012.GB14585@pendragon.ideasonboard.com> References: <1584620363-2255-1-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com> <1584620363-2255-4-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1584620363-2255-4-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200319_075024_760745_FE28EBFA X-CRM114-Status: GOOD ( 20.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Pengutronix Kernel Team , Fabio Estevam , Sascha Hauer , Kieran Bingham , linux-kernel@vger.kernel.org, Lad Prabhakar , Rob Herring , NXP Linux Team , Sakari Ailus , Mauro Carvalho Chehab , Shawn Guo , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Prabhakar, Thank you for the patch. On Thu, Mar 19, 2020 at 12:19:21PM +0000, Lad Prabhakar wrote: > While testing on Renesas RZ/G2E platform, noticed the clock frequency to > be 24242424 as a result the probe failed. > > This patch increases the tolerance to 5% so that it avoids patching for > new platforms and it warns the users if the frequency is not within the > range and continue further in the probe instead of returning failure. > > Signed-off-by: Lad Prabhakar > --- > drivers/media/i2c/ov5645.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c > index e298acdadeef..52a185ed4368 100644 > --- a/drivers/media/i2c/ov5645.c > +++ b/drivers/media/i2c/ov5645.c > @@ -1105,13 +1105,11 @@ static int ov5645_probe(struct i2c_client *client) > } > } > > - /* external clock must be 24MHz, allow 1% tolerance */ > + /* ideally external clock must be 24MHz, allow 5% tolerance */ > xclk_freq = clk_get_rate(ov5645->xclk); > - if (xclk_freq < 23760000 || xclk_freq > 24240000) { > - dev_err(dev, "external clock frequency %u is not supported\n", > - xclk_freq); > - return -EINVAL; > - } > + if (xclk_freq < 22800000 || xclk_freq > 25200000) > + dev_warn(dev, "external clock frequency is set to %u, sensor might misbehave\n", > + xclk_freq); The code looks good to me. You may want to mention in the commit subject that the probe error is turned into a warning, but that may be hard to do on a single line. Splitting this in two patches could be best, but is not worth a new version if it's the only change required. If more changes are required, you can consider it. Reviewed-by: Laurent Pinchart > for (i = 0; i < OV5645_NUM_SUPPLIES; i++) > ov5645->supplies[i].supply = ov5645_supply_name[i]; -- Regards, Laurent Pinchart _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel