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:
 <DM4PR12MB6109997B928B39D878B12FB68C5CA@DM4PR12MB6109.namprd12.prod.outlook.com>
Date: Tue, 22 Jul 2025 07:19:18 +0000
From: "Guntupalli, Manikanta" <manikanta.guntupalli@....com>
To: Andy Shevchenko <andriy.shevchenko@...el.com>
CC: "git (AMD-Xilinx)" <git@....com>, "Simek, Michal" <michal.simek@....com>,
	"lorenzo@...nel.org" <lorenzo@...nel.org>, "jic23@...nel.org"
	<jic23@...nel.org>, "dlechner@...libre.com" <dlechner@...libre.com>,
	"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

[AMD Official Use Only - AMD Internal Distribution Only]

Hi @Andy Shevchenko,

> -----Original Message-----
> From: Andy Shevchenko <andriy.shevchenko@...el.com>
> Sent: Monday, July 21, 2025 5:10 PM
> To: Guntupalli, Manikanta <manikanta.guntupalli@....com>
> Cc: git (AMD-Xilinx) <git@....com>; Simek, Michal <michal.simek@....com>;
> lorenzo@...nel.org; jic23@...nel.org; dlechner@...libre.com;
> 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 Mon, Jul 21, 2025 at 02:38:42PM +0300, 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.
> >
> > > To support this, the previously static st_lsm6dsx_reset_device()
> > > function is now exported via EXPORT_SYMBOL_NS() under the
> > > IIO_LSM6DSX namespace, allowing it to be invoked from the I3C-specific driver.
> >
> > Why system suspend callback can't do this?
>
> Ah, and why only I3C is important? Doesn't I2C or SPI also broken in this sense?

There is no device enumeration process involved for I2C and SPI, so they are not impacted.

However, for I3C, device enumeration does occur. During this process, the device PID and BCR/DCR values are compared against the entries defined 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 there is a match, the probe function will be called.

Additionally, the sensor reset logic is implemented inside the probe. Therefore, to ensure the sensor responds correctly during device enumeration after a reboot (such as after kexec), it is necessary to reset the sensor during the shutdown phase.

Thanks,
Manikanta.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ