Can request_firmware be called from a platform_driver ?

Holmes, Michael A (Mike) Mike.Holmes at lsi.com
Wed Apr 18 16:24:42 EDT 2012


-----Original Message-----
From: Dave Hylands [mailto:dhylands at gmail.com] 
Sent: Wednesday, April 18, 2012 3:15 PM
To: Holmes, Michael A (Mike)
Cc: kernelnewbies at kernelnewbies.org
Subject: Re: Can request_firmware be called from a platform_driver ?

Hi Mike,

On Wed, Apr 18, 2012 at 11:07 AM, Holmes, Michael A (Mike)
<Mike.Holmes at lsi.com> wrote:
> Hi
>
> I have a fully working system to which I want to add the request firmware
> mechanism to an existing platform driver I have working.
>
> I instrumented mdev in busybox 1.5.1 and in firmware_class.c 2.6.35 so that
> I could figure this out.
>
> What I see with firmware_request() is that the kernel makes the firmware
> request and does not find any firmware and mdev sees nothing.
>
> However if I change my code to do request_firmare_nowait(), the entire
> system comes up and about 30seconds in the timeout calls my kernel side
> continue for request_firmare_nowait() and I DO now see my request handled by
> mdev, however it is a REMOVE request not the ADD request.
>
> All this makes me think that platform drivers exist before the hotplug
> mechanism is able to operate, is this true ?

Well, request_firmware is ultimately serviced by a user-space process.

So platform drivers compiled statically into the kernel get
initialized long before user-space starts.

Platform drivers compiled as modules will get the firmware loaded much
more quickly after loading the module.

>>>>>>>>
Thanks Dave,

Currently in make menuconfig I put '*' against it to compile it into the kernel, I made it an 'm' so that it is made as a module. 
For modules made outside the tree I call modprobe to load them, but I never made a module in the tree before, I don't know how to get its init called. 
When it was compiled in, I called the init from my machine init directly in my mach-lcp/arch.c via platform_device_register()


Mike

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com



More information about the Kernelnewbies mailing list