LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   How do I reload a kernel driver on an embedded device (i.MX53)? (https://www.linuxquestions.org/questions/linux-kernel-70/how-do-i-reload-a-kernel-driver-on-an-embedded-device-i-mx53-4175428746/)

Qw_freak 09-24-2012 03:43 AM

How do I reload a kernel driver on an embedded device (i.MX53)?
 
Being new and all with linux, I have a spi driver, which needs to be reloaded every time the system goes into suspend mode and wakes up again, to get my screen to work on my embedded device.

So my question may have two parts:

Can i reload a kernel driver?? (Not a module)

if not, how could i, fx in the spi driver, make sure a setup sequence is run every time the system wakes up??

Thank in advance..
-QW

SIG_SEGV 09-24-2012 07:03 AM

You cannot reload a kernel driver unless it has called a 'clean_up module' (releasing all the resources its using) and follows a remove module (rmmod) process. So, I think of an idea.....
1.First compile the inbuilt Kernel Driver itself as a LOADABLE KERNEL MODULE (LKM).
2. Create a daemon so, it polls for system suspend event.
3. At system suspend time call 'clean_up module' and then disconnect driver from kernel.
4. Back at system wake up, Reload the driver and Vice-versa....

Hope this helps at the worst case...............:)

Qw_freak 09-25-2012 01:50 AM

Quote:

You cannot reload a kernel driver unless it has called a 'clean_up module' (releasing all the resources its using) and follows a remove module (rmmod) process. So, I think of an idea.....
1.First compile the inbuilt Kernel Driver itself as a LOADABLE KERNEL MODULE (LKM).
2. Create a daemon so, it polls for system suspend event.
3. At system suspend time call 'clean_up module' and then disconnect driver from kernel.
4. Back at system wake up, Reload the driver and Vice-versa....

Hope this helps at the worst case...............
Well, that complicates it a great deal, unfortunately..

Thanks a lot for the quick answer, I will try to look into making a daemon for the job.. :)


All times are GMT -5. The time now is 12:27 AM.