[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bbacb73a-6904-d196-ab4a-3e388bcab56c@metafoo.de>
Date: Tue, 29 Nov 2022 10:23:04 -0800
From: Lars-Peter Clausen <lars@...afoo.de>
To: Frank Li <Frank.Li@....com>, Cai Huoqing <cai.huoqing@...ux.dev>,
Haibo Chen <haibo.chen@....com>,
Jonathan Cameron <jic23@...nel.org>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>,
"open list:NXP i.MX 8QXP ADC DRIVER" <linux-iio@...r.kernel.org>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@...ts.infradead.org>,
open list <linux-kernel@...r.kernel.org>
Cc: imx@...ts.linux.dev
Subject: Re: [PATCH 1/1] iio: imx8qxp-adc: fix irq flood when call
imx8qxp_adc_read_raw()
On 11/29/22 08:45, Frank Li wrote:
readl(adc->regs + IMX8QXP_ADR_ADC_FCTRL));
> @@ -272,6 +275,10 @@ static irqreturn_t imx8qxp_adc_isr(int irq, void *dev_id)
> if (fifo_count)
> complete(&adc->completion);
Shouldn't the completion be triggered after the reading of the samples?
otherwise you have a race condition on a multi-processor system.
>
> + for (i = 0; i < fifo_count; i++)
> + adc->fifo[i] = FIELD_GET(IMX8QXP_ADC_RESFIFO_VAL_MASK,
> + readl_relaxed(adc->regs + IMX8QXP_ADR_ADC_RESFIFO));
> +
> return IRQ_HANDLED;
> }
>
Powered by blists - more mailing lists