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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5FAF0EB64D7 for ; Tue, 13 Jun 2023 23:40:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=Utv5HeqPmXdvDH5u3gQJpgY9IdWq9Juh6xGINAzUtGs=; b=jUMOJmX2GlrAag 33tdPpQEVaDVWXhOeASnfxvylPl9GjNyAdm4QiKy3x5lxOxplnzPe9Aw2QWcM9T6mn+l3mRDAsy0r ffSRAZ9cWcghfY4PM93aYV6cAAJW/40B0N4pW2kTyS4kZ7R7b9ughi/dYSb3F4qcQl8jm4V/kg12K GJCBVWoMy30GrkXLcY9t98uXLdlVUB+OgkXkj+4b0SP01LSZ9J2XElMD7D4N2s6e6cLExGmxVz5no NPKg2W2xbXJDIjTdM6qf6YHQb3YkRvnkQ0oR4YTl7AyJxZHHBuXpm0y2FLhg+bJWDJ6kxU4Diqpyh G/y1fnyI14KJYXpPhh3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q9Dcj-009S8O-2o; Tue, 13 Jun 2023 23:40:29 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q9Dc4-009RXN-1T for linux-arm-kernel@lists.infradead.org; Tue, 13 Jun 2023 23:40:01 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F1FDF61520; Tue, 13 Jun 2023 23:39:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1F48C433CC; Tue, 13 Jun 2023 23:39:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686699587; bh=AMr6Ad/aGcpnOx8XIK3BvlyamRbYLVRlaFZmuhNVlOQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jSY5N7QnRY8jLkiXn0fbSTrPHy1hrDFr+1hV4CVVXidkrnRCSEojOgQDZiXKByVbZ ic3biLuwlRxbgA6WZbauFvyeVPv9ZmVdZjz+kl5ENAEUWuTpav+yEnemnqc4mn/8/2 9v9UaAKyT4I4oyTFquwz6hVWm5KI/aEe74olRUPSB4Q+aDr/x1p84xqtQQ3mdPKjHW WEDGXOI7uQ62ybGXKn/AerQF5+MA1iuH4O+bWnd3ftgKgoO+2ksOiz4RYNQUGS6Duy dkjz73t7ANX8ez6pykjTGgxKhFmWV5USRJzFkvcq/e+m+FPfl7Jh6gY9EyJw1sovYm afhKtlhbo9yWA== Date: Wed, 14 Jun 2023 01:39:44 +0200 From: Andi Shyti To: carlos.song@nxp.com Cc: aisheng.dong@nxp.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, xiaoning.wang@nxp.com, haibo.chen@nxp.com, linux-imx@nxp.com, linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] i2c: imx-lpi2c: add debug message when i2c peripheral clk doesn't work Message-ID: <20230613233944.673syh3cjykvygfl@intel.intel> References: <20230529072316.3605989-1-carlos.song@nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230529072316.3605989-1-carlos.song@nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230613_163948_538981_8647B692 X-CRM114-Status: GOOD ( 17.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On Mon, May 29, 2023 at 03:23:16PM +0800, carlos.song@nxp.com wrote: > From: Gao Pan > > Add debug message when i2c peripheral clk rate is 0, then > directly return -EINVAL. > > Fixes: a55fa9d0e42e ("i2c: imx-lpi2c: add low power i2c bus driver") > Signed-off-by: Gao Pan > Signed-off-by: Carlos Song > --- > drivers/i2c/busses/i2c-imx-lpi2c.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c > index 11240bf8e8e2..62111fe9f207 100644 > --- a/drivers/i2c/busses/i2c-imx-lpi2c.c > +++ b/drivers/i2c/busses/i2c-imx-lpi2c.c > @@ -209,6 +209,11 @@ static int lpi2c_imx_config(struct lpi2c_imx_struct *lpi2c_imx) > lpi2c_imx_set_mode(lpi2c_imx); > > clk_rate = clk_get_rate(lpi2c_imx->clks[0].clk); > + if (!clk_rate) { > + dev_dbg(&lpi2c_imx->adapter.dev, "clk_per rate is 0\n"); > + return -EINVAL; > + } should this rather be a dev_err? And, BTW, did you actually hit this? Andi > + > if (lpi2c_imx->mode == HS || lpi2c_imx->mode == ULTRA_FAST) > filt = 0; > else > -- > 2.34.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel