iio: light: cm3232: fix remove ordering, locking and calibscale validation
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | iio: light: cm3232: unregister the device before powering it downdrivers/ | +2 | 0 replies | |
| 2/3 | iio: light: cm3232: serialize access to the cached command registerdrivers/ | +16 | 0 replies | |
| 3/3 | iio: light: cm3232: reject invalid calibscale valuesdrivers/ | +2 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] iio: light: cm3232: fix remove ordering, locking and calibscale validation
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
Signature · 1 line
2.43.0