missing a module dependency after boot, rmmod+modprobe fixes it

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

 




Im evidently missing something wrt module dependency.

When I reboot my test box, pc87360 is missing a dependency on
(a new, exploratory module) siolock.

soekris:~# lsmod
Module                  Size  Used by
siolock                 4612  0
uhci_hcd               29168  0
ohci_hcd               18820  0
usbcore               101008  2 uhci_hcd,ohci_hcd
sc1200                  6784  0 [permanent]
scx200_gpio             3876  0
scx200                  4528  1 scx200_gpio
pc87360                22192  0
hwmon_vid               2496  1 pc87360
i2c_isa                 5536  1 pc87360
i2c_core               21456  2 pc87360,i2c_isa
soekris:~#

The wierd thing is that the
If I rmmod pc87360, then modprobe it, the dependency appears, as expected.

soekris:~# lsmod
Module                  Size  Used by
pc87360                22836  0
siolock                 4612  1 pc87360
uhci_hcd               29168  0
ohci_hcd               18820  0
usbcore               101008  2 uhci_hcd,ohci_hcd
sc1200                  6784  0 [permanent]
scx200_gpio             3876  0
scx200                  4528  1 scx200_gpio
hwmon_vid               2496  1 pc87360
i2c_isa                 5536  1 pc87360
i2c_core               21456  2 pc87360,i2c_isa
soekris:~#

this is on kernel.org 2.6.15 + my siolock hackery, patch attached.
Also, since its attached, feel free to comment on it.
(perhaps with different subject, same thread)

The intent is to provide locking of sio-ports without creating
dependencies between otherwize unrelated drivers.

My use-case is drivers/hwmon/pc87360 vs drivers/char/pc87360_gpio
(Ive written it, but it needs much work).  The modules are unrelated,
except for a lock on the sio-port, and they would seem to belong
in different subsystems (drivers/hwmon vs drivers/char)
The pc87360 has 15 functional units,

cost:
more complexity (nominal?)
size with debug, (which can be vastly trimmed,)
  text    data     bss     dec     hex filename
  1532      26       4    1562     61a siolock.o
  2195     348       4    2547     9f3 siolock.ko

benefit:
- pc87360_gpio has no dependency on pc87360
 13869    2780      20   16669    411d pc87360.ko
- same could apply for other drivers
- possible to avoid some outb() cycles (may be negligible)
   may also be out-weighed by extra checking.
- maybe can shrink pc87360 a bit
   its currently mostly unmodified, sio_locks are taken during _init,
   but module does its own locking when reading sensors.


thanks in advance


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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