# kernel not loading firmware [solved]

## snwy0

Recently installed gentoo and configured a linux kernel for the first time, everything good soo far but the audio due to the kernel not loading the firmware (i think)

dmesg say:

```
 [    1.465062] snd_hda_intel 0000:00:1f.3: Direct firmware load for ctefx-r3di.bin failed with error -2

[    1.465069] snd_hda_intel 0000:00:1f.3: Direct firmware load for ctefx.bin failed with error -2 
```

(and i got another error exactly like those but with other firmware

tried:

- adding ctefx.bin to CONFIG_EXTRA_FIRMWARE and CONFIG_EXTRA_DIR is pointing to /lib/firmware (yes i emerged linux-firmware)

- support for that driver as a module and built in

i dont use initramfs

kernel version 5.7.6Last edited by snwy0 on Thu Jul 02, 2020 5:30 pm; edited 1 time in total

----------

## theotherjoe

snwy0,

did you check for typos in path and/or filename of firmware?

please post output:

```
localhost ~$ grep FIRM /usr/src/linux/.config

```

and: make certain that you are executing correct kernel image which

contains selected firmware.

----------

## snwy0

path and filename are correct AFAIK: /lib/firmware/ctefx.bin, is that what you mean?

grep FIRM /usr/src/linux/.config:

```
CONFIG_FIRMWARE_MEMMAP=y

# CONFIG_GOOGLE_FIRMWARE is not set

CONFIG_PREVENT_FIRMWARE_BUILD=y

CONFIG_EXTRA_FIRMWARE=""

# CONFIG_CYPRESS_FIRMWARE is not set

CONFIG_DRM_LOAD_EDID_FIRMWARE=y

# CONFIG_FIRMWARE_EDID is not set

# CONFIG_TEST_FIRMWARE is not set
```

(tried with CONFIG_PREVENT_FIRMWARE_BUILD disabled but same)

if you mean having the support for that device in kernel yes i have it enabled

thank you for answering theotherjoe  :Very Happy: 

----------

## theotherjoe

```
localhost ~ $ grep FIRM /usr/src/linux/.config

# CONFIG_FIRMWARE_MEMMAP is not set

# CONFIG_GOOGLE_FIRMWARE is not set

CONFIG_PREVENT_FIRMWARE_BUILD=y

CONFIG_EXTRA_FIRMWARE="amd-ucode/microcode_amd_fam17h.bin"

CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"

# CONFIG_CYPRESS_FIRMWARE is not set

# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set

# CONFIG_FIRMWARE_EDID is not set

```

the cutout above is from a .config for a AMD machine as an example. 

it builds a kernel with AMD microcode firmware included.

do not edit the .config file directly; use make menuconfig instead 

to  change CONFIG_EXTRA_FIRMWARE and

CONFIG_EXTRA_FIRMWARE_DIR for your needs.

----------

## snwy0

as i said, i already tried that, same error  :Sad: 

wait, i didnt touch CONFIG_DRM_LOAD_EDID_FIRMWARE, im trying that

ah no, that option have nothing to do soo yeah already tried and nothing

----------

## snwy0

nothing?

----------

## pietinger

 *snwy0 wrote:*   

> nothing?

 

Before I will try to help I would like to ask,  where did you found "ctefx-r3di.bin" ?

----------

## snwy0

hello pietinger,

I dont have "ctefx-r3di.bin" and its not needed (the guy that told me that i think its the one who created that driver)

He said that it fallback to "ctefx.bin" and recomended me to talk with someone that knows about gentoo cause it seems to be a gentoo thing

Manjaro for example came with it tho but i have no idea.

some update: i tried again with the last kernel (5.7.7) and the default config i just added my hardware and not much else and i get the same error when i built in into the kernel, dont get any error when as a module but the module does not load. ( the guy told me that it should set as a module).

----------

## pietinger

Hi Snwy0,

 *snwy0 wrote:*   

> some update: i tried again with the last kernel (5.7.7) and the default config i just added my hardware and not much else and i get the same error when i built in into the kernel, [...]

 

How did you built it ?

If not in this way, do it so:

Step into your /usr/src/linux and do a "make menuconfig" (nothing else - never edit your .config manual!)

Then set this as builtin  - not as module:

```
> Processor type and features

[*] CPU microcode loading support

> Device Drivers > Generic Driver Options > Firmware loader

-*- Firmware loading facility                                                                                                                                          

(ctefx.bin) Build named firmware blobs into the kernel binary

(/lib/firmware) Firmware blobs root directory
```

After save and exit, do a make all and watch if (in the middle of your compilation) something like this appears: (this is from my two loads; if you want to load more than one file you must only seperate them with a blank in above line):

```
  UPD     drivers/base/firmware_loader/builtin/i915/skl_dmc_ver1_27.bin.gen.S

  UPD     drivers/base/firmware_loader/builtin/intel-ucode/06-5e-03.gen.S

  AS      drivers/base/firmware_loader/builtin/i915/skl_dmc_ver1_27.bin.gen.o

  CC      drivers/acpi/acpica/utobject.o

  AS      drivers/base/firmware_loader/builtin/intel-ucode/06-5e-03.gen.o

  AR      drivers/base/firmware_loader/builtin/built-in.a

  CC      drivers/base/firmware_loader/main.o
```

Then install your kernel and boot again. Check you dmesg and report.

Greetings,

Peter

----------

## NeddySeagoon

snwy0,

If fixing your kernel FIRMWARE appeared to not work I'll guess that you are not using the kernel you think you are.

Please post the output of 

```
uname -a
```

What does 

```
ls -l /usr/src/linux/.config
```

return?

----------

## snwy0

finally working!!! 

I did what pietinger said even tho i already tried that with the other kernels,  didnt work the first time, changed the support for the device from module to build in just to try and it worked, dmesg report the same error with only "ctefx-r3di.bin" but it works.

i still dont understand, do i have to add every firmware the kernel needs to CONFIG_EXTRA_FIRMWARE ? cant the kernel load automatically from /lib/firmware? and still does not work as a module for some reason

just in case then:

uname -a

```
Linux snwy 5.7.7-gentoo #13 SMP Thu Jul 2 19:04:06 CEST 2020 x86_64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz GenuineIntel GNU/Linux
```

ls -l /usr/src/linux/.config

```
-rw-r--r-- 1 root root 118K Jul  2 19:03 /usr/src/linux/.config
```

thank you all for helping out this noob  :Very Happy: 

----------

## pietinger

You have an intel i7 skylake (like me). You should add two more files into your kernel-firmware loading. Look at these wiki-entries:

https://wiki.gentoo.org/wiki/Intel

https://forums.gentoo.org/viewtopic-t-1065464.html

together with chapter: New method without initram-fs/disk (efistub compatible)

https://wiki.gentoo.org/wiki/Intel_microcode

----------

## NeddySeagoon

snwy0,

Firmare is loaded at the time the driver that needs it is initalised.

If the driver is built into the kernel, that happens before root is mounted, so /lib/firmware does not yet exist.

When the driver is a module, its loaded after root is mounted (its in /lib/modules/..) , so firmware in /lib/firmware works too.

----------

## snwy0

i'll check it out, thank you all

----------

