Problem with line discipline in new kernels
Valdis.Kletnieks at vt.edu
Valdis.Kletnieks at vt.edu
Fri Aug 21 17:21:07 EDT 2015
On Thu, 13 Aug 2015 13:00:58 -0000, Margarita Glushkin said:
> I have a linux kernel driver for serial device, which uses line discipline
> and char device. Driver works with all old kernels, starting from 3.8 this
> driver still works, but when I unload it and load again to the memory
> (modprobe -r bpsctl_mod, after modprobe bpsctl_mod), it crashes the kernel.
> It can't unregister line discipline, because this line discipline is busy.
Sounds like a reference counting problem. When your line discipline is busy,
somebody should have a reference on the module so it can't be unloaded. I don't
see any such reference taking/freeing in your posted code.
Your crash is almost certainly because you're unloading it out from
under active use, which will probably result in somebody overlaying storage.
Frankly, you're probably lucky the system lives long enough for you to
reload it.....
Oh, and filp_open() is usually the wrong way to solve whatever problem you
were trying to solve by using it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150821/3aab7b73/attachment-0001.bin
More information about the Kernelnewbies
mailing list