android_kernel_xiaomi_sm8350/drivers/iio/pressure
Alexander Zangerl 2bf6c93e17 iio: pressure: ms5611: ms5611_prom_is_valid false negative bug
commit fd39d9668f2ce9f4b05ad55e8c8d80c098073e0b upstream.

The ms5611 driver falsely rejects lots of MS5607-02BA03-50 chips
with "PROM integrity check failed" because it doesn't accept a prom crc
value of zero as legitimate.

According to the datasheet for this chip (and the manufacturer's
application note about the PROM CRC), none of the possible values for the
CRC are excluded - but the current code in ms5611_prom_is_valid() ends with

return crc_orig != 0x0000 && crc == crc_orig

Discussed with the driver author (Tomasz Duszynski) and he indicated that
at that time (2015) he was dealing with some faulty chip samples which
returned blank data under some circumstances and/or followed example code
which indicated CRC zero being bad.

As far as I can tell this exception should not be applied anymore; We've
got a few hundred custom boards here with this chip where large numbers
of the prom have a legitimate CRC value 0, and do work fine, but which the
current driver code wrongly rejects.

Signed-off-by: Alexander Zangerl <az@breathe-safe.com>
Fixes: c0644160a8 ("iio: pressure: add support for MS5611 pressure and temperature sensor")
Link: https://lore.kernel.org/r/2535-1695168070.831792@Ze3y.dhYT.s3fx
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-25 11:53:19 +02:00
..
abp060mg.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
bmp280-core.c
bmp280-i2c.c
bmp280-regmap.c
bmp280-spi.c
bmp280.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cros_ec_baro.c
dps310.c iio: pressure: dps310: Adjust Timeout Settings 2023-10-25 11:53:19 +02:00
hid-sensor-press.c
hp03.c
hp206c.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
Kconfig Second set of IIO device support, features, cleanups and minor fixes for 5.3. 2019-07-01 10:58:13 +02:00
Makefile
mpl115_i2c.c
mpl115_spi.c
mpl115.c
mpl115.h
mpl3115.c
ms5611_core.c iio: pressure: ms5611: ms5611_prom_is_valid false negative bug 2023-10-25 11:53:19 +02:00
ms5611_i2c.c
ms5611_spi.c iio: ms5611: Simplify IO callback parameters 2022-12-08 11:23:00 +01:00
ms5611.h
ms5637.c
st_pressure_buffer.c iio:st_sensors: remove buffer allocation at each buffer enable 2019-08-11 09:26:04 +01:00
st_pressure_core.c
st_pressure_i2c.c
st_pressure_spi.c
st_pressure.h iio:pressure: introduce st_press_get_settings() function 2019-07-27 22:52:05 +01:00
t5403.c
zpa2326_i2c.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
zpa2326_spi.c
zpa2326.c
zpa2326.h Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00