Re: Problem with line discipline in new kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Attachment: pgp3OirXKYRMn.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux