Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 246af421 authored by Claudiu Beznea's avatar Claudiu Beznea Committed by Greg Kroah-Hartman
Browse files

iio: adc: at91-sama5d2_adc: lock around oversampling and sample freq



[ Upstream commit 9780a23ed5a0a0a63683e078f576719a98d4fb70 ]

.read_raw()/.write_raw() could be called asynchronously from user space
or other in kernel drivers. Without locking on st->lock these could be
called asynchronously while there is a conversion in progress. Read will
be harmless but changing registers while conversion is in progress may
lead to inconsistent results. Thus, to avoid this lock st->lock.

Fixes: 27e17719 ("iio:adc:at91_adc8xx: introduce new atmel adc driver")
Fixes: 6794e23f ("iio: adc: at91-sama5d2_adc: add support for oversampling resolution")
Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20220803102855.2191070-4-claudiu.beznea@microchip.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 46778752
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment