On Thu, Nov 8, 2018 at 9:07 AM Arnd Bergmann <arnd@xxxxxxxx> wrote: > > It looks like you build your own object management here. Maybe > use kobject, or at least kref instead of the refcount_t based > low-level implementation? Excellent point. I'll replace with krefs. > > > I see this is called from the interrupt handler at the moment, which > means you cannot call sleeping functions, but it also means that > the timeout may never happen because the timer tick IRQ cannot > get through. That means you may have to change the irq handler > logic, e.g. to try this a few times but then defer to a bottom half > if it fails for a long time. Touche ! Yes, this is very likely a big problem. What if I converted the interrupt handler into a threaded interrupt handler? That would allow the timer tick to get through, correct? Point taken about cpu_relax(), I will fix.