linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Firmware works only if kernel source drivers are built as modules.
@ 2015-09-14 14:56 rhubarbpieguy
  2015-09-14 15:28 ` Larry Finger
  0 siblings, 1 reply; 3+ messages in thread
From: rhubarbpieguy @ 2015-09-14 14:56 UTC (permalink / raw)
  To: linux-wireless


I'm attempting to load iwlwifi-3160 firmware.  It works only if I build 
the following drivers as modules.

     Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate

      Intel Wireless WiFi MVM Firmware Support

If I compile them into the kernel the firmware is not found.  This is my 
first experience with firmware.  Does firmware require drivers built as 
modules?  I see nothing at 
https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi stating 
modules must be used.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Firmware works only if kernel source drivers are built as modules.
  2015-09-14 14:56 Firmware works only if kernel source drivers are built as modules rhubarbpieguy
@ 2015-09-14 15:28 ` Larry Finger
  2015-09-14 19:49   ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Larry Finger @ 2015-09-14 15:28 UTC (permalink / raw)
  To: rhubarbpieguy, linux-wireless

On 09/14/2015 09:56 AM, rhubarbpieguy@gmail.com wrote:
>
> I'm attempting to load iwlwifi-3160 firmware.  It works only if I build the
> following drivers as modules.
>
>      Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate
>
>       Intel Wireless WiFi MVM Firmware Support
>
> If I compile them into the kernel the firmware is not found.  This is my first
> experience with firmware.  Does firmware require drivers built as modules?  I
> see nothing at https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi stating
> modules must be used.

No, having firmware does not require the driver to be a module; however, user 
space may cause a problem.

To load firmware, the user-space portions needed to read a file must be running. 
If the driver is a module *not in the initrd image*, then one is assured that a 
file can be loaded as those routines were used to get the driver file. For the 
case where the driver is built-in, it is possible for a synchronous 
request_firmware() call to timeout before user space is ready to deliver the 
file. The safe way is to request an asynchronous load of at least the first 
firmware file using request_firmware_nowait(). When the load completes, the 
callback routine will set a completion event with all other operations held 
until that event is set.

Note that iwlwifi is correctly coded. It does load a second firmware file 
synchronously, but only after the first one is available.

The built-in driver will also fail unless the dependent drivers are also built 
in, but the kernel build process should take care of that.

The bottom line is that I do not know why your system is failing. It should 
work. (TM) :)

Larry



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Firmware works only if kernel source drivers are built as modules.
  2015-09-14 15:28 ` Larry Finger
@ 2015-09-14 19:49   ` Johannes Berg
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2015-09-14 19:49 UTC (permalink / raw)
  To: Larry Finger, rhubarbpieguy, linux-wireless

On Mon, 2015-09-14 at 10:28 -0500, Larry Finger wrote:
> On 09/14/2015 09:56 AM, rhubarbpieguy@gmail.com wrote:
> > 
> > I'm attempting to load iwlwifi-3160 firmware.  It works only if I build the
> > following drivers as modules.
> > 
> >      Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate
> > 
> >       Intel Wireless WiFi MVM Firmware Support
> > 
> > If I compile them into the kernel the firmware is not found.  This is my first
> > experience with firmware.  Does firmware require drivers built as modules?  I
> > see nothing at https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi stating
> > modules must be used.
> 
> No, having firmware does not require the driver to be a module; however, user 
> space may cause a problem.
> 
> To load firmware, the user-space portions needed to read a file must be running. 
> If the driver is a module *not in the initrd image*, then one is assured that a 
> file can be loaded as those routines were used to get the driver file. For the 
> case where the driver is built-in, it is possible for a synchronous 
> request_firmware() call to timeout before user space is ready to deliver the 
> file. The safe way is to request an asynchronous load of at least the first 
> firmware file using request_firmware_nowait(). When the load completes, the 
> callback routine will set a completion event with all other operations held 
> until that event is set.
> 
> Note that iwlwifi is correctly coded. It does load a second firmware file 
> synchronously, but only after the first one is available.
> 
> The built-in driver will also fail unless the dependent drivers are also built 
> in, but the kernel build process should take care of that.
> 
> The bottom line is that I do not know why your system is failing. It should 
> work. (TM) :)
> 

I have very little to add to this - except note that as far as I know,
initramfs (or similar) userspace was never actually changed to take the
async into account to defer loading. My original idea with this had
been that whatever application was loading firmware would see an async
request and if the file isn't available, it would check if it's running
in initramfs, and in that case would simply not respond to the firmware
load at all but check again after the root filesystem was mounted. This
was, for all I know, never implemented.

Now with the in-kernel loading, that's no longer a possibility. You'll
probably see a number of messages during boot indicating that firmware
isn't available.

There are essentially two ways out of this:
 1) build the firmware file into initramfs - Debian for example makes 
    this very easy
 2) if you built the kernel yourself, you can also build firmware
    files into the kernel image

johannes

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-14 19:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-14 14:56 Firmware works only if kernel source drivers are built as modules rhubarbpieguy
2015-09-14 15:28 ` Larry Finger
2015-09-14 19:49   ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).