lkml.org 
[lkml]   [2020]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] iio: trigger: sysfs: Disable irqs before calling iio_trigger_poll()
Date
Hi Lars

On Monday, 3 August 2020, 08:52:54 CEST, Lars-Peter Clausen wrote:
> On 8/3/20 8:44 AM, Christian Eggers wrote:
> > ...
> > is my patch sufficient, or would you prefer a different solution?
>
> The code in normal upstream is correct, there is no need to patch it
> since iio_sysfs_trigger_work() always runs with IRQs disabled.
>
> >> Are you using a non-upstream kernel? Maybe a RT kernel?
> >
> > I use v5.4.<almost-latest>-rt
>
> That explains it. Have a look at
> 0200-irqwork-push-most-work-into-softirq-context.patch.
>
> The right fix for this issue is to add the following snippet to the RT
> patchset.
>
> diff --git a/drivers/iio/trigger/iio-trig-sysfs.c
> b/drivers/iio/trigger/iio-trig-sysfs.c
> --- a/drivers/iio/trigger/iio-trig-sysfs.c
> +++ b/drivers/iio/trigger/iio-trig-sysfs.c
> @@ -161,6 +161,7 @@ static int iio_sysfs_trigger_probe(int id)
> iio_trigger_set_drvdata(t->trig, t);
>
> init_irq_work(&t->work, iio_sysfs_trigger_work);
> + t->work.flags = IRQ_WORK_HARD_IRQ;
>
> ret = iio_trigger_register(t->trig);
> if (ret)

I can confirm that this works for iio-trig-sysfs on 5.4.54-rt32. Currently I
do not use iio-trig-hrtimer, but if I remember correctly, the problem was also
present there.

Do you want to apply your patch for mainline? In contrast to v5.4,
IRQ_WORK_HARD_IRQ is already available there (moved to smp_types.h).
Unfortunately I cannot test it on mainline for now, as my BSP stuff is not
ported yet.

Best regards
Christian




\
 
 \ /
  Last update: 2020-08-12 13:03    [W:0.068 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site