2009-11-19 09:38:02     How to change priority in driver initialization

Document created by Aaronwu Employee on Aug 19, 2013
Version 1Show Document
  • View in full screen mode

2009-11-19 09:38:02     How to change priority in driver initialization

V Hemanth Kumar (INDIA)

Message: 82544   

 

Hi,

 

I am facing an issue, I have a Driver A, which depends on Driver B. Driver A makes use of the global variables being filled with data during the initialization of Driver B. But during boot, Driver A initialization starts first and fails, because Driver B is being initialized very late in the boot process.

 

I have also tried using request_module("Driver B") in the init of Driver A, but no success.

 

(Here Driver A is ov9655 driver and Driver B is mcp23s08).

 

What should I do to change the priority of the initialization of these drivers?

 

Thanks, Hemanth

QuoteReplyEditDelete

 

 

2009-11-19 10:01:02     Re: How to change priority in driver initialization

Mike Frysinger (UNITED STATES)

Message: 82545   

 

request_module() only works if things are actually built as a module.  so eitherr build them both as modules, or move the variable initialization into a third piece of code that runs at a higher initcode level, or try reading the documentation:

  docs.blackfin.uclinux.org/doku.php?id=a_simple_module_example#building_the_module_into_the_kernel

QuoteReplyEditDelete

 

 

2009-11-19 23:45:00     Re: How to change priority in driver initialization

V Hemanth Kumar (INDIA)

Message: 82550   

 

Mike, the above link mentioned doesn't exist.

 

Our requirement is to build both the drivers into the kernel. So how to make the code run at higher initcode level?

QuoteReplyEditDelete

 

 

2009-11-19 23:46:10     Re: How to change priority in driver initialization

Mike Frysinger (UNITED STATES)

Message: 82551   

 

that's because i reorganized the module pages.  the search function should be pretty straight forward.

QuoteReplyEditDelete

 

 

2009-11-25 00:51:36     Re: How to change priority in driver initialization

V Hemanth Kumar (INDIA)

Message: 82718   

 

Thanks Mike. The problem is resolved now. After referring your link, instead of using module_init(DriverA) I used the late_initcall(DriverA). With this change the DriverB gets initialized 1st and then DriverA last during the linux boot up.

Attachments

    Outcomes