]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
iio: adc: stm32: Fix ADCs iteration in irq handler
authorYannick Brosseau <yannick.brosseau@gmail.com>
Mon, 16 May 2022 20:39:38 +0000 (16:39 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 26 Aug 2022 08:53:58 +0000 (10:53 +0200)
commitec61360bfff8de8d5f855e0fb1fd26e28bc54eee
tree8ce723d9fdf8587324fa261cb25ee24cf03fb44c
parent36298f7fc991c42ac73271eb17dd6e5fc559438b
iio: adc: stm32: Fix ADCs iteration in irq handler

BugLink: https://bugs.launchpad.net/bugs/1986718
commit d2214cca4d3eadc74eac9e30301ec7cad5355f00 upstream.

The irq handler was only checking the mask for the first ADCs in the case of the
F4 and H7 generation, since it was iterating up to the num_irq value. This patch add
the maximum number of ADC in the common register, which map to the number of entries of
eoc_msk and ovr_msk in stm32_adc_common_regs. This allow the handler to check all ADCs in
that module.

Tested on a STM32F429NIH6.

Fixes: 695e2f5c289b ("iio: adc: stm32-adc: fix a regression when using dma and irq")
Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/20220516203939.3498673-2-yannick.brosseau@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/iio/adc/stm32-adc-core.c