Skip to content

staging: iio: impedance-analyzer: ad5933: buffer and sysfs fixes

Punnay Sharma linux-iio linux-staging 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4staging: iio: impedance-analyzer: ad5933: fix swapped real and imag datadrivers/staging/iio/impedance-analyzer/ad5933.c+1 -10 replies
2/4staging: iio: impedance-analyzer: ad5933: reject frequency code overflowdrivers/staging/iio/impedance-analyzer/ad5933.c+9 -11 reply
3/4staging: iio: impedance-analyzer: ad5933: fix settling cycles readbackdrivers/staging/iio/impedance-analyzer/ad5933.c+7 -31 reply
4/4staging: iio: impedance-analyzer: ad5933: keep old values on failed writesdrivers/staging/iio/impedance-analyzer/ad5933.c+13 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] staging: iio: impedance-analyzer: ad5933: buffer and sysfs fixes

Four bug fixes for ad5933.

Patch 1 fixes buffer data when only one of the real and imag channels is enabled. The driver reads the wrong register, so you get the other value and no error. This has been broken since 2011, so patch 1 is tagged for stable.

Patches 2 to 4 fix sysfs attributes that don't match the chip. Patch 2 rejects frequencies that overflow the 24-bit frequency registers. That only happens with an external MCLK of 3.2 MHz or less. Patch 3 makes out_altvoltage0_settling_cycles report the count the chip uses. Patch 4 keeps the old value when a write to the chip fails. These change what userspace sees, so they are not tagged for stable.

I don't have AD5933 hardware. I tested in a virtme-ng VM with i2c-stub, KASAN and lockdep. The stub can't run a real sweep or give real ADC data, so the tests cover register values and the sysfs and buffer paths. Each patch shows its test results after the --- line.

Every patch builds with W=1 and no new warnings on x86_64 (gcc and clang) and on i386. sparse, smatch, coccicheck and checkpatch --strict are clean.

I used Opus 5.5 assistant to help find these bugs and write the fixes, and I reviewed every patch before sending.

Punnay Sharma (4):
staging: iio: impedance-analyzer: ad5933: fix swapped real and imag
data
staging: iio: impedance-analyzer: ad5933: reject frequency code
overflow
staging: iio: impedance-analyzer: ad5933: fix settling cycles readback
staging: iio: impedance-analyzer: ad5933: keep old values on failed
writes

 .../staging/iio/impedance-analyzer/ad5933.c   | 35 ++++++++++++++++---
 1 file changed, 30 insertions(+), 5 deletions(-)

base-commit: 39508411b82d4dc29dd245bb471ec9ecc1111c9d

Signature · 1 line
2.56.0