OSDN Git Service

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:01 +0000 (09:34 +0200)
commit07921e3cb1eaa632a4182ec53f90b7bcc3ac11d3
treece986b76acbb3f6124d9ac99cbeeb1693aeb26a1
parentc69e21be54b4cc2d30125e97335998760c7beaf9
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