lkml.org 
[lkml]   [2022]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/1] iio: imx8qxp-adc: fix irq flood when call imx8qxp_adc_read_raw()
Date

> 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.

Yes, you are right. I will send updated patch soon.

>
> >
> > + 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;
> > }
> >

\
 
 \ /
  Last update: 2022-11-29 20:50    [W:0.282 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site