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:36:35 +0000 (09:36 +0200)
commit98171e1947b6ce06fb7a439c0d8c599e0c090fcd
tree2ce0ec84d8f77de44c75373ed9f1ee51022c8f66
parent36971130bb2f815fddae17cfe02ae5fed9b3ff56
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