I am using a 4.14-rt kernel compiled with PREEMPT_RT_FULL, on SAMA5D44 processor.
I am using interrupts from GPIO. Additionally, I wrote my own module for counters (TC).
In counters module I am registering interrupts as follows:
Code: Select all
TCB[id].Irq = platform_get_irq (pdev, 0); if (TCB [id] .Irq <0) return -EINVAL; result = request_irq (TCB [id] .Irq, tcbIrq, // The pointer to the handler function below IRQF_TIMER, // without threading, good performace but sometimes hang // IRQF_NO_SUSPEND | IRQF_NOBALANCING, // threaded, weak performance, but do not hang "tcb_irq", // Used in / proc / interrupts to identify the owner & TCB[id]);
Sometimes when handling an interrupt from gpio (a separate thread is created for this) we need to handle the interrupt from TCB.
When I additionally need to call sysfs_notify_dirent() the system exits with the exception of the udefined instruction.
Important part of callstack is shown in the screenshot below. Elsewhere, I confirmed that this happens when handling irq from gpiolib (not shown in the screenshot).
Is there any other way to pass information to sysfs to prevent the system from crashing? Maybe the kernel should be compiled a bit differently?
Any idea would be appreciated.