Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-10-30 12:15:55 +0100
committerTakashi Iwai <tiwai@suse.de>2018-10-30 12:16:08 +0100
commit2f04cfed57fe99e31f0a00ae661560db1466a67b (patch)
tree452d6e2bb9a7cee2d874455655c27078aca12d58
parent0535cdc9ba43fa711b64162f644e8d4aebe7736a (diff)
iio: adc: at91: fix acking DRDY irq on simple conversions
(bsc#1051510).
-rw-r--r--patches.drivers/iio-adc-at91-fix-acking-DRDY-irq-on-simple-conversio.patch43
-rw-r--r--series.conf1
2 files changed, 44 insertions, 0 deletions
diff --git a/patches.drivers/iio-adc-at91-fix-acking-DRDY-irq-on-simple-conversio.patch b/patches.drivers/iio-adc-at91-fix-acking-DRDY-irq-on-simple-conversio.patch
new file mode 100644
index 0000000000..fff8d10340
--- /dev/null
+++ b/patches.drivers/iio-adc-at91-fix-acking-DRDY-irq-on-simple-conversio.patch
@@ -0,0 +1,43 @@
+From bc1b45326223e7e890053cf6266357adfa61942d Mon Sep 17 00:00:00 2001
+From: Eugen Hristev <eugen.hristev@microchip.com>
+Date: Mon, 24 Sep 2018 10:51:43 +0300
+Subject: [PATCH] iio: adc: at91: fix acking DRDY irq on simple conversions
+Git-commit: bc1b45326223e7e890053cf6266357adfa61942d
+Patch-mainline: v4.20-rc1
+References: bsc#1051510
+
+When doing simple conversions, the driver did not acknowledge the DRDY irq.
+If this irq status 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 status has occurred because no channel is pending, and then it will go
+int a irq loop and board will hang.
+To avoid this situation, read the LCDR after a raw conversion is done.
+
+Fixes: 0e589d5fb ("ARM: AT91: IIO: Add AT91 ADC driver.")
+Cc: Maxime Ripard <maxime.ripard@bootlin.com>
+Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
+Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/iio/adc/at91_adc.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
+index 44b516863c9d..e3be88e7192c 100644
+--- a/drivers/iio/adc/at91_adc.c
++++ b/drivers/iio/adc/at91_adc.c
+@@ -279,6 +279,8 @@ static void handle_adc_eoc_trigger(int irq, struct iio_dev *idev)
+ iio_trigger_poll(idev->trig);
+ } else {
+ st->last_value = at91_adc_readl(st, AT91_ADC_CHAN(st, st->chnb));
++ /* Needed to ACK the DRDY interruption */
++ at91_adc_readl(st, AT91_ADC_LCDR);
+ st->done = true;
+ wake_up_interruptible(&st->wq_data_avail);
+ }
+--
+2.19.1
+
diff --git a/series.conf b/series.conf
index d456ceed26..f7e3e0ddd9 100644
--- a/series.conf
+++ b/series.conf
@@ -18294,6 +18294,7 @@
patches.drivers/drm-i915-Restore-vblank-interrupts-earlier.patch
patches.drivers/drm-i915-dp-Link-train-Fallback-on-eDP-only-if-fallb.patch
patches.drivers/iio-adc-imx25-gcq-Fix-leak-of-device_node-in-mx25_gc.patch
+ patches.drivers/iio-adc-at91-fix-acking-DRDY-irq-on-simple-conversio.patch
patches.drivers/media-uvcvideo-Fix-uvc_alloc_entity-allocation-align.patch
patches.drivers/media-dvb-fix-compat-ioctl-translation.patch
patches.drivers/media-tvp5150-avoid-going-past-array-on-v4l2_queryme.patch