> (not on list, please CC me)
> I am working on the USB drivers trying to get the hub and the host
> controller (uhci/ohci/ohci-hcd) drivers to unload correctly. The problem
> is that the drivers have threads running that are not dying before I start
> deallocating resources.
> currently I am trying the following code (from hub.c):
> =========begin code snip============
> void cleanup_module(void)
> if (khubd_pid >= 0)
> int pid;
> kill_proc(khubd_pid, SIGTERM, 1);
> pid=waitpid(khubd_pid, NULL, __WCHILD);
> if (pid!=khubd_pid)
> printk("waitpid filed,"
> =========end code snip============
> Sometimes it works. Othertimes I get the waitpid filed (ok, so I typed
> 'failed' wrong...) message, promptly followed by a kernel oops.
Hmm, you might do something like
while (sys_kill(pid, SIGTERM) != -1)
It is ugly because it depends on PID not being reused, but it might
work after all.
Wait. In what context process does cleanup_module() code run? It is
probably not safe to do blocking call in idle task or something
PS: Is someone working on audio-for-USB?
-- I'm really firstname.lastname@example.org. Look at http://220.127.116.11/~pavel. Pavel Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to email@example.com Please read the FAQ at http://www.tux.org/lkml/