lkml.org 
[lkml]   [2015]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: Problems loading firmware using built-in drivers with kernels that use initramfs.
From
On Tue, Aug 25, 2015 at 12:58 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> Either build firmware in the kernel or ramdisk (so it is always
> available), or make sure request_firmware() calls are not in driver's
> probe() paths.

The correct answer is almost always that second one.

Drivers that load firmware in their probe parts are generally doign
things wrong.

It's very occasionally the right thing to do - there are a few pieces
of hardware where just about _everything_ about the device is in the
firmware, and you simply can't even problem them before that, because
you don't know what they *are* before the firmware has been loaded.
The extreme case of that might be something like the base hardware
being an FPGA that has a USB interface, but before the FPGA has been
loaded, it basically has no identity. So there are probably valid
cases in theory for loading firmware at probe time, but pretty much
every single case I've ever actually seen, the probe knows what the
actual hardware is from some identifiable piece, and the actual
firmware loading should be delayed until the piece of hardware is
actually opened.

So the "load firmware in probe routine" happens, and we shouldn't
disallow it, but it should be considered a "last resort" kind of
thing.

In general, things like sound drivers should *not* need to have their
firmware in the initrd, even if you build them into the kernel. A disk
driver? Yes. Maybe the root filesystem is on that disk, and you need
the firmware for the disk driver to load it. But a sound device?
Please just make sure that you load the firmware as late as possible.

Linus


\
 
 \ /
  Last update: 2015-08-25 22:41    [W:0.141 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site