iio: adc: at91: disable adc channel interrupt in timeout case
authorGeorg Ottinger <g.ottinger@abatec.at>
Wed, 30 Jan 2019 13:42:02 +0000 (14:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Apr 2019 07:34:42 +0000 (09:34 +0200)
commitb36557f8fa5ae8dedf43d8b390af38ebdb7b96b2
tree44b9cccc15ba9057f5fae9ed5d7144369b8e075f
parent0d34d43b07c55d3f5b2ca83826393a98ffda78b1
iio: adc: at91: disable adc channel interrupt in timeout case

commit 09c6bdee51183a575bf7546890c8c137a75a2b44 upstream.

Having a brief look at at91_adc_read_raw() it is obvious that in the case
of a timeout the setting of AT91_ADC_CHDR and AT91_ADC_IDR registers is
omitted. If 2 different channels are queried we can end up with a
situation where two interrupts are enabled, but only one interrupt is
cleared in the interrupt handler. Resulting in a interrupt loop and a
system hang.

Signed-off-by: Georg Ottinger <g.ottinger@abatec.at>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/at91_adc.c