lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DB9PR04MB8477BE7C43982637DC2F0DA68000A@DB9PR04MB8477.eurprd04.prod.outlook.com>
Date:   Wed, 26 Jul 2023 07:59:14 +0000
From:   Aisheng Dong <aisheng.dong@....com>
To:     Andi Shyti <andi.shyti@...nel.org>,
        Carlos Song <carlos.song@....com>
CC:     "u.kleine-koenig@...gutronix.de" <u.kleine-koenig@...gutronix.de>,
        "shawnguo@...nel.org" <shawnguo@...nel.org>,
        "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
        "kernel@...gutronix.de" <kernel@...gutronix.de>,
        "festevam@...il.com" <festevam@...il.com>,
        Clark Wang <xiaoning.wang@....com>,
        Bough Chen <haibo.chen@....com>,
        dl-linux-imx <linux-imx@....com>,
        "linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v4] i2c: imx-lpi2c: return -EINVAL when i2c peripheral clk
 doesn't work

> From: Andi Shyti <andi.shyti@...nel.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@....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
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ