Operating System - HP-UX
1828960 Members
2245 Online
109986 Solutions
New Discussion

dynamic driver, unexpected unload()

 

dynamic driver, unexpected unload()

Hi,
I have a DLKM monolithic PCI interface driver, and see that after running 'kmupdate -M xyz', my load() function is called, my attach(), followed by a call to unload().

Next I load the driver 'kmadmin -L', my load() gets called, by not the attach().
'kmadmin -Q xyz' shows all is fine.
However I end up with isc pointer as 0 in my open() routine when I call wsio_get_isc().

That can't be right:

Q: is the load(), attach(), unload() sequence normal from kmupdate?

Q: why is wsio_get_isc() reporting no errors, yet I get a 0 pointer?

Q: how can I get access to my PCI device without isc pointer?
4 REPLIES 4
George Mathew
Occasional Contributor

Re: dynamic driver, unexpected unload()

I too face a similar problem, I wrote a DLKM "MyDiver", for which I added a startup script to load in the boot up. I see that, Driver loads when the startup script calls kmadmin -L MyDriver, but soon after someone called, unload routine of MyDriver and the driver got unloaded. Though it is automatically loaded when a call like open(/dev/MyDriver) comes. But my concern is who is calling unload routine and why?
config problem in dlkm
Steve Steel
Honored Contributor

Re: dynamic driver, unexpected unload()

Hi


From kmupdate man page

Immediate Update of Specified Kernel Modules

kmupdate may be used for immediately updating the loadable image of a
newly created kernel module, without a reboot. If the module_name is
loaded, kmupdate tries to unload it and, if the -i option is specified
and the module cannot be unloaded, kmupdate exits with an error. If
the kernel module was either not loaded or successfully unloaded,
kmupdate checks if it is registered, and if so, unregisters the
module. If the kernel module cannot be unregistered, kmupdate exits
with an error if -i is specified; otherwise the module will be updated
asynchronously. If the unregistration succeeds, kmupdate overlays the
existing loadable image of the module with the newly generated image.
It then registers the module with the latest registry information and
performs module type specific initialization, if required. If the
module was loaded originally, kmupdate reloads the module before
exiting.


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
George Mathew
Occasional Contributor

Re: dynamic driver, unexpected unload()

Steve, It seems you have an answer for Linden's original question.
Do you have any answer for my question? during reboot why does "MyDriver" unloads?

-George
config problem in dlkm

Re: dynamic driver, unexpected unload()

Thanks Steve! I was able to find a work around for the problems (had to get the driver done w/in 1 month from original posting of the questions :}).

Kym