linux-stable/drivers/iio
Andreas Klinger f0c8a3dd86 iio: adc: hx711: fix bug in sampling of data
[ Upstream commit 4043ecfb5f ]

Fix bug in sampling function hx711_cycle() when interrupt occures while
PD_SCK is high. If PD_SCK is high for at least 60 us power down mode of
the sensor is entered which in turn leads to a wrong measurement.

Switch off interrupts during a PD_SCK high period and move query of DOUT
to the latest point of time which is at the end of PD_SCK low period.

This bug exists in the driver since it's initial addition. The more
interrupts on the system the higher is the probability that it happens.

Fixes: c3b2fdd0ea ("iio: adc: hx711: Add IIO driver for AVIA HX711")
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-10-17 13:43:49 -07:00
..
accel io: accel: kxcjk1013: restore the range after resume. 2019-04-27 09:35:36 +02:00
adc iio: adc: hx711: fix bug in sampling of data 2019-10-17 13:43:49 -07:00
amplifiers
buffer
chemical iio: chemical: atlas-ph-sensor: correct IIO_TEMP values to millicelsius 2019-02-15 08:09:11 +01:00
common iio: common: ssp_sensors: Initialize calculated_time in ssp_common_process_data 2019-05-31 06:47:29 -07:00
counter iio: 104-quad-8: Fix off-by-one error in register selection 2018-10-03 17:00:53 -07:00
dac iio: dac: mcp4725: add missing powerdown bits in store eeprom 2019-04-27 09:35:36 +02:00
dummy
frequency iio: ad9523: Fix return value for ad952x_store() 2018-09-09 19:55:56 +02:00
gyro iio/gyro/bmg160: Use millidegrees for temperature scale 2019-04-27 09:35:35 +02:00
health
humidity iio/hid-sensors: Fix IIO_CHAN_INFO_RAW returning wrong values for signed numbers 2018-12-17 09:28:49 +01:00
imu
light iio: light: opt3001: fix mutex unlock race 2019-10-17 13:43:40 -07:00
magnetometer iio: hmc5843: fix potential NULL pointer dereferences 2019-05-31 06:47:29 -07:00
multiplexer
orientation iio/hid-sensors: Fix IIO_CHAN_INFO_RAW returning wrong values for signed numbers 2018-12-17 09:28:49 +01:00
potentiometer
potentiostat
pressure iio/hid-sensors: Fix IIO_CHAN_INFO_RAW returning wrong values for signed numbers 2018-12-17 09:28:49 +01:00
proximity
temperature iio/hid-sensors: Fix IIO_CHAN_INFO_RAW returning wrong values for signed numbers 2018-12-17 09:28:49 +01:00
trigger
iio_core.h
iio_core_trigger.h
industrialio-buffer.c iio: Fix scan mask selection 2019-04-27 09:35:36 +02:00
industrialio-configfs.c
industrialio-core.c iio: core: fix a possible circular locking dependency 2019-04-27 09:35:36 +02:00
industrialio-event.c
industrialio-sw-device.c
industrialio-sw-trigger.c
industrialio-trigger.c
industrialio-triggered-event.c
inkern.c
Kconfig
Makefile