# [SOLVED] realtek.ko not loaded. Builtin not working either

## nomme

Hi

I have been a lazy boy and am currently trying to upgrade from kernel 4.14.83 to 5.4.38. I manually configure the kernel (i.e. no genkernel). When booting into the new kernel the ethernet device is missing and the driver prints this in dmesg.

```
[    1.998572] r8169 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control

[    1.999259] libphy: r8169: probed

[    1.999285] r8169 0000:03:00.0: realtek.ko not loaded, maybe it needs to be added to initramfs?

[    1.999417] r8169: probe of 0000:03:00.0 failed with error -49
```

I see the stuff about ASPM with 4.14.83 as well so I have disregarded that so far.

Naturally I have search the webs for a solution and found mainly this and this.

I started out with the relevant parameters as modules

```
CONFIG_R8169=m

CONFIG_PHYLIB=m

CONFIG_REALTEK_PHY=m
```

I tried changing all of them to builtins (=y) to get away from any problems with the order they are loaded but I still get the same problem. In desperation I also tried this to make sure R8169 is loaded after the other stuff. I get the same error message regardless of configuration combination.

```
CONFIG_R8169=m

CONFIG_PHYLIB=y

CONFIG_REALTEK_PHY=y
```

Since the functions which prints the error message deals with MDIO I also made sure that MDIO bus is built into the kernel. But I am running out of ideas. Help would be appreciated. Maybe genkernel is the safer alternative?

Complete .config: https://pastebin.com/jVMaQ7ts

Complete dmesg: https://pastebin.com/7nHah3ek It contains errors for sr0 and md1(raid6) as well but seems unrelated to the ethernet driver.Last edited by nomme on Thu Jun 18, 2020 7:43 am; edited 1 time in total

----------

## charles17

What about bug 716286?

----------

## nomme

I am not sure I see the similarity. In 716286 it seems the driver works for a while. In my case it fails immediately.

I can take a closer look at it later today. They seem to be mentioning differences between chip revisions. I am using an older version.

```
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03)

        Subsystem: Gigabyte Technology Co., Ltd Onboard Ethernet

        Flags: bus master, fast devsel, latency 0, IRQ 25

        I/O ports at ce00 [size=256]

        Memory at fdfff000 (64-bit, prefetchable) [size=4K]

        Memory at fdff8000 (64-bit, prefetchable) [size=16K]

        [virtual] Expansion ROM at fd600000 [disabled] [size=128K]

        Capabilities: [40] Power Management version 3

        Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+

        Capabilities: [70] Express Endpoint, MSI 01

        Capabilities: [ac] MSI-X: Enable- Count=4 Masked-

        Capabilities: [cc] Vital Product Data

        Capabilities: [100] Advanced Error Reporting

        Capabilities: [140] Virtual Channel

        Capabilities: [160] Device Serial Number 03-00-00-00-68-4c-e0-00

        Kernel driver in use: r8169

        Kernel modules: r8169
```

----------

## xaviermiller

hi,

How did you do the upgrade? Did you copy the .config and do "make oldconfig" or reconfigure all by hand?

----------

## nomme

 *xaviermiller wrote:*   

> hi,
> 
> How did you do the upgrade? Did you copy the .config and do "make oldconfig" or reconfigure all by hand?

 

I did "make oldconfig" which picked up the previous config from /boot/. It was tedious going through all the new parameters but the values from the old config are preserved as far as I can tell.

----------

## Goverp

A report on manjaro linux may help

----------

## nomme

I finally solved it, but I feel bamboozled. I've had this motherboard with the NIC since 2010 and I've always used the r8169 mainline kernel driver. Now I learn that since my card is an r8168 (not r8169) I have to switch driver since the kernel one is no longer compatible with the card. Or to be more specific I guess the Realtek PHY driver is not compatible with the card. It would have been kind if the driver just refrained from attaching to a card it's not compatible with instead of giving cryptic messages about modules not being loaded. I even tried kernel 5.7.2 and the behavior is the same.

So to summarize.

* If you have a RTL8111/8168/8411 card do not use the r8169 driver

* Install the r8168 driver instead

Seems simple in hindsight but the compatibility change and error messages took me by surprise.

Thanks for the help everybody. Now I just have to figure out why the RAID does not mount after the update...

----------

## mimosinnet

Dear nomme, the same thing happened to me, and I've been searching and trying different things, until I arrived to this thread. Thanks a lot!

----------

