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] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <IA1PR12MB60927419E6B5D17332EBFAC08C11A@IA1PR12MB6092.namprd12.prod.outlook.com>
Date: Fri, 19 Sep 2025 09:22:32 +0000
From: "Guntupalli, Manikanta" <manikanta.guntupalli@....com>
To: Mario TESI <mario.tesi@...com>, Jorge Marques <gastmaier@...il.com>
CC: David Lechner <dlechner@...libre.com>, Andy Shevchenko
	<andriy.shevchenko@...el.com>, "git (AMD-Xilinx)" <git@....com>, "Simek,
 Michal" <michal.simek@....com>, "lorenzo@...nel.org" <lorenzo@...nel.org>,
	"jic23@...nel.org" <jic23@...nel.org>, "nuno.sa@...log.com"
	<nuno.sa@...log.com>, "andy@...nel.org" <andy@...nel.org>,
	"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Pandey,
 Radhey Shyam" <radhey.shyam.pandey@....com>, "Goud, Srinivas"
	<srinivas.goud@....com>, "manion05gk@...il.com" <manion05gk@...il.com>
Subject: RE: [PATCH] iio: imu: lsm6dsx: Add shutdown callback support for I3C
 interface

[Public]

Hi @Mario TESI,
Thanks for the response.

We don't have the flexibility to provide traces or register dumps. However, the issue is straightforward to reproduce with a kexec reboot.

On the first boot, everything works fine: the sensor responds to the full enumeration sequence, including RSTDAA to reset the dynamic address and ENTDAA for assigning a new dynamic address. At this point, the sensor driver probe is called successfully.

On the subsequent boot via kexec reboot, the sensor driver probe is not called because the sensor does not respond to the enumeration process (RSTDAA and ENTDAA).

When we add a software reset in the shutdown handler of the sensor driver, the sensor once again responds correctly to RSTDAA and ENTDAA, and the driver probe is called as expected during kexec reboot.

Note: We don't observe this behavior with other I3C devices, which helps isolate the issue to this specific sensor.

I hope this provides better clarity.

Thanks,
Manikanta.

> -----Original Message-----
> From: Mario TESI <mario.tesi@...com>
> Sent: Thursday, September 18, 2025 12:53 PM
> To: Guntupalli, Manikanta <manikanta.guntupalli@....com>; Jorge Marques
> <gastmaier@...il.com>
> Cc: David Lechner <dlechner@...libre.com>; Andy Shevchenko
> <andriy.shevchenko@...el.com>; git (AMD-Xilinx) <git@....com>; Simek, Michal
> <michal.simek@....com>; lorenzo@...nel.org; jic23@...nel.org;
> nuno.sa@...log.com; andy@...nel.org; linux-iio@...r.kernel.org; linux-
> kernel@...r.kernel.org; Pandey, Radhey Shyam
> <radhey.shyam.pandey@....com>; Goud, Srinivas <srinivas.goud@....com>;
> manion05gk@...il.com
> Subject: Re: [PATCH] iio: imu: lsm6dsx: Add shutdown callback support for I3C
> interface
>
> Hi Manikanta,
>
> The mainline lsm6dsx driver supports several IMUs, but on the I3C bus, it supports
> two: lam6dso and lam6dsr.
> This is very strange because the software reset doesn't reset the dynamic address
> on such devices; only an RSTDAA or a power cycle can reset it. Looking at how the
> I3C master works, the first thing it requests during the probe phase is an RSTDAA,
> which is sufficient to reset the I3C address. Therefore, the IMU sensors should then
> participate in the new assignment with the ENTDAA or SETDASA command (in case
> of assigned address). The software reset you perform during shutdown likely
> deactivates the sensor, which solves any issues that may exist with the various I3C
> drivers (many of which are under development or debugging). It would be interesting
> to evaluate the I3C trace when the issue occurs and also a register dump to better
> understand where to focus.
>
> Best Regards,
> Mario
>
> ________________________________________
> Da: Guntupalli, Manikanta <manikanta.guntupalli@....com>
> Inviato: venerdì 5 settembre 2025 07:29:18
> A: Jorge Marques; Mario TESI
> Cc: David Lechner; Andy Shevchenko; git (AMD-Xilinx); Simek, Michal;
> lorenzo@...nel.org; jic23@...nel.org; nuno.sa@...log.com; andy@...nel.org;
> linux-iio@...r.kernel.org; linux-kernel@...r.kernel.org; Pandey, Radhey Shyam;
> Goud, Srinivas; manion05gk@...il.com
> Oggetto: RE: [PATCH] iio: imu: lsm6dsx: Add shutdown callback support for I3C
> interface
>
> [Public]
>
> + @mario.tesi@...com
>
> Hi @mario.tesi,
> We are observing an enumeration issue with the LSM6DSX sensor on I3C, since
> enumeration occurs only there. During a kexec reboot, the LSM6DSX does not
> respond to CCC commands during enumeration.
> Adding a software reset in shutdown() resolves this and allows enumeration to
> succeed.
>
> Could you please confirm this behavior of the LSM6DSX on I3C from your side ?
> Your confirmation will help us decide whether to proceed with just the software reset
> in the driver or consider additional steps.
>
> > -----Original Message-----
> > From: Guntupalli, Manikanta <manikanta.guntupalli@....com>
> > Sent: Wednesday, July 30, 2025 11:58 AM
> > To: Jorge Marques <gastmaier@...il.com>
> > Cc: David Lechner <dlechner@...libre.com>; Andy Shevchenko
> > <andriy.shevchenko@...el.com>; git (AMD-Xilinx) <git@....com>; Simek,
> > Michal <michal.simek@....com>; lorenzo@...nel.org; jic23@...nel.org;
> > nuno.sa@...log.com; andy@...nel.org; linux-iio@...r.kernel.org; linux-
> > kernel@...r.kernel.org; Pandey, Radhey Shyam
> > <radhey.shyam.pandey@....com>; Goud, Srinivas <srinivas.goud@....com>;
> > manion05gk@...il.com
> > Subject: RE: [PATCH] iio: imu: lsm6dsx: Add shutdown callback support
> > for I3C interface
> >
> >
> > Hi,
> >
> > > -----Original Message-----
> > > From: Jorge Marques <gastmaier@...il.com>
> > > Sent: Tuesday, July 29, 2025 6:19 PM
> > > To: Guntupalli, Manikanta <manikanta.guntupalli@....com>
> > > Cc: David Lechner <dlechner@...libre.com>; Andy Shevchenko
> > > <andriy.shevchenko@...el.com>; git (AMD-Xilinx) <git@....com>;
> > > Simek, Michal <michal.simek@....com>; lorenzo@...nel.org;
> > > jic23@...nel.org; nuno.sa@...log.com; andy@...nel.org;
> > > linux-iio@...r.kernel.org; linux- kernel@...r.kernel.org; Pandey,
> > > Radhey Shyam <radhey.shyam.pandey@....com>; Goud, Srinivas
> > > <srinivas.goud@....com>; manion05gk@...il.com
> > > Subject: Re: [PATCH] iio: imu: lsm6dsx: Add shutdown callback
> > > support for I3C interface
> > >
> > > On Tue, Jul 29, 2025 at 12:02:56PM +0000, Guntupalli, Manikanta wrote:
> > > > [AMD Official Use Only - AMD Internal Distribution Only]
> > > >
> > > > Hi @Jorge Marques,
> > > >
> > > > > -----Original Message-----
> > > > > From: Jorge Marques <gastmaier@...il.com>
> > > > > Sent: Tuesday, July 22, 2025 1:27 PM
> > > > > To: Guntupalli, Manikanta <manikanta.guntupalli@....com>
> > > > > Cc: David Lechner <dlechner@...libre.com>; Andy Shevchenko
> > > > > <andriy.shevchenko@...el.com>; git (AMD-Xilinx) <git@....com>;
> > > > > Simek, Michal <michal.simek@....com>; lorenzo@...nel.org;
> > > > > jic23@...nel.org; nuno.sa@...log.com; andy@...nel.org;
> > > > > linux-iio@...r.kernel.org; linux- kernel@...r.kernel.org;
> > > > > Pandey, Radhey Shyam <radhey.shyam.pandey@....com>; Goud,
> > > > > Srinivas <srinivas.goud@....com>; manion05gk@...il.com
> > > > > Subject: Re: [PATCH] iio: imu: lsm6dsx: Add shutdown callback
> > > > > support for I3C interface
> > > > >
> > > > > On Tue, Jul 22, 2025 at 07:32:54AM +0000, Guntupalli, Manikanta wrote:
> > > > > > [AMD Official Use Only - AMD Internal Distribution Only]
> > > > > >
> > > > > > Hi @David Lechner,
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: David Lechner <dlechner@...libre.com>
> > > > > > > Sent: Tuesday, July 22, 2025 2:31 AM
> > > > > > > To: Andy Shevchenko <andriy.shevchenko@...el.com>;
> > > > > > > Guntupalli, Manikanta <manikanta.guntupalli@....com>
> > > > > > > Cc: git (AMD-Xilinx) <git@....com>; Simek, Michal
> > > > > > > <michal.simek@....com>; lorenzo@...nel.org;
> > > > > > > jic23@...nel.org; nuno.sa@...log.com; andy@...nel.org;
> > > > > > > linux-iio@...r.kernel.org; linux-kernel@...r.kernel.org;
> > > > > > > Pandey, Radhey Shyam <radhey.shyam.pandey@....com>; Goud,
> > > > > > > Srinivas <srinivas.goud@....com>; manion05gk@...il.com
> > > > > > > Subject: Re: [PATCH] iio: imu: lsm6dsx: Add shutdown
> > > > > > > callback support for I3C interface
> > > > > > >
> > > > > > > On 7/21/25 6:38 AM, Andy Shevchenko wrote:
> > > > > > > > On Mon, Jul 21, 2025 at 04:37:41PM +0530, Manikanta
> > > > > > > > Guntupalli
> > wrote:
> > > > > > > >> Add a shutdown handler for the ST LSM6DSx I3C driver to
> > > > > > > >> perform a hardware reset during system shutdown. This
> > > > > > > >> ensures the sensor is placed in a well-defined reset
> > > > > > > >> state, preventing issues during subsequent reboots, such
> > > > > > > >> as kexec, where the device may fail to respond correctly during
> enumeration.
> > > > > > > >
> > > > > > > > Do you imply that tons of device drivers missing this? I
> > > > > > > > don't think we have even 5% of the drivers implementing the feature.
> > > > > > > >
> > > > > > > In the IIO drivers I've worked on, we always do reset in the
> > > > > > > probe() function. The
> > > > > > > shutdown() function might not run, e.g. if the board loses
> > > > > > > power, so it doesn't fix 100% of the cases.
> > > > > >
> > > > > > Thank you for the input.
> > > > > >
> > > > > > You're absolutely right - shutdown() may not cover all cases
> > > > > > like power
> > loss.
> > > > > However, in scenarios such as a warm reboot (kexec), the situation is
> different.
> > > > > >
> > > > > > Before the probe is called in the next boot, device
> > > > > > enumeration takes place. During
> > > > > this process, the I3C framework compares the device's PID, BCR,
> > > > > and DCR values against the ones registered in the driver:
> > > > > >
> > > > > > static const struct i3c_device_id st_lsm6dsx_i3c_ids[] = {
> > > > > >         I3C_DEVICE(0x0104, 0x006C, (void *)ST_LSM6DSO_ID),
> > > > > >         I3C_DEVICE(0x0104, 0x006B, (void *)ST_LSM6DSR_ID),
> > > > > >         { }
> > > > > > };
> > > > > >
> > > > > > Only if this matching succeeds, the probe will be invoked.
> > > > > >
> > > > > > Since the sensor reset logic is placed inside the probe, the
> > > > > > device must be in a
> > > > > responsive state during enumeration. In the case of kexec, we
> > > > > observed that the sensor does not respond correctly unless it is
> > > > > explicitly reset
> > > during shutdown().
> > > > > Hence, adding the reset in shutdown() addresses this specific
> > > > > case where the probe isn't reached due to failed enumeration.
> > > > > >
> > > > > Hi Manikanta,
> > > > >
> > > > > During i3c bus init, the CCC RSTDAA is emitted to reset all DAs
> > > > > of all devices in the bus
> > > > > (drivers/i3c/master.c@..._master_bus_init
> > > > > -> i3c_master_rstdaa_locked). Is the LSM6DSX not compliant with that?
> > > > LSM6DSX is compliant with RSTDAA CCC.
> > > >
> > > > >
> > > > > I get your solution but find odd to use the same method as in the probe.
> > > > > In the probe, you would, in general, reset the device logic, but
> > > > > leave the i3c peripheral logic intact, because you don't want to
> > > > > undo whatever the controller has set-up for the current bus
> > > > > attached devices (ibi config, da, max devices speed, all the good i3c stuff).
> > > > > For this device, the st_lsm6dsx_reset_device seems to flush a
> > > > > FIFO, do a software reset, and reload a trimming parameter;
> > > > > which are necessary to solve the bug you are observed?
> > > > Only software reset necessary to solve the bug.
> > > >
> > > > >
> > > > > If possible, please explain better why the device won't
> > > > > enumerate correctly after a reboot without the reset. If it is a
> > > > > device bug, explicitly state that and that it is not compliant.
> > > > > Also, take a look at fig.100 of the
> > > i3c spec basic 1.1.1.
> > > > >
> > > > > Thank you for looking into this, this type of corner case is usually overlooked.
> > > > It appears that the sensor device is entering a deep sleep or
> > > > low-power state and
> > > is not responding to CCC commands. However, after a software reset,
> > > the sensor starts responding to CCCs as expected.
> > > It should, from the silicon pov, definitely respond to CCCs, even on
> > > low-power
> > states.
> > > Could you confirm with stm32 the behaviour you are observing?
> > > Inform them if it occurs under under i2c/i3c dual support, only i3c, or both.
> > > It sounds a little the messages are being filtered by the spike
> > > filter when it
> > shouldn't?
> > > >
> > > > Shall we proceed with only the software reset changes along with
> > > > an improved
> > > description, or do you recommend any additional modifications?
> > > Confirm if this is a silicon issue first, if so, a note from st should be issued also.
> > We are unable to verify the behavior on any silicon other than ours.
> > It would be helpful if someone with access to a different silicon could confirm this
> behavior.
> >
>
> Thanks,
> Manikanta.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ