* question about driver built-in kernel
@ 2005-11-18 0:18 yiding_wang
2005-11-19 1:20 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: yiding_wang @ 2005-11-18 0:18 UTC (permalink / raw)
To: linux-kernel
We have two driver modules to support our hardware for some applications. Both modules worked fine as loadable modules. Now I need to build both drivers in kernel 2.6.11-8. I have changed configuration file and make file. Both drivers are built OK with kernel together. Now I have two concerns:
1, Because both drivers were loaded as module before, the entry point for both driver is "init_module()". Since both drivers are built in kernel, the entry name is conflicting. Changing one entry point name will make driver built OK. However, I am concerned that loading kernel will not pick up the driver with changed entry point name. What is the best way to handle this situation?
2, One of built-in driver requires to be loaded before the second one. Because these two drivers are not belong to any existing group, such as network, scsi, where is the best place these two driver can be specified for loading sequence? I checked init.d and rc* files but did not figure out proper place to handle the requirement.
Many Thanks!
Eddie
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: question about driver built-in kernel
2005-11-18 0:18 question about driver built-in kernel yiding_wang
@ 2005-11-19 1:20 ` Greg KH
0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2005-11-19 1:20 UTC (permalink / raw)
To: yiding_wang; +Cc: linux-kernel
On Thu, Nov 17, 2005 at 05:18:34PM -0700, yiding_wang@agilent.com wrote:
> We have two driver modules to support our hardware for some
> applications. Both modules worked fine as loadable modules. Now I need
> to build both drivers in kernel 2.6.11-8. I have changed configuration
> file and make file. Both drivers are built OK with kernel together.
Have a pointer to the source for these drivers?
> 1, Because both drivers were loaded as module before, the entry point
> for both driver is "init_module()". Since both drivers are built in
> kernel, the entry name is conflicting. Changing one entry point name
> will make driver built OK. However, I am concerned that loading kernel
> will not pick up the driver with changed entry point name. What is the
> best way to handle this situation?
Make your init module function static, like all other kernel drivers.
> 2, One of built-in driver requires to be loaded before the second one.
> Because these two drivers are not belong to any existing group, such
> as network, scsi, where is the best place these two driver can be
> specified for loading sequence? I checked init.d and rc* files but did
> not figure out proper place to handle the requirement.
The linker specifies the loading order.
hope this helps,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: question about driver built-in kernel
@ 2005-11-19 1:57 yiding_wang
2005-11-19 5:37 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: yiding_wang @ 2005-11-19 1:57 UTC (permalink / raw)
To: greg, yiding_wang; +Cc: linux-kernel
Thanks Greg!
Got everything straighten up.
1, replaced init_module() by __init init_module to avoid kernel build conflict.
2, arranged correct sequence in Makefile to load two drivers in proper order.
Now it looks the pci bus register accessing has problem. If loaded as module, everything works fine. If build in kernel, it always failed at the spot driver resetting the chip through register during the kernel loading. It seems the pci base address mapping or something related has problem. Is there any difference for ioremap call between the kernel loading and after system is up? Is anything special on pci device register accessing during the kernel booting, compare with after system boot up?
Thanks!
Eddie
-----Original Message-----
From: Greg KH [mailto:greg@kroah.com]
Sent: Friday, November 18, 2005 5:20 PM
To: yiding_wang@agilent.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: question about driver built-in kernel
On Thu, Nov 17, 2005 at 05:18:34PM -0700, yiding_wang@agilent.com wrote:
> We have two driver modules to support our hardware for some
> applications. Both modules worked fine as loadable modules. Now I need
> to build both drivers in kernel 2.6.11-8. I have changed configuration
> file and make file. Both drivers are built OK with kernel together.
Have a pointer to the source for these drivers?
> 1, Because both drivers were loaded as module before, the entry point
> for both driver is "init_module()". Since both drivers are built in
> kernel, the entry name is conflicting. Changing one entry point name
> will make driver built OK. However, I am concerned that loading kernel
> will not pick up the driver with changed entry point name. What is the
> best way to handle this situation?
Make your init module function static, like all other kernel drivers.
> 2, One of built-in driver requires to be loaded before the second one.
> Because these two drivers are not belong to any existing group, such
> as network, scsi, where is the best place these two driver can be
> specified for loading sequence? I checked init.d and rc* files but did
> not figure out proper place to handle the requirement.
The linker specifies the loading order.
hope this helps,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: question about driver built-in kernel
2005-11-19 1:57 yiding_wang
@ 2005-11-19 5:37 ` Greg KH
0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2005-11-19 5:37 UTC (permalink / raw)
To: yiding_wang; +Cc: linux-kernel
On Fri, Nov 18, 2005 at 06:57:38PM -0700, yiding_wang@agilent.com wrote:
> Thanks Greg!
>
> Got everything straighten up.
>
> 1, replaced init_module() by __init init_module to avoid kernel build conflict.
> 2, arranged correct sequence in Makefile to load two drivers in proper order.
>
> Now it looks the pci bus register accessing has problem. If loaded as
> module, everything works fine. If build in kernel, it always failed at
> the spot driver resetting the chip through register during the kernel
> loading. It seems the pci base address mapping or something related
> has problem. Is there any difference for ioremap call between the
> kernel loading and after system is up? Is anything special on pci
> device register accessing during the kernel booting, compare with
> after system boot up?
Do you have a pointer to your source code, so we can look at it to see
what is wrong?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: question about driver built-in kernel
@ 2005-11-21 19:06 yiding_wang
2005-11-21 20:27 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: yiding_wang @ 2005-11-21 19:06 UTC (permalink / raw)
To: greg, yiding_wang; +Cc: linux-kernel
Hello Greg,
Thanks for the support and prompt response. I figure it out the problem is endianess. I worked everything on x86 based system and copied files to PPC system. Somehow I forgot to change the endianess define in my makefile. Now everything works fine!
Again, relay appreciate your help!
Eddie
-----Original Message-----
From: Greg KH [mailto:greg@kroah.com]
Sent: Friday, November 18, 2005 9:37 PM
To: yiding_wang@agilent.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: question about driver built-in kernel
On Fri, Nov 18, 2005 at 06:57:38PM -0700, yiding_wang@agilent.com wrote:
> Thanks Greg!
>
> Got everything straighten up.
>
> 1, replaced init_module() by __init init_module to avoid kernel build conflict.
> 2, arranged correct sequence in Makefile to load two drivers in proper order.
>
> Now it looks the pci bus register accessing has problem. If loaded as
> module, everything works fine. If build in kernel, it always failed at
> the spot driver resetting the chip through register during the kernel
> loading. It seems the pci base address mapping or something related
> has problem. Is there any difference for ioremap call between the
> kernel loading and after system is up? Is anything special on pci
> device register accessing during the kernel booting, compare with
> after system boot up?
Do you have a pointer to your source code, so we can look at it to see
what is wrong?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: question about driver built-in kernel
2005-11-21 19:06 yiding_wang
@ 2005-11-21 20:27 ` Greg KH
0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2005-11-21 20:27 UTC (permalink / raw)
To: yiding_wang; +Cc: linux-kernel
On Mon, Nov 21, 2005 at 12:06:52PM -0700, yiding_wang@agilent.com wrote:
> Hello Greg,
>
> Thanks for the support and prompt response. I figure it out the
> problem is endianess. I worked everything on x86 based system and
> copied files to PPC system. Somehow I forgot to change the endianess
> define in my makefile. Now everything works fine!
You should not need a endian define in your makefile, just use the
kernel build system and it will all work properly.
By your reluctance to show the source code, am I correct in assuming
that it is not released under the GPL?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-11-21 21:35 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-18 0:18 question about driver built-in kernel yiding_wang
2005-11-19 1:20 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2005-11-19 1:57 yiding_wang
2005-11-19 5:37 ` Greg KH
2005-11-21 19:06 yiding_wang
2005-11-21 20:27 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox