* [gentoo-user] Firmware exists but fails to load
@ 2011-08-15 9:13 Adam Carter
2011-08-15 9:38 ` J. Roeleveld
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Adam Carter @ 2011-08-15 9:13 UTC (permalink / raw
To: gentoo-user
# dmesg | grep firm
[ 70.453673] r8169 0000:02:00.0: eth0: unable to load firmware patch
rtl_nic/rtl8168d-2.fw (-2)
# ls -l /lib/firmware/rtl_nic/rtl8168d-2.fw
-rw-r--r-- 1 root root 1324 Aug 12 13:09 /lib/firmware/rtl_nic/rtl8168d-2.fw
Any ideas why this fails? Filesystem is mounted, file is readable...
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] Firmware exists but fails to load
2011-08-15 9:13 [gentoo-user] Firmware exists but fails to load Adam Carter
@ 2011-08-15 9:38 ` J. Roeleveld
2011-08-15 9:45 ` Adam Carter
2011-08-15 10:23 ` [gentoo-user] " Nikos Chantziaras
2011-08-15 15:56 ` Paul Hartman
2 siblings, 1 reply; 12+ messages in thread
From: J. Roeleveld @ 2011-08-15 9:38 UTC (permalink / raw
To: gentoo-user
On Mon, August 15, 2011 11:13 am, Adam Carter wrote:
> # dmesg | grep firm
> [ 70.453673] r8169 0000:02:00.0: eth0: unable to load firmware patch
> rtl_nic/rtl8168d-2.fw (-2)
> # ls -l /lib/firmware/rtl_nic/rtl8168d-2.fw
> -rw-r--r-- 1 root root 1324 Aug 12 13:09
> /lib/firmware/rtl_nic/rtl8168d-2.fw
>
> Any ideas why this fails? Filesystem is mounted, file is readable...
Is the filesystem mounted when it tries to find the firmware?
In other words, are you perhaps using a ramdisk?
If you have this drives as a module, can you try removing it (rmmod
<driver> and then reloading it (modprobe <driver>)?
If it isn't a module, can you rebuild your kernel to have the relevant
driver as a module?
--
Joost
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] Firmware exists but fails to load
2011-08-15 9:38 ` J. Roeleveld
@ 2011-08-15 9:45 ` Adam Carter
0 siblings, 0 replies; 12+ messages in thread
From: Adam Carter @ 2011-08-15 9:45 UTC (permalink / raw
To: gentoo-user
> Is the filesystem mounted when it tries to find the firmware?
I thought it was, but having another look at dmesg, it looks like
that's not the case.
proxy linux # dmesg | grep eth0
[ 0.897559] r8169 0000:02:00.0: eth0: RTL8168d/8111d at
0xffffc90000360000, 1c:6f:65:20:3f:c6, XID 083000c0 IRQ 41
[ 70.453673] r8169 0000:02:00.0: eth0: unable to load firmware patch
rtl_nic/rtl8168d-2.fw (-2)
[ 70.461027] r8169 0000:02:00.0: eth0: link down
[ 70.461050] r8169 0000:02:00.0: eth0: link down
[ 70.461444] ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 72.851287] r8169 0000:02:00.0: eth0: link up
[ 72.851846] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
proxy linux # dmesg | grep btrfs
[ 1.647953] btrfs: use lzo compression
[ 2.129807] VFS: Mounted root (btrfs filesystem) on device 0:13.
> In other words, are you perhaps using a ramdisk?
>
> If you have this drives as a module, can you try removing it (rmmod
> <driver> and then reloading it (modprobe <driver>)?
>
> If it isn't a module, can you rebuild your kernel to have the relevant
> driver as a module?
Its not a module - i'll make it one and see how that goes.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [gentoo-user] Re: Firmware exists but fails to load
2011-08-15 9:13 [gentoo-user] Firmware exists but fails to load Adam Carter
2011-08-15 9:38 ` J. Roeleveld
@ 2011-08-15 10:23 ` Nikos Chantziaras
2011-08-15 11:59 ` Adam Carter
2011-08-15 15:56 ` Paul Hartman
2 siblings, 1 reply; 12+ messages in thread
From: Nikos Chantziaras @ 2011-08-15 10:23 UTC (permalink / raw
To: gentoo-user
On 08/15/2011 12:13 PM, Adam Carter wrote:
> # dmesg | grep firm
> [ 70.453673] r8169 0000:02:00.0: eth0: unable to load firmware patch
> rtl_nic/rtl8168d-2.fw (-2)
> # ls -l /lib/firmware/rtl_nic/rtl8168d-2.fw
> -rw-r--r-- 1 root root 1324 Aug 12 13:09 /lib/firmware/rtl_nic/rtl8168d-2.fw
>
> Any ideas why this fails? Filesystem is mounted, file is readable...
Is the firmware path set correctly in the kernel config? In "Device
Drivers->Generic Driver Options", set "Firmware blobs root directory" to
"/lib/firmware" and build a new kernel.
If that was already set, try to include the firmware in the kernel by
setting "External firmware blobs to build into the kernel binary" to
"rtl_nic/rtl8168d-2.fw" (the firmware root directory above still needs
to be "/lib/firmware").
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] Re: Firmware exists but fails to load
2011-08-15 10:23 ` [gentoo-user] " Nikos Chantziaras
@ 2011-08-15 11:59 ` Adam Carter
2011-08-15 12:53 ` Nikos Chantziaras
0 siblings, 1 reply; 12+ messages in thread
From: Adam Carter @ 2011-08-15 11:59 UTC (permalink / raw
To: gentoo-user
> Is the firmware path set correctly in the kernel config? In "Device
> Drivers->Generic Driver Options", set "Firmware blobs root directory" to
> "/lib/firmware" and build a new kernel.
I have the same kernel config as my laptop which loads intel wifi
firmware from /llib/firmware ok;
# zgrep -i firmware /proc/config.gz
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE=""
# CONFIG_FIRMWARE_EDID is not set
# Firmware Drivers
CONFIG_FIRMWARE_MEMMAP=y
# CONFIG_GOOGLE_FIRMWARE is not set
Firmware blobs root directory is EXTRA_FIRMWARE_DIR which is only
available once i enable EXTRA_FIRMWARE, but the help for that says;
"This option allows firmware to be built into the kernel, for the
│
│ cases where the user either cannot or doesn't want to provide it
from
│
│ userspace at runtime"
So that's a workaround, not a fix, but it works so it'll do. Thanks.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [gentoo-user] Re: Firmware exists but fails to load
2011-08-15 11:59 ` Adam Carter
@ 2011-08-15 12:53 ` Nikos Chantziaras
2011-08-15 14:07 ` Andrea Conti
0 siblings, 1 reply; 12+ messages in thread
From: Nikos Chantziaras @ 2011-08-15 12:53 UTC (permalink / raw
To: gentoo-user
On 08/15/2011 02:59 PM, Adam Carter wrote:
>> Is the firmware path set correctly in the kernel config? In "Device
>> Drivers->Generic Driver Options", set "Firmware blobs root directory" to
>> "/lib/firmware" and build a new kernel.
>
> [...]
>
> Firmware blobs root directory is EXTRA_FIRMWARE_DIR which is only
> available once i enable EXTRA_FIRMWARE, but the help for that says;
> "This option allows firmware to be built into the kernel, for the
>
> │
> │ cases where the user either cannot or doesn't want to provide it
> from
> │
> │ userspace at runtime"
>
> So that's a workaround, not a fix, but it works so it'll do. Thanks.
It's not a workaround, but how it's supposed to work. "Loading from
userspace" means using a user-space program to load the firmware. This
is not what you're trying to do, since you don't have such a program.
You're trying to have the kernel itself load the firmware, and the
EXTRA_FIRMWARE mechanism is how this is done.
Your other option is writing a userspace program that reads the firmware
after the kernel has booted and patches it into the hardware. But why
would you want to do something like that anyway?
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] Re: Firmware exists but fails to load
2011-08-15 12:53 ` Nikos Chantziaras
@ 2011-08-15 14:07 ` Andrea Conti
2011-08-16 1:53 ` Adam Carter
0 siblings, 1 reply; 12+ messages in thread
From: Andrea Conti @ 2011-08-15 14:07 UTC (permalink / raw
To: gentoo-user
> It's not a workaround, but how it's supposed to work. "Loading from
> userspace" means using a user-space program to load the firmware. This
> is not what you're trying to do, since you don't have such a program.
? Udev has been the standard way to service kernel firmware requests for
quite some time. The relevant bit is in
/lib/udev/rules.d/50-firmware.rules .
However, udevd is only started after the kernel is loaded, and therefore
will only load firmware for drivers which are built as modules.
Firmware for built-in drivers must either be compiled into the kernel or
be provided in an initrd along with a suitable helper.
Is there a specific reason why the r8169 driver cannot be loaded as a
module? AFAIK the only case in which you *need* a built-in net driver is
if you're doing root over NFS.
> Your other option is writing a userspace program that reads the firmware
> after the kernel has booted and patches it into the hardware.
Patching is always done by the kernel driver. The userspace helper only
has to answer kernel requests for a specific firmware by providing the
correct data.
> But why would you want to do something like that anyway?
Typical reasons are to keep the kernel image size down and to avoid
having to recompile the kernel whenever a new firmware version is
released. Though I'll admit that kernel releases tend to be more
frequent than new firmware versions :)
Just my .02€
andrea
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] Firmware exists but fails to load
2011-08-15 9:13 [gentoo-user] Firmware exists but fails to load Adam Carter
2011-08-15 9:38 ` J. Roeleveld
2011-08-15 10:23 ` [gentoo-user] " Nikos Chantziaras
@ 2011-08-15 15:56 ` Paul Hartman
2 siblings, 0 replies; 12+ messages in thread
From: Paul Hartman @ 2011-08-15 15:56 UTC (permalink / raw
To: gentoo-user
On Mon, Aug 15, 2011 at 4:13 AM, Adam Carter <adamcarter3@gmail.com> wrote:
> # dmesg | grep firm
> [ 70.453673] r8169 0000:02:00.0: eth0: unable to load firmware patch
> rtl_nic/rtl8168d-2.fw (-2)
> # ls -l /lib/firmware/rtl_nic/rtl8168d-2.fw
> -rw-r--r-- 1 root root 1324 Aug 12 13:09 /lib/firmware/rtl_nic/rtl8168d-2.fw
>
> Any ideas why this fails? Filesystem is mounted, file is readable...
1) build the driver as a module (firmware loading from disk does not
work otherwise)
2) emerge linux-firmware, if you haven't already.
3) reboot and good luck :)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] Re: Firmware exists but fails to load
2011-08-15 14:07 ` Andrea Conti
@ 2011-08-16 1:53 ` Adam Carter
2011-08-16 5:07 ` victor romanchuk
0 siblings, 1 reply; 12+ messages in thread
From: Adam Carter @ 2011-08-16 1:53 UTC (permalink / raw
To: gentoo-user
> ? Udev has been the standard way to service kernel firmware requests for
> quite some time. The relevant bit is in
> /lib/udev/rules.d/50-firmware.rules .
Ok so that must be working on my laptop (automatically, i didn't
configure anything) but failing on my desktop.
> However, udevd is only started after the kernel is loaded, and therefore
> will only load firmware for drivers which are built as modules.
I tried compiling as a module, and it still failed. I'll go back and
verify I haven't made a mistake, then check firmware.rules.
Thanks again.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] Re: Firmware exists but fails to load
2011-08-16 1:53 ` Adam Carter
@ 2011-08-16 5:07 ` victor romanchuk
2011-08-16 8:54 ` [gentoo-user] " Andrea Conti
0 siblings, 1 reply; 12+ messages in thread
From: victor romanchuk @ 2011-08-16 5:07 UTC (permalink / raw
To: gentoo-user
>> ? Udev has been the standard way to service kernel firmware requests for
>> quite some time. The relevant bit is in
>> /lib/udev/rules.d/50-firmware.rules .
> Ok so that must be working on my laptop (automatically, i didn't
> configure anything) but failing on my desktop.
>
>> However, udevd is only started after the kernel is loaded, and therefore
>> will only load firmware for drivers which are built as modules.
> I tried compiling as a module, and it still failed. I'll go back and
> verify I haven't made a mistake, then check firmware.rules.
>
it does not actually matter how you configured the driver -- built-in kernel or
as module: everytime when driver operates the device, it checks whether firmware
is loaded. if it does not or the firmware is not preloaded at kernel build time
as a blob, the driver requests for firmware. the request is a generated kernel
event which is handled in userspace by udev. the udev daemon processes event
using mentioned above rule. the rule is trivial -- it starts a firmware loader
utility (/lib/udev/firmware) with parameters passed within the event: device
name and firmware file path. appropriate status is returned back to kernel and
dispatched to the driver
in your case the status is -2 (ENOENT) so it could be problem with either
firmware blob file or firmware loader itself. functionality of
/lib/udev/firmware is controlled by USE=extras. did you installed udev with
"extras" support?
again, firmware load is udev responsibility. you may diagnose all the stuff
enabling udev debug output in /etc/udev/udev.conf
finally i confirm that r8169 driver works fine on my notebook with 2.6.39 kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] Firmware exists but fails to load
2011-08-16 5:07 ` victor romanchuk
@ 2011-08-16 8:54 ` Andrea Conti
2011-08-16 21:13 ` victor romanchuk
0 siblings, 1 reply; 12+ messages in thread
From: Andrea Conti @ 2011-08-16 8:54 UTC (permalink / raw
To: gentoo-user
> it does not actually matter how you configured the driver -- built-in kernel or
> as module: everytime when driver operates the device, it checks whether firmware
> is loaded.
Are you sure about that? AFAIK firmware loading is only attempted once,
when the driver is first initialized.
> functionality of /lib/udev/firmware is controlled by USE=extras.
That might have been the case at some point but now sys-fs/udev-164-r2
and sys-fs/udev-171-r1 both install the firmware-related stuff (rules
and helper) even with USE=-extras
andrea
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] Firmware exists but fails to load
2011-08-16 8:54 ` [gentoo-user] " Andrea Conti
@ 2011-08-16 21:13 ` victor romanchuk
0 siblings, 0 replies; 12+ messages in thread
From: victor romanchuk @ 2011-08-16 21:13 UTC (permalink / raw
To: gentoo-user
>> it does not actually matter how you configured the driver -- built-in kernel or
>> as module: everytime when driver operates the device, it checks whether firmware
>> is loaded.
> Are you sure about that? AFAIK firmware loading is only attempted once,
> when the driver is first initialized.
i'm not sure - just spent few minutes looking through the drivers/net/r8169.c
code: the driver attempts to load firmware every time when opening a particular
pci eth device
>> functionality of /lib/udev/firmware is controlled by USE=extras.
> That might have been the case at some point but now sys-fs/udev-164-r2
> and sys-fs/udev-171-r1 both install the firmware-related stuff (rules
> and helper) even with USE=-extras
you are right (also reviewed contents of udev tarbal and appropriate ebuild
code) - `extras' use flag just adds some runtime dependencies
> andrea
>
thank you,
victor
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2011-08-16 21:14 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-15 9:13 [gentoo-user] Firmware exists but fails to load Adam Carter
2011-08-15 9:38 ` J. Roeleveld
2011-08-15 9:45 ` Adam Carter
2011-08-15 10:23 ` [gentoo-user] " Nikos Chantziaras
2011-08-15 11:59 ` Adam Carter
2011-08-15 12:53 ` Nikos Chantziaras
2011-08-15 14:07 ` Andrea Conti
2011-08-16 1:53 ` Adam Carter
2011-08-16 5:07 ` victor romanchuk
2011-08-16 8:54 ` [gentoo-user] " Andrea Conti
2011-08-16 21:13 ` victor romanchuk
2011-08-15 15:56 ` Paul Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox