[PATCH 0/1] grlib/genirq: Issue when enabling/disabling interrupt

Gedare Bloom gedare at rtems.org
Mon Apr 12 18:17:34 UTC 2021


Is this a bug in rtems 5 also?

If so, does it warrant a back-port fix and a ticket?

On Mon, Apr 12, 2021 at 3:16 AM Moyano, Gabriel <gabriel.moyano at dlr.de> wrote:
>
> Hello everyone,
>
> I've found what can be an issue in the function genirq_set_active(): under some conditions it can return a value greater than 1.
>
> This function is used by genirq_enable() and genirq_disable() and both of them returns the value returned by genirq_set_active(). According to the documentation in genirq.h, they should return -1, 0 or 1.
>
> When this issue can happen? If there are 3 entries in the list of IRQ and 2 of them are already enabled, the variable `enabled` would be 2, because of `enabled += isrentry->enabled`.
>
> As a possible solution, the value of `enabled` can changed to 1 if it's greater than 1 (see the patch) or maybe improve the search.
>
> Thanks in advance,
>
> Gabriel Moyano
>
>
>
> Moyano, Gabriel (1):
>   grlib/genirq: Taking into account that it could be more than one ISR
>     enabled/disabled
>
>  bsps/shared/grlib/irq/genirq.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> --
> 2.17.1
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list