udelay vs usleep_range
Nicholas Mc Guire
der.herr at hofr.at
Sun Sep 11 12:48:49 EDT 2016
>
> But looking into the code on line 634 where I found the udelay(33), I
> have the impression that this is a false positive, something your
> checkpatch didn't catch properly. That call is inside a function named
> nvec_interrupt(), and the line:
>
> err = devm_request_irq(&pdev->dev, nvec->irq, nvec_interrupt,
> 0, "nvec", nvec);
>
> declares it as the interrupt handler. The interrupt handler can't
> sleep(interrupt handler runs in the atomic context in terminology of
> timers-howto.txt), and using udelay() seems to be the thing to do
> here.
>
devm_request_irq
-> devm_request_threaded_irq
-> request_threaded_irq
so this should be ok here.
thx!
hofrat
More information about the Kernelnewbies
mailing list