lkml.org 
[lkml]   [2023]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v4] i2c: imx-lpi2c: return -EINVAL when i2c peripheral clk doesn't work
Date
> From: Andi Shyti <andi.shyti@kernel.org>
> Sent: 2023年7月26日 7:41
> Hi Carlos,
>
> > --- a/drivers/i2c/busses/i2c-imx-lpi2c.c
> > +++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
> > @@ -209,6 +209,9 @@ 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)
> > + return -EINVAL;
> > +
>
> this is a very unlikely to happen and generally not really appreciated.
>
> If you got so far it's basically impossible that clk_rate is '0'.
> Uwe asked you in v2 if you actually had such case.
>
> I don't have a strong opinion, thoug... I would drop this patch unless Dong is
> OK with it and I can accept it with his ack.

On MX8X platforms, the default clock rate is 0 if without explicit clock setting in
dts nodes. So I wonder it may be worth adding a check here.
If you're also ok, feel free to add my tag.
Acked-by: Dong Aisheng <Aisheng.dong@nxp.com>

BTW, please see another reply from Carlos with the test log.

Regards
Aisheng

>
> Andi
>
> > if (lpi2c_imx->mode == HS || lpi2c_imx->mode == ULTRA_FAST)
> > filt = 0;
> > else
> > --
> > 2.34.1
> >
\
 
 \ /
  Last update: 2023-07-26 10:09    [W:0.038 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site