Linux IIO development
 help / color / mirror / Atom feed
* [PATCH 0/3] iio: light: cm3232: fix remove ordering, locking and calibscale validation
@ 2026-12-03 16:52 Vineet Thakran
  2026-12-03 16:52 ` [PATCH 1/3] iio: light: cm3232: unregister the device before powering it down Vineet Thakran
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Vineet Thakran @ 2026-12-03 16:52 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, Kevin Tsai, David Lechner, Nuno Sá,
	Andy Shevchenko, Vineet Thakran

This series fixes three bugs in the cm3232 ambient light sensor driver,
all present since the driver was added:

1. cm3232_remove() shuts the sensor down before unregistering the IIO
   device, so sysfs accesses in between can read a shut-down sensor or
   turn it back on.
2. Nothing serializes the read-modify-write of the cached command
   register (and calibscale) between read_raw(), write_raw(), suspend
   and resume.
3. in_illuminance_calibscale accepts zero, negative and fractional
   values, which give meaningless lux readings.

Patch 2 uses guard() and devm_mutex_init(), so older stable trees will
need a manual backport of it.

The series is compile-tested only (W=1, sparse, checkpatch --strict);
I don't have CM3232 hardware to test on.

Vineet Thakran (3):
  iio: light: cm3232: unregister the device before powering it down
  iio: light: cm3232: serialize access to the cached command register
  iio: light: cm3232: reject invalid calibscale values

 drivers/iio/light/cm3232.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)


base-commit: e5aad2bdbbee783611d32599f89cea3f12f9593d
-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-12-04  6:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 16:52 [PATCH 0/3] iio: light: cm3232: fix remove ordering, locking and calibscale validation Vineet Thakran
2026-12-03 16:52 ` [PATCH 1/3] iio: light: cm3232: unregister the device before powering it down Vineet Thakran
2026-12-04  6:59   ` Joshua Crofts
2026-12-03 16:52 ` [PATCH 2/3] iio: light: cm3232: serialize access to the cached command register Vineet Thakran
2026-12-03 16:52 ` [PATCH 3/3] iio: light: cm3232: reject invalid calibscale values Vineet Thakran
2026-12-04  6:58   ` Joshua Crofts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox