Linux kernel shutdown can cause driver to leave an I2C bus jammed

323 Views Asked by At

I'm using ST's own driver for the LSM6DS[ML] IMU.

If that driver is in the middle of accessing an IMU register at kernel shutdown, the I2C bus can be left jammed, with SCL pulled low: pulseview screenshot of jammed i2c bus

This means that the final I2C write (to a PMU chip, hooking into pm_power_off) cannot always happen. Therefore the power sometimes gets left on.

I'm trying to understand where I should fix this.

  • Is ST's lsm6dsm driver faulty in some way?
  • Is the kernel's I2C handling faulty? (I can't think of a reason for it to ever leave the I2C bus jammed.)
  • Is it valid for an I2C bus to be left jammed at shutdown and therefore invalid to call regmap_write() from pm_power_off?
0

There are 0 best solutions below