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:
 <VI2PR04MB111474DEDC6FDC84DCFB11A06E88BA@VI2PR04MB11147.eurprd04.prod.outlook.com>
Date: Thu, 8 May 2025 02:03:21 +0000
From: Carlos Song <carlos.song@....com>
To: Andi Shyti <andi.shyti@...nel.org>, Francesco Dolcini
	<francesco@...cini.it>
CC: Aisheng Dong <aisheng.dong@....com>, Shawn Guo <shawnguo@...nel.org>,
	Sascha Hauer <s.hauer@...gutronix.de>, Pengutronix Kernel Team
	<kernel@...gutronix.de>, Fabio Estevam <festevam@...il.com>, Emanuele Ghidoli
	<emanuele.ghidoli@...adex.com>, "linux-i2c@...r.kernel.org"
	<linux-i2c@...r.kernel.org>, "imx@...ts.linux.dev" <imx@...ts.linux.dev>,
	"linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, Francesco Dolcini
	<francesco.dolcini@...adex.com>
Subject: Re: [PATCH v1] i2c: lpi2c: implement master_xfer_atomic callback



> -----Original Message-----
> From: Andi Shyti <andi.shyti@...nel.org>
> Sent: Tuesday, May 6, 2025 7:02 AM
> To: Francesco Dolcini <francesco@...cini.it>
> Cc: Aisheng Dong <aisheng.dong@....com>; Shawn Guo
> <shawnguo@...nel.org>; Sascha Hauer <s.hauer@...gutronix.de>;
> Pengutronix Kernel Team <kernel@...gutronix.de>; Fabio Estevam
> <festevam@...il.com>; Emanuele Ghidoli <emanuele.ghidoli@...adex.com>;
> linux-i2c@...r.kernel.org; imx@...ts.linux.dev;
> linux-arm-kernel@...ts.infradead.org; linux-kernel@...r.kernel.org; Francesco
> Dolcini <francesco.dolcini@...adex.com>
> Subject: [EXT] Re: [PATCH v1] i2c: lpi2c: implement master_xfer_atomic callback
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report this
> email' button
> 
> 
> Hi Francesco,
> 
> I'm sorry for the late reply on this.
> 
> Can someone from NXP help with the review? Carlos? Dong?
> 

Hi, 

Yes. I reviewed this. It is ok for me! Thank you. 
Reviewed-by: Carlos Song <carlos.song@....com>

> On Wed, Mar 19, 2025 at 03:51:14PM +0100, Francesco Dolcini wrote:
> > From: Emanuele Ghidoli <emanuele.ghidoli@...adex.com>
> >
> > Rework the read and write code paths in the driver to support
> > operation in atomic contexts. To achieve this, the driver must not
> > rely on IRQs or perform any scheduling, e.g., via a sleep or schedule
> > routine. Even jiffies do not advance in atomic contexts, so timeouts
> > based on them are substituted with delays.
> >
> > Implement atomic, sleep-free, and IRQ-less operation. This increases
> > complexity but is necessary for atomic I2C transfers required by some
> > hardware configurations, e.g., to trigger reboots on an external PMIC chip.
> >
> > Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@...adex.com>
> > Signed-off-by: Francesco Dolcini <francesco.dolcini@...adex.com>
> > ---
> >  drivers/i2c/busses/i2c-imx-lpi2c.c | 258
> > +++++++++++++++++++----------
> >  1 file changed, 173 insertions(+), 85 deletions(-)
> >
> > diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c
> > b/drivers/i2c/busses/i2c-imx-lpi2c.c
> > index 0d4b3935e687..f34b6f07e9a4 100644
> > --- a/drivers/i2c/busses/i2c-imx-lpi2c.c
> > +++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
> > @@ -16,6 +16,7 @@
> >  #include <linux/init.h>
> >  #include <linux/interrupt.h>
> >  #include <linux/io.h>
> > +#include <linux/iopoll.h>
> >  #include <linux/kernel.h>
> >  #include <linux/module.h>
> >  #include <linux/of.h>
> > @@ -187,36 +188,35 @@ struct lpi2c_imx_struct {
> >       struct i2c_client       *target;
> >  };
> >
> > +#define READL_POLL_TIMEOUT(atomic, addr, val, cond, delay_us,
> > +timeout_us) \
> 
> READ_POLL_TIMEOUT is not really a name that belongs to this driver. Could we
> name it something like lpi2c_imx_read_poll_timeout()? I'd prefer lowercase, but
> I won't object to capital letters.
> 
> Additionally, the timeout_us value is always 500000, could we just drop it from
> the parameter list? Same goes for LPI2C_MSR.
> 
> Thanks,
> Andi


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ