Dmitry Adamushko wrote:
the following question/suggestion :
it could be good to eliminate the use of rthal_critical_enter/exit()
from rthal_irq_request() if it's not
the proposal :
int rthal_irq_request (unsigned irq,
- unsigned long flags;
int err = 0;
if (handler == NULL || irq >= IPIPE_NR_IRQS)
- flags = rthal_critical_enter(NULL);
- if (rthal_irq_handler(&rthal_domain, irq) != NULL)
- err = -EBUSY;
- goto unlock_and_exit;
err = rthal_virtualize_irq(&rthal_domain,
IPIPE_EXCLUSIVE_MASK causes a -EBUZY error to be returned by
handler != NULL and the current ipd->irqs[irq].handler != NULL.
Sounds reasonable. Using the synchronized inter-processor lock is most
often a bad idea except in very specific initialization/shutdown stuff
at Adeos level anyway, and this does introduce deadlock issues at
Xenomai level when inadvertently using it with the nklock held, so let's
get rid of this. In the rthal_irq_request() case, it's even useless indeed.
(IPIPE_EXCLUSIVE_MASK is actually not used at the moment anywere,
though ipipe_catch_event() is mentioned in comments).
The existing flag was aimed to implement self-directed events, but I
eventually this support differently, so we can recycle it safely.
Another variant :
ipipe_virtualize_irq() should always return -EBUZY when handler !=
NULL and the current ipd->irqs[irq].handler != NULL,
not taking into account the IPIPE_EXCLUSIVE_FLAG.
Xenomai-core mailing list