Skip to content

Commit 23b7c08

Browse files
committed
iio: adc: at91: fix acking DRDY irq on simple conversions
When doing simple conversions, the driver did not acknowledge the DRDY irq. If this irq is not acked, it will be left pending, and as soon as a trigger is enabled, the irq handler will be called, it doesn't know why this irq has occurred because no channel is pending, and then we will have irq loop and board will hang. Fixes 0e589d5 ("ARM: AT91: IIO: Add AT91 ADC driver.") Cc: Maxime Ripard <maxime.ripard@bootlin.com> Cc: <stable@vger.kernel.org> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
1 parent 7fe7a0f commit 23b7c08

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/iio/adc/at91_adc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,11 @@ static int at91_adc_read_raw(struct iio_dev *idev,
713713
at91_adc_writel(st, AT91_ADC_CHDR,
714714
AT91_ADC_CH(chan->channel));
715715
at91_adc_writel(st, AT91_ADC_IDR, BIT(chan->channel));
716+
/*
717+
* we need to ack the DRDY irq, otherwise it will be
718+
* left pending and irq handler will be confused
719+
*/
720+
at91_adc_readl(st, AT91_ADC_LCDR);
716721

717722
st->last_value = 0;
718723
st->done = false;

0 commit comments

Comments
 (0)