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)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 9 Mar 2019 16:55:07 +0000 (16:55 +0000)
commit09c6bdee51183a575bf7546890c8c137a75a2b44
treeaeba77f046513e9ccbd1d53adce1dff6b76ceeb3
parent409a51e0a4a5f908763191fae2c29008632eb712
iio: adc: at91: disable adc channel interrupt in timeout case

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>
drivers/iio/adc/at91_adc.c