When testing the serial Gigaset driver with kernel release 2.6.22.1
I get a kernel BUG message:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
[ BUG: lock held at task exit time! ]
-------------------------------------
gigasetm101d/5970 is exiting with locks still held!
1 lock held by gigasetm101d/5970:
#0: (&cs->hw.ser->dead_mutex){--..}, at: [<c02d8bc7>] mutex_lock+0x1c/0=
x1f
which is all well and true except the process that has exited is the
grandfather process of a daemon() call, and the daemonized grandchild
process is still running happily, keeping the serial device open and
ensuring the line discipline stays loaded, and therefore legally
holding the dead_mutex:
ts@xenon:~> ps lw 5992
F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMM=
AND
1 0 5992 1 16 0 1432 168 pause S ? 0:00 ./gi=
gaset/driver/daemon/gigasetm101d /dev/ttyS0
The structure of gigasetm101d is basically:
if ((tty_fd =3D open(dev, O_RDWR|O_NOCTTY)) < 0) {
fprintf(stderr, "%s: cannot open %s: %s\n", prog, dev, strerror(e=
rrno));
exit(EXIT_FAILURE);
}
if (ioctl(tty_fd, TIOCSETD, &ldisc) < 0)
{
fprintf(stderr, "%s: cannot set line discipline: %s\n",
prog, strerror(errno));
exit(EXIT_FAILURE);
}
if (daemon (0, 0) !=3D 0)
{
fprintf(stderr, "%s: cannot daemonize: %s\n",
prog, strerror(errno));
exit(EXIT_FAILURE);
}
pause();
exit(EXIT_SUCCESS);
Who is at fault here?
Thanks,
Tilman
--=20
Tilman Schmidt E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Unge=F6ffnet mindestens haltbar bis: (siehe R=FCckseite)| Davide Libenzi | [patch 7/8] fdmap v2 - implement sys_socket2 |
| Greg Kroah-Hartman | [PATCH 018/196] coda: convert struct class_device to struct device |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| David Newall | Re: Slow DOWN, please!!! |
git: | |
| Christoph Lameter | Network latency regressions from 2.6.22 to 2.6.29 |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Arjan van de Ven | Re: [GIT]: Networking |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
