R8168 - kernel 5.6.3 driver broken

systeminfo:

System:    Host: MinistryOfSillyWalk Kernel: 5.6.3-2-lja-1 x86_64 bits: 64 compiler: gcc v: 9.3.0 
           parameters: BOOT_IMAGE=/boot/vmlinuz-5.6-x86_64 root=UUID=d87ab47c-c818-4e3f-950f-ba09b72c9d44 rw quiet apparmor=1 
           security=apparmor resume=UUID=34972f24-3d77-4a9b-84fe-7838e0b5af1f udev.log_priority=3 
           Console: N/A dm: SDDM Distro: Manjaro Linux 
Machine:   Type: Desktop Mobo: Gigabyte model: GA-MA790FXT-UD5P serial: N/A BIOS: Award v: F8l date: 07/15/2010 
Memory:    RAM: total: 7.78 GiB used: 1.20 GiB (15.5%) 
           Array-1: capacity: 16 GiB slots: 4 EC: None max module size: 4 GiB note: est. 
           Device-1: A0 size: 4 GiB info: double-bank speed: 1333 MT/s type: Unknown detail: none bus width: 64 bits 
           total: 64 bits manufacturer: N/A part-no: N/A serial: N/A 
           Device-2: A1 size: 4 GiB info: double-bank speed: 1333 MT/s type: Unknown detail: none bus width: 64 bits 
           total: 64 bits manufacturer: N/A part-no: N/A serial: N/A 
           Device-3: A2 size: No Module Installed 
           Device-4: A3 size: No Module Installed 
PCI Slots: Slot: 7 type: 32-bit PCI PCI status: Available length: Long 
           Slot: 6 type: 32-bit PCI PCI status: Available length: Long 
           Slot: 0 type: x16 PCI Express PCI Express x16 status: Unknown length: Other 
           Slot: 0 type: x16 PCI Express PCI Express x16 status: Unknown length: Other 
           Slot: 0 type: x1 PCI Express PCI Express x1 status: Unknown length: Other 
           Slot: 0 type: x1 PCI Express PCI Express x1 status: Unknown length: Other 
           Slot: 0 type: x1 PCI Express PCI Express x1 status: Unknown length: Other 
CPU:       Topology: Quad Core model: AMD Phenom II X4 965 bits: 64 type: MCP arch: K10 family: 10 (16) model-id: 4 
           stepping: 2 microcode: 10000DB L1 cache: 256 KiB L2 cache: 2048 KiB L3 cache: 512 KiB bogomips: 26535 
           Speed: 2200 MHz min/max: 800/3300 MHz Core speeds (MHz): 1: 2200 2: 800 3: 800 4: 800 
           Flags: 3dnow 3dnowext 3dnowprefetch abm apic clflush cmov cmp_legacy constant_tsc cpuid cr8_legacy cx16 cx8 de 
           extapic extd_apicid fpu fxsr fxsr_opt ht hw_pstate ibs lahf_lm lbrv lm mca mce misalignsse mmx mmxext monitor msr 
           mtrr nonstop_tsc nopl npt nrip_save nx osvw pae pat pdpe1gb pge pni popcnt pse pse36 rdtscp rep_good sep skinit sse 
           sse2 sse4a svm svm_lock syscall tsc vme vmmcall wdt 
           Vulnerabilities: Type: itlb_multihit status: Not affected 
           Type: l1tf status: Not affected 
           Type: mds status: Not affected 
           Type: meltdown status: Not affected 
           Type: spec_store_bypass status: Not affected 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Full AMD retpoline, STIBP: disabled, RSB filling 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] 
           vendor: Sapphire Limited Nitro+ driver: amdgpu v: kernel bus ID: 01:00.0 chip ID: 1002:67df 
           Display: server: X.org 1.20.8 driver: amdgpu FAILED: ati unloaded: modesetting,radeon alternate: fbdev,vesa 
           compositor: kwin_x11 tty: 320x90 
           Message: Advanced graphics data unavailable in console for root. 
Audio:     Device-1: Advanced Micro Devices [AMD/ATI] SBx00 Azalia vendor: Gigabyte driver: snd_hda_intel v: kernel 
           bus ID: 00:14.2 chip ID: 1002:4383 
           Device-2: AMD Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] vendor: Sapphire Limited driver: snd_hda_intel 
           v: kernel bus ID: 01:00.1 chip ID: 1002:aaf0 
           Device-3: Microsoft LifeCam Cinema type: USB driver: snd-usb-audio,uvcvideo bus ID: 2-3:4 chip ID: 045e:075d 
           Sound Server: ALSA v: k5.6.3-2-lja-1 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Gigabyte driver: N/A port: be00 
           bus ID: 02:00.0 chip ID: 10ec:8168 
           Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Gigabyte driver: N/A port: ee00 
           bus ID: 03:00.0 chip ID: 10ec:8168 
           Device-3: ASUSTek 802.11ac NIC type: USB driver: usb-network bus ID: 1-1:2 chip ID: 0b05:1841 serial: 123456 
           WAN IP: No WAN IP data found. Connected to the web? SSL issues? 
Drives:    Local Storage: total: 1.14 TiB used: 346.50 GiB (29.8%) 
           ID-1: /dev/sda vendor: Seagate model: ST3250310AS size: 232.88 GiB block size: physical: 512 B logical: 512 B 
           speed: 1.5 Gb/s serial: 6RYBLJ96 rev: F scheme: MBR 
           ID-2: /dev/sdb vendor: Seagate model: ST3250310AS size: 232.89 GiB block size: physical: 512 B logical: 512 B 
           speed: 1.5 Gb/s serial: 6RYBR7T5 rev: F 
           ID-3: /dev/sdc vendor: Seagate model: ST3250310AS size: 232.89 GiB block size: physical: 512 B logical: 512 B 
           speed: 1.5 Gb/s serial: 6RYBVLSR rev: F 
           ID-4: /dev/sdd vendor: Samsung model: HD501LJ size: 465.76 GiB block size: physical: 512 B logical: 512 B 
           speed: 3.0 Gb/s serial: S0MUJ1KP818298 rev: 0-10 scheme: MBR 
           Optical-1: /dev/sr0 vendor: HL-DT-ST model: BDDVDRW GGC-H20L rev: 1.03 dev-links: cdrom 
           Features: speed: 40 multisession: yes audio: yes dvd: yes rw: cd-r,cd-rw,dvd-r,dvd-ram state: running 
RAID:      Message: No RAID data was found. 
Partition: ID-1: / raw size: 46.52 GiB size: 45.54 GiB (97.89%) used: 9.12 GiB (20.0%) fs: ext4 block size: 4096 B 
           dev: /dev/sda2 label: N/A uuid: d87ab47c-c818-4e3f-950f-ba09b72c9d44 
           ID-2: /home raw size: 181.61 GiB size: 178.63 GiB (98.36%) used: 139.91 GiB (78.3%) fs: ext4 block size: 4096 B 
           dev: /dev/sda5 label: N/A uuid: cec713b0-52f8-4b49-9bda-e01351630352 
           ID-3: /mnt/b1 raw size: 232.88 GiB size: 232.77 GiB (99.95%) used: 41.41 GiB (17.8%) fs: vfat block size: 512 B 
           dev: /dev/sdb1 label: N/A uuid: 1A72-B6E7 
           ID-4: /mnt/c3 raw size: 135.23 GiB size: 135.16 GiB (99.95%) used: 6.25 GiB (4.6%) fs: vfat block size: 512 B 
           dev: /dev/sdc3 label: N/A uuid: 187D-F228 
           ID-5: /mnt/d1 raw size: 465.76 GiB size: 465.53 GiB (99.95%) used: 149.80 GiB (32.2%) fs: vfat block size: 512 B 
           dev: /dev/sdd1 label: N/A uuid: 1936-FCDB 
           ID-6: swap-1 size: 4.66 GiB used: 0 KiB (0.0%) fs: swap swappiness: 60 (default) cache pressure: 100 (default) 
           dev: /dev/sda3 label: N/A uuid: 34972f24-3d77-4a9b-84fe-7838e0b5af1f 
Unmounted: ID-1: /dev/sda1 size: 100.0 MiB fs: ntfs label: System Reserved uuid: 1C5AEF925AEF674C 
           ID-2: /dev/sda4 size: 1 KiB fs: N/A label: N/A uuid: N/A 
           ID-3: /dev/sdc1 size: 97.16 GiB fs: ntfs label: N/A uuid: 289878A9987876E2 
           ID-4: /dev/sdc2 size: 510.0 MiB fs: ntfs label: N/A uuid: 303429DB3429A536 
USB:       Hub: 1-0:1 info: Full speed (or root) Hub ports: 6 rev: 2.0 speed: 480 Mb/s chip ID: 1d6b:0002 
           Device-1: 1-1:2 info: ASUSTek 802.11ac NIC type: <vendor specific> driver: N/A interfaces: 1 rev: 2.1 
           speed: 480 Mb/s chip ID: 0b05:1841 serial: 123456 
           Hub: 1-4:3 info: Genesys Logic 4-port hub ports: 4 rev: 2.1 speed: 480 Mb/s chip ID: 05e3:0610 
           Hub: 1-4.1:4 info: Genesys Logic Hub ports: 4 rev: 2.0 speed: 480 Mb/s chip ID: 05e3:0608 
           Device-2: 1-4.2:5 info: Cambridge Silicon Radio Bluetooth Dongle (HCI mode) type: Bluetooth driver: btusb 
           interfaces: 2 rev: 2.0 speed: 12 Mb/s chip ID: 0a12:0001 
           Device-3: 1-4.4:6 info: Samsung Galaxy series misc. (MTP mode) type: Still Imaging,Abstract (modem),CDC-Data 
           driver: cdc_acm interfaces: 4 rev: 2.0 speed: 480 Mb/s chip ID: 04e8:6860 serial: 2b2d7bd8b61d7ece 
           Hub: 2-0:1 info: Full speed (or root) Hub ports: 6 rev: 2.0 speed: 480 Mb/s chip ID: 1d6b:0002 
           Device-4: 2-3:4 info: Microsoft LifeCam Cinema type: Video,Audio driver: snd-usb-audio,uvcvideo interfaces: 4 
           rev: 2.0 speed: 480 Mb/s chip ID: 045e:075d 
           Hub: 3-0:1 info: Full speed (or root) Hub ports: 3 rev: 1.1 speed: 12 Mb/s chip ID: 1d6b:0001 
           Hub: 4-0:1 info: Full speed (or root) Hub ports: 3 rev: 1.1 speed: 12 Mb/s chip ID: 1d6b:0001 
           Hub: 5-0:1 info: Full speed (or root) Hub ports: 3 rev: 1.1 speed: 12 Mb/s chip ID: 1d6b:0001 
           Device-5: 5-1:2 info: Logitech M105 Optical Mouse type: Mouse driver: hid-generic,usbhid interfaces: 1 rev: 2.0 
           speed: 1.5 Mb/s chip ID: 046d:c077 
           Device-6: 5-2:3 info: Microsoft Wired Keyboard 600 (model 1576) type: Keyboard,HID driver: hid-generic,usbhid 
           interfaces: 2 rev: 2.0 speed: 1.5 Mb/s chip ID: 045e:07f8 
           Hub: 6-0:1 info: Full speed (or root) Hub ports: 3 rev: 1.1 speed: 12 Mb/s chip ID: 1d6b:0001 
           Hub: 7-0:1 info: Full speed (or root) Hub ports: 2 rev: 1.1 speed: 12 Mb/s chip ID: 1d6b:0001 
Sensors:   System Temperatures: cpu: 45.9 C mobo: N/A gpu: amdgpu temp: 36 C 
           Fan Speeds (RPM): N/A gpu: amdgpu fan: 893 
Repos:     Active pacman repo servers in: /etc/pacman.d/mirrorlist 
           1: http://manjaro.dcc.uchile.cl/stable/$repo/$arch
           2: https://mirror.ufro.cl/manjaro/stable/$repo/$arch
           3: https://mirror.koddos.net/manjaro/stable/$repo/$arch
           4: https://mirrors.opensource.is/manjaro/stable/$repo/$arch
           5: https://ftp.lysator.liu.se/pub/manjaro/stable/$repo/$arch
           6: https://mirror.tuchola-dc.pl/manjaro/stable/$repo/$arch
           7: http://manjaro.mirrors.uk2.net/stable/$repo/$arch
           8: https://mirror.netzspielplatz.de/manjaro/packages/stable/$repo/$arch
           9: https://nova.quantum-mirror.hu/mirrors/pub/manjaro/stable/$repo/$arch
           10: https://manjaro.c3sl.ufpr.br/stable/$repo/$arch
           11: http://mirror.is.co.za/mirrors/manjaro.org/stable/$repo/$arch
           12: http://kibo.remi.lu/stable/$repo/$arch
           13: https://manjaro.moson.eu/stable/$repo/$arch
           14: https://mirrors.ocf.berkeley.edu/manjaro/stable/$repo/$arch
           15: https://ftp.caliu.cat/pub/distribucions/manjaro/stable/$repo/$arch
           16: https://www.uex.dk/public/manjaro/stable/$repo/$arch
           17: http://manjaro.mirror.serversaustralia.com.au/stable/$repo/$arch
           18: https://manjaro.ynh.ovh/stable/$repo/$arch
           19: http://mirrors.colocall.net/manjaro/stable/$repo/$arch
           20: https://mirror.kku.ac.th/manjaro/stable/$repo/$arch
           21: https://mirror.futureweb.be/manjaro/stable/$repo/$arch
           22: http://ftp.free.org/mirrors/repo.manjaro.org/repos/stable/$repo/$arch
           23: https://mirror.csclub.uwaterloo.ca/manjaro/stable/$repo/$arch
           24: https://mirror.deace.id/manjaro/stable/$repo/$arch
           25: https://www.mirrorservice.org/sites/repo.manjaro.org/repos/stable/$repo/$arch
           26: https://manjaro.ipacct.com/manjaro/stable/$repo/$arch
           27: https://mirrors.ucr.ac.cr/manjaro/stable/$repo/$arch
           28: https://quantum-mirror.hu/mirrors/pub/manjaro/stable/$repo/$arch
           29: https://manjaro.moson.org/stable/$repo/$arch
           30: http://repo.manjaro.org.uk/stable/$repo/$arch
           31: https://mirrors.gigenet.com/manjaro/stable/$repo/$arch
           32: https://mirror.netcologne.de/manjaro/stable/$repo/$arch
           33: https://mirror.23media.com/manjaro/stable/$repo/$arch
           34: https://mirror.d-tl.com/manjaro/stable/$repo/$arch
           35: https://ftp.nluug.nl/pub/os/Linux/distr/manjaro/stable/$repo/$arch
           36: https://mirror.zetup.net/manjaro/stable/$repo/$arch
           37: http://manjaro.telecoms.bg/stable/$repo/$arch
           38: http://ftp.tsukuba.wide.ad.jp/Linux/manjaro/stable/$repo/$arch
           39: https://mirror.clarkson.edu/manjaro/stable/$repo/$arch
           40: http://manjaro.mirrors.theom.nz/stable/$repo/$arch
           41: https://repo.ialab.dsu.edu/manjaro/stable/$repo/$arch
           42: http://mirror.easyname.at/manjaro/stable/$repo/$arch
           43: http://free.nchc.org.tw/manjaro/stable/$repo/$arch
           44: https://mirror.alpix.eu/manjaro/stable/$repo/$arch
           45: https://manjaro.mcofficer.me/stable/$repo/$arch
           46: https://osmirror.org/manjaro/stable/$repo/$arch
           47: https://mirror.math.princeton.edu/pub/manjaro/stable/$repo/$arch
Processes: CPU top: 5 
           1: cpu: 13.3% command: baloo_file_extractor pid: 1583 mem: 2448.9 MiB (30.7%) 
           2: cpu: 5.0% command: dropbox pid: 1404 mem: 230.0 MiB (2.8%) 
           3: cpu: 3.2% command: less pid: 1759 mem: 3.15 MiB (0.0%) 
           4: cpu: 0.6% command: baloo_file pid: 1332 mem: 30.1 MiB (0.3%) 
           5: cpu: 0.4% command: kate pid: 1394 mem: 75.6 MiB (0.9%) 
           Memory top: 5 
           1: mem: 2448.9 MiB (30.7%) command: baloo_file_extractor pid: 1583 cpu: 13.3% 
           2: mem: 230.0 MiB (2.8%) command: dropbox pid: 1404 cpu: 5.0% 
           3: mem: 141.7 MiB (1.7%) command: ksplashqml pid: 1244 cpu: 0.1% 
           4: mem: 93.2 MiB (1.1%) command: konsole pid: 1389 cpu: 0.1% 
           5: mem: 92.9 MiB (1.1%) command: konsole pid: 1387 cpu: 0.1% 
Info:      Processes: 208 Uptime: 10m Init: systemd v: 244 Compilers: gcc: 9.3.0 Shell: bash (sudo) v: 5.0.16 inxi: 3.0.37 

Dmesg:

[ 1445.902527] r8169 0000:02:00.0: no default pinctrl state
[ 1445.902600] r8169 0000:02:00.0: can't disable ASPM; OS doesn't have ASPM control
[ 1445.902851] r8169 0000:02:00.0: While detected XID 281, ENUM: 23
[ 1445.902857] r8169 0000:02:00.0: Finally detected XID 281, ENUM: 23
[ 1445.902985] device: 'r8169-200': device_add
[ 1445.903218] PM: Adding info for No Bus:r8169-200
[ 1445.908313] device: 'r8169-200:00': device_add
[ 1445.908343] bus: 'mdio_bus': add device r8169-200:00
[ 1445.908383] PM: Adding info for mdio_bus:r8169-200:00
[ 1445.908464] libphy: r8169: probed
[ 1445.908516] bus: 'mdio_bus': remove device r8169-200:00
[ 1445.908521] PM: Removing info for mdio_bus:r8169-200:00
[ 1445.908783] PM: Removing info for No Bus:r8169-200
[ 1445.942728] r8169: probe of 0000:02:00.0 rejects match -19
[ 1445.942735] bus: 'pci': driver_probe_device: matched device 0000:03:00.0 with driver r8169
[ 1445.942739] bus: 'pci': really_probe: probing driver r8169 with device 0000:03:00.0
[ 1445.942745] r8169 0000:03:00.0: no default pinctrl state
[ 1445.942831] r8169 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control
[ 1445.943084] r8169 0000:03:00.0: While detected XID 281, ENUM: 23
[ 1445.943090] r8169 0000:03:00.0: Finally detected XID 281, ENUM: 23
[ 1445.943216] device: 'r8169-300': device_add
[ 1445.943436] PM: Adding info for No Bus:r8169-300
[ 1445.948419] device: 'r8169-300:00': device_add
[ 1445.948449] bus: 'mdio_bus': add device r8169-300:00
[ 1445.948483] PM: Adding info for mdio_bus:r8169-300:00
[ 1445.948554] libphy: r8169: probed
[ 1445.948605] bus: 'mdio_bus': remove device r8169-300:00
[ 1445.948609] PM: Removing info for mdio_bus:r8169-300:00
[ 1445.948987] PM: Removing info for No Bus:r8169-300
[ 1445.969019] r8169: probe of 0000:03:00.0 rejects match -19
....
....
....
[ 1601.082924] bus: 'mdio_bus': add driver RTL8201CP Ethernet
[ 1601.082971] bus: 'mdio_bus': add driver RTL8201F Fast Ethernet
[ 1601.083001] bus: 'mdio_bus': add driver RTL8208 Fast Ethernet
[ 1601.083027] bus: 'mdio_bus': add driver RTL8211 Gigabit Ethernet
[ 1601.083054] bus: 'mdio_bus': add driver RTL8211B Gigabit Ethernet
[ 1601.083082] bus: 'mdio_bus': add driver RTL8211C Gigabit Ethernet
[ 1601.083110] bus: 'mdio_bus': add driver RTL8211DN Gigabit Ethernet
[ 1601.083138] bus: 'mdio_bus': add driver RTL8211E Gigabit Ethernet
[ 1601.083165] bus: 'mdio_bus': add driver RTL8211F Gigabit Ethernet
[ 1601.083192] bus: 'mdio_bus': add driver Generic FE-GE Realtek PHY
[ 1601.083221] bus: 'mdio_bus': add driver RTL8125 2.5Gbps internal
[ 1601.083249] bus: 'mdio_bus': add driver RTL8366RB Gigabit Ethernet
[ 1601.098101] bus: 'pci': add driver r8169
[ 1601.098119] bus: 'pci': driver_probe_device: matched device 0000:02:00.0 with driver r8169
[ 1601.098123] bus: 'pci': really_probe: probing driver r8169 with device 0000:02:00.0
[ 1601.098128] r8169 0000:02:00.0: no default pinctrl state
[ 1601.098162] r8169 0000:02:00.0: can't disable ASPM; OS doesn't have ASPM control
[ 1601.098264] r8169 0000:02:00.0: While detected XID 281, ENUM: 23
[ 1601.098265] r8169 0000:02:00.0: Finally detected XID 281, ENUM: 23
[ 1601.098327] device: 'r8169-200': device_add
[ 1601.098397] PM: Adding info for No Bus:r8169-200
[ 1601.100197] device: 'r8169-200:00': device_add
[ 1601.100206] bus: 'mdio_bus': add device r8169-200:00
[ 1601.100216] PM: Adding info for mdio_bus:r8169-200:00
[ 1601.100240] libphy: r8169: probed
[ 1601.100254] bus: 'mdio_bus': remove device r8169-200:00
[ 1601.100255] PM: Removing info for mdio_bus:r8169-200:00
[ 1601.100317] PM: Removing info for No Bus:r8169-200
[ 1601.142238] r8169: probe of 0000:02:00.0 rejects match -19
[ 1601.142244] bus: 'pci': driver_probe_device: matched device 0000:03:00.0 with driver r8169
[ 1601.142247] bus: 'pci': really_probe: probing driver r8169 with device 0000:03:00.0
[ 1601.142251] r8169 0000:03:00.0: no default pinctrl state
[ 1601.142290] r8169 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control
[ 1601.142375] r8169 0000:03:00.0: While detected XID 281, ENUM: 23
[ 1601.142377] r8169 0000:03:00.0: Finally detected XID 281, ENUM: 23
[ 1601.142437] device: 'r8169-300': device_add
[ 1601.142514] PM: Adding info for No Bus:r8169-300
[ 1601.144422] device: 'r8169-300:00': device_add
[ 1601.144431] bus: 'mdio_bus': add device r8169-300:00
[ 1601.144442] PM: Adding info for mdio_bus:r8169-300:00
[ 1601.144470] libphy: r8169: probed
[ 1601.144487] bus: 'mdio_bus': remove device r8169-300:00
[ 1601.144489] PM: Removing info for mdio_bus:r8169-300:00
[ 1601.144571] PM: Removing info for No Bus:r8169-300
[ 1601.165574] r8169: probe of 0000:03:00.0 rejects match -19

it get's probed ok, but why it is later then removed?

The output is my custom kernel (just added prints, and forced 23th enum to pass to mdio_get_phy()

Seems you're using a custom compiled kernel. Also you're listing about r8169, which is part of the kernel itself. Sure there is also a r8168 kernel module, which you have to install separate via a package or dkms. As soon as r8168 gets installed, the internal r8169 module gets blacklisted.

On my end I can use either of both to have my network successfully working:

lsmod | grep r81
r8169                  90112  0
libphy                139264  2 r8169,realtek
1 Like

well the NIC's my motherboard have are r8168:

Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Gigabyte driver: N/A port: be00 
           bus ID: 02:00.0 chip ID: 10ec:8168 
           Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Gigabyte driver: N/A port: ee00 
           bus ID: 03:00.0 chip ID: 10ec:8168 

What i've done is i've tried to force kernel's r8169 driver (that has support for r8168) to be taken by force to use, but no help.

I have read a few recent posts about issues with the r8169 kernel module. Perhaps recent patches to the kernel have created new problems for some.

https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.5.14

It may be worth testing the proprietary r8168 driver as @philm already suggested.

1 Like

I found the cultpir: Boolean checks as null checks. I'm now testin my patch

NET: r8169 module enchansments & fixes

  * Added soft depency from realtec phy to libphy.
  * realtek.ko is checked by cheking ID's of physical layer and driver


Signed-off-by: Lauri Jakku <lja@iki.fi>
diff -ur linux-patsatty/drivers/net/ethernet/realtek/r8169_main.c linux-modattu/drivers/net/ethernet/realtek/r8169_main.c
--- linux-patsatty/drivers/net/ethernet/realtek/r8169_main.c	2020-03-30 01:25:41.000000000 +0300
+++ linux-modattu/drivers/net/ethernet/realtek/r8169_main.c	2020-04-12 15:42:59.876628465 +0300
@@ -2153,6 +2153,9 @@
 		p++;
 	tp->mac_version = p->mac_version;
 
+	dev_dbg(tp_to_dev(tp), "Detected chip XID %03x, ENUM: %d\n",
+		reg & 0xfcf, p->mac_version);
+
 	if (tp->mac_version == RTL_GIGA_MAC_NONE) {
 		dev_err(tp_to_dev(tp), "unknown chip XID %03x\n", reg & 0xfcf);
 	} else if (!tp->supports_gmii) {
@@ -2163,6 +2166,9 @@
 		else if (tp->mac_version == RTL_GIGA_MAC_VER_46)
 			tp->mac_version = RTL_GIGA_MAC_VER_48;
 	}
+	dev_info(tp_to_dev(tp), "Final chip XID %03x, ENUM: %d\n",
+		reg & 0xfcf, p->mac_version);
+
 }
 
 static void rtl_release_firmware(struct rtl8169_private *tp)
@@ -5262,6 +5268,9 @@
 {
 	struct pci_dev *pdev = tp->pci_dev;
 	struct mii_bus *new_bus;
+	u32 phydev_id = 0;
+	u32 phydrv_id = 0;
+	u32 phydrv_id_mask = 0;
 	int ret;
 
 	new_bus = devm_mdiobus_alloc(&pdev->dev);
@@ -5278,20 +5287,62 @@
 	new_bus->write = r8169_mdio_write_reg;
 
 	ret = mdiobus_register(new_bus);
+	dev_info(&pdev->dev,
+		 "mdiobus_register: %s, %d\n",
+		 new_bus->id, ret);
 	if (ret)
 		return ret;
 
 	tp->phydev = mdiobus_get_phy(new_bus, 0);
+
 	if (!tp->phydev) {
 		mdiobus_unregister(new_bus);
 		return -ENODEV;
-	} else if (!tp->phydev->drv) {
-		/* Most chip versions fail with the genphy driver.
-		 * Therefore ensure that the dedicated PHY driver is loaded.
-		 */
-		dev_err(&pdev->dev, "realtek.ko not loaded, maybe it needs to be added to initramfs?\n");
-		mdiobus_unregister(new_bus);
-		return -EUNATCH;
+	} else {
+		/* tp -> phydev ok */
+		int everything_OK = 0;
+
+		/* get id's if not null */
+
+		if (tp->phydev->drv) {
+			u32 phydev_masked = 0xBEEFDEAD;
+			u32 drv_masked = !0;
+			u32 phydev_match = !0;
+			u32 drv_match = 0xDEADBEEF;
+
+			phydev_id      = tp->phydev->phy_id;
+			phydrv_id      = tp->phydev->drv->phy_id;
+			phydrv_id_mask = tp->phydev->drv->phy_id_mask;
+
+			drv_masked    = phydrv_id & phydrv_id_mask;
+			phydev_masked = phydev_id & phydrv_id_mask;
+
+			dev_debug(&pdev->dev,
+				  "%s: ID Check: (%x -> %x), drv (%x -> %x)\n",
+				new_bus->id, phydev_id, phydev_masked,
+				phydrv_id, drv_masked);
+
+			phydev_match = phydev_masked & drv_masked;
+			phydev_match = phydev_match == phydev_masked;
+
+			drv_match    = phydev_masked & drv_masked;
+			drv_match    = drv_match == drv_masked;
+
+			dev_debug(&pdev->dev, "%s: ID Check: %x == %x\n",
+				new_bus->id, phydev_match, drv_match);
+
+			everything_OK = (phydev_match == drv_match);
+		}
+
+		if (!everything_OK) {
+			/* Most chip versions fail with the genphy driver.
+			 * Therefore ensure that the dedicated PHY driver
+			 * is loaded.
+			 */
+			dev_err(&pdev->dev, "realtek.ko not loaded, maybe it needs to be added to initramfs?\n");
+			mdiobus_unregister(new_bus);
+			return -EUNATCH;
+		}
 	}
 
 	/* PHY will be woken up in rtl_open() */
@@ -5486,7 +5537,7 @@
 	}
 
 	if (pcim_set_mwi(pdev) < 0)
-		dev_info(&pdev->dev, "Mem-Wr-Inval unavailable\n");
+		dev_dbg(&pdev->dev, "Mem-Wr-Inval unavailable\n");
 
 	/* use first MMIO region */
 	region = ffs(pci_select_bars(pdev, IORESOURCE_MEM)) - 1;
@@ -5508,9 +5559,12 @@
 	}
 
 	tp->mmio_addr = pcim_iomap_table(pdev)[region];
+	dev_err(&pdev->dev, "MMIO addr: 0x%p\n", tp->mmio_addr);
 
 	/* Identify chip attached to board */
 	rtl8169_get_mac_version(tp);
+	dev_err(&pdev->dev, "MAC version: %d\n", tp->mac_version);
+
 	if (tp->mac_version == RTL_GIGA_MAC_NONE)
 		return -ENODEV;
 
@@ -5520,17 +5574,23 @@
 	    !dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)))
 		dev->features |= NETIF_F_HIGHDMA;
 
+	dev_dbg(&pdev->dev, "init: rxcfg\n");
 	rtl_init_rxcfg(tp);
 
+	dev_dbg(&pdev->dev, "init: irq_mask_and_ack\n");
 	rtl8169_irq_mask_and_ack(tp);
 
+	dev_dbg(&pdev->dev, "init: HW\n");
 	rtl_hw_initialize(tp);
 
+	dev_dbg(&pdev->dev, "init: reset HW\n");
 	rtl_hw_reset(tp);
 
+	dev_dbg(&pdev->dev, "init: pci master\n");
 	pci_set_master(pdev);
 
 	chipset = tp->mac_version;
+	dev_dbg(&pdev->dev, "init: chipset: %d\n", chipset);
 
 	rc = rtl_alloc_irq(tp);
 	if (rc < 0) {
@@ -5543,6 +5603,7 @@
 	u64_stats_init(&tp->rx_stats.syncp);
 	u64_stats_init(&tp->tx_stats.syncp);
 
+	dev_dbg(&pdev->dev, "init: MAC\n");
 	rtl_init_mac_address(tp);
 
 	dev->ethtool_ops = &rtl8169_ethtool_ops;
@@ -5595,12 +5656,15 @@
 	dev->hw_features |= NETIF_F_RXFCS;
 
 	jumbo_max = rtl_jumbo_max(tp);
+	dev_dbg(&pdev->dev, "init: jumbo max: %d\n", jumbo_max);
 	if (jumbo_max)
 		dev->max_mtu = jumbo_max;
 
+	dev_dbg(&pdev->dev, "init: irq mask\n");
 	rtl_set_irq_mask(tp);
 
 	tp->fw_name = rtl_chip_infos[chipset].fw_name;
+	dev_dbg(&pdev->dev, "init: FW name: %s\n", tp->fw_name);
 
 	tp->counters = dmam_alloc_coherent (&pdev->dev, sizeof(*tp->counters),
 					    &tp->counters_phys_addr,
@@ -5608,16 +5672,21 @@
 	if (!tp->counters)
 		return -ENOMEM;
 
+	dev_dbg(&pdev->dev, "init: set driver data\n");
 	pci_set_drvdata(pdev, dev);
 
+	dev_dbg(&pdev->dev, "init: register mdio\n");
 	rc = r8169_mdio_register(tp);
+	dev_dbg(&pdev->dev, "init: mdio register: %d\n", rc);
 	if (rc)
 		return rc;
 
 	/* chip gets powered up in rtl_open() */
+	dev_dbg(&pdev->dev, "init: pll pwr down\n");
 	rtl_pll_power_down(tp);
 
 	rc = register_netdev(dev);
+	dev_dbg(&pdev->dev, "init: netdev register: %d\n", rc);
 	if (rc)
 		goto err_mdio_unregister;
 
@@ -5638,6 +5707,8 @@
 	if (pci_dev_run_wake(pdev))
 		pm_runtime_put_sync(&pdev->dev);
 
+	dev_dbg(&pdev->dev, "init: ALL DONE!\n");
+
 	return 0;
 
 err_mdio_unregister:
diff -ur linux-patsatty/drivers/net/phy/mdio_bus.c linux-modattu/drivers/net/phy/mdio_bus.c
--- linux-patsatty/drivers/net/phy/mdio_bus.c	2020-03-30 01:25:41.000000000 +0300
+++ linux-modattu/drivers/net/phy/mdio_bus.c	2020-04-12 15:41:51.199019551 +0300
@@ -112,6 +112,8 @@
 struct phy_device *mdiobus_get_phy(struct mii_bus *bus, int addr)
 {
 	struct mdio_device *mdiodev = bus->mdio_map[addr];
+	struct phy_device *rv = NULL;
+	pr_debug("mii_bus %s addr %d, %p\n", bus->id, addr, mdiodev);
 
 	if (!mdiodev)
 		return NULL;
@@ -119,7 +121,10 @@
 	if (!(mdiodev->flags & MDIO_DEVICE_FLAG_PHY))
 		return NULL;
 
-	return container_of(mdiodev, struct phy_device, mdio);
+	rv = container_of(mdiodev, struct phy_device, mdio);
+	pr_debug("mii_bus OK? %s addr %d, %p -> %p\n",
+		 bus->id, addr, mdiodev, rv);
+	return rv;
 }
 EXPORT_SYMBOL(mdiobus_get_phy);
 
@@ -628,10 +633,11 @@
 	mdiobus_setup_mdiodev_from_board_info(bus, mdiobus_create_device);
 
 	bus->state = MDIOBUS_REGISTERED;
-	pr_info("%s: probed\n", bus->name);
+	pr_debug("%s: probed (mdiobus_register)\n", bus->name);
 	return 0;
 
 error:
+	pr_debug("%s: ERROR while in mdiobus_register: %d\n", bus->name, err);
 	while (--i >= 0) {
 		mdiodev = bus->mdio_map[i];
 		if (!mdiodev)
diff -ur linux-patsatty/drivers/net/phy/realtek.c linux-modattu/drivers/net/phy/realtek.c
--- linux-patsatty/drivers/net/phy/realtek.c	2020-04-11 03:42:14.086416074 +0300
+++ linux-modattu/drivers/net/phy/realtek.c	2020-03-30 01:25:41.000000000 +0300
@@ -54,8 +54,6 @@
 MODULE_DESCRIPTION("Realtek PHY driver");
 MODULE_AUTHOR("Johnson Leung");
 MODULE_LICENSE("GPL");
-MODULE_SOFTDEP("pre: libphy");
-
 
 static int rtl821x_read_page(struct phy_device *phydev)
 {

1 Like

i'm barked the wrong tree, the issue seems to be that some NIC card identify themselves with semirandom stuff, that info i got when discussed with module maintainer..that is, but when reprobed, work ok. I'm doing on top of 5.7.0 a fix that should be just fine for older kernels as well.. Once i'm done, i'll put patch here. so manjaro can apply patch to source's they see fit.

I try to put some instructions how to patch kernel and build it from scratch, when i'm sure that it helps things.

Solution to r816X problems:

From 8e687ddb949214d5f9cb581db7d0246af3556a54 Mon Sep 17 00:00:00 2001
From: Lauri Jakku <lja@iki.fi>
Date: Sun, 17 May 2020 15:04:51 +0300
Subject: [PATCH] net: ethernet: realtek: r8168 / r8169 driver fix.

There is issue with tp->phydev->drv: It never gets non-null value
while driver is probed first time -> modify the driver check to
trust MAC information fetched from HW.

Something does not run/register PHY interface properly ->
the attachment is done way later -> driver does not work
properly.

Function phy_probe is not called in first module loading.

Line from drivers/net/phy/phy_device.c witch is not executed when
loading first time:

static int phy_probe(struct device *dev)
{
        struct phy_device *phydev = to_phy_device(dev);
        struct device_driver *drv = phydev->mdio.dev.driver;
        struct phy_driver *phydrv = to_phy_driver(drv);
        int err = 0;

        phydev->drv = phydrv; <--- This is never done in probe
                                   of r8169_main.c


That line is not executed when driver is loaded with modprobe,
but when load->remove->reload cycle is done, it is ok.
---
 drivers/net/ethernet/realtek/r8169_main.c | 20 +++---
 drivers/net/phy/phy-core.c                | 76 ++++++++++++++++++++++-
 drivers/net/phy/phy_device.c              |  4 +-
 3 files changed, 89 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index bf5bf05970a2..1ad5fb591621 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5172,15 +5172,19 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
 	if (!tp->phydev) {
 		mdiobus_unregister(new_bus);
 		return -ENODEV;
-	} else if (!tp->phydev->drv) {
-		/* Most chip versions fail with the genphy driver.
-		 * Therefore ensure that the dedicated PHY driver is loaded.
-		 */
-		dev_err(&pdev->dev, "realtek.ko not loaded, maybe it needs to be added to initramfs?\n");
-		mdiobus_unregister(new_bus);
-		return -EUNATCH;
+       } else {
+               dev_info(&pdev->dev, "PHY version: 0x%x\n", tp->phydev->phy_id);
+               dev_info(&pdev->dev, "MAC version: %d\n", tp->mac_version);
+
+               if (tp->mac_version == RTL_GIGA_MAC_NONE) {
+                       /* Most chip versions fail with the genphy driver.
+                        * Therefore ensure that the dedicated PHY driver is loaded.
+                        */
+                       dev_err(&pdev->dev, "Not known MAC/PHY version.\n", tp->phydev->phy_id);
+                       mdiobus_unregister(new_bus);
+                       return -EUNATCH;
+               }
 	}
-
 	/* PHY will be woken up in rtl_open() */
 	phy_suspend(tp->phydev);
 
diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c
index 66b8c61ca74c..809ad2f943d3 100644
--- a/drivers/net/phy/phy-core.c
+++ b/drivers/net/phy/phy-core.c
@@ -151,6 +151,18 @@ static const struct phy_setting settings[] = {
 };
 #undef PHY_SETTING
 
+#define PHY_NOT_ATTACHED_CHECK \
+       { \
+               void *attached_dev_ptr = (phydev) ? phydev->attached_dev : NULL; \
+               if (! ( \
+                       (attached_dev_ptr) && \
+                       (phydev->state >= PHY_READY) \
+                      ) \
+                  ) \
+                       return -EOPNOTSUPP; \
+       };
+
+
 /**
  * phy_lookup_setting - lookup a PHY setting
  * @speed: speed to match
@@ -457,6 +469,9 @@ int phy_read_mmd(struct phy_device *phydev, int devad, u32 regnum)
 {
 	int ret;
 
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	phy_lock_mdio_bus(phydev);
 	ret = __phy_read_mmd(phydev, devad, regnum);
 	phy_unlock_mdio_bus(phydev);
@@ -479,6 +494,9 @@ int __phy_write_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val)
 {
 	int ret;
 
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	if (regnum > (u16)~0 || devad > 32)
 		return -EINVAL;
 
@@ -518,6 +536,9 @@ int phy_write_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val)
 {
 	int ret;
 
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	phy_lock_mdio_bus(phydev);
 	ret = __phy_write_mmd(phydev, devad, regnum, val);
 	phy_unlock_mdio_bus(phydev);
@@ -543,6 +564,9 @@ int phy_modify_changed(struct phy_device *phydev, u32 regnum, u16 mask, u16 set)
 {
 	int ret;
 
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	phy_lock_mdio_bus(phydev);
 	ret = __phy_modify_changed(phydev, regnum, mask, set);
 	phy_unlock_mdio_bus(phydev);
@@ -566,6 +590,9 @@ int __phy_modify(struct phy_device *phydev, u32 regnum, u16 mask, u16 set)
 {
 	int ret;
 
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	ret = __phy_modify_changed(phydev, regnum, mask, set);
 
 	return ret < 0 ? ret : 0;
@@ -587,6 +614,9 @@ int phy_modify(struct phy_device *phydev, u32 regnum, u16 mask, u16 set)
 {
 	int ret;
 
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	phy_lock_mdio_bus(phydev);
 	ret = __phy_modify(phydev, regnum, mask, set);
 	phy_unlock_mdio_bus(phydev);
@@ -613,6 +643,9 @@ int __phy_modify_mmd_changed(struct phy_device *phydev, int devad, u32 regnum,
 {
 	int new, ret;
 
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	ret = __phy_read_mmd(phydev, devad, regnum);
 	if (ret < 0)
 		return ret;
@@ -646,6 +679,9 @@ int phy_modify_mmd_changed(struct phy_device *phydev, int devad, u32 regnum,
 {
 	int ret;
 
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	phy_lock_mdio_bus(phydev);
 	ret = __phy_modify_mmd_changed(phydev, devad, regnum, mask, set);
 	phy_unlock_mdio_bus(phydev);
@@ -671,6 +707,9 @@ int __phy_modify_mmd(struct phy_device *phydev, int devad, u32 regnum,
 {
 	int ret;
 
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	ret = __phy_modify_mmd_changed(phydev, devad, regnum, mask, set);
 
 	return ret < 0 ? ret : 0;
@@ -694,6 +733,9 @@ int phy_modify_mmd(struct phy_device *phydev, int devad, u32 regnum,
 {
 	int ret;
 
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	phy_lock_mdio_bus(phydev);
 	ret = __phy_modify_mmd(phydev, devad, regnum, mask, set);
 	phy_unlock_mdio_bus(phydev);
@@ -704,6 +746,10 @@ EXPORT_SYMBOL_GPL(phy_modify_mmd);
 
 static int __phy_read_page(struct phy_device *phydev)
 {
+
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	if (WARN_ONCE(!phydev->drv->read_page, "read_page callback not available, PHY driver not loaded?\n"))
 		return -EOPNOTSUPP;
 
@@ -712,6 +758,10 @@ static int __phy_read_page(struct phy_device *phydev)
 
 static int __phy_write_page(struct phy_device *phydev, int page)
 {
+
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	if (WARN_ONCE(!phydev->drv->write_page, "write_page callback not available, PHY driver not loaded?\n"))
 		return -EOPNOTSUPP;
 
@@ -728,6 +778,10 @@ static int __phy_write_page(struct phy_device *phydev, int page)
  */
 int phy_save_page(struct phy_device *phydev)
 {
+
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	phy_lock_mdio_bus(phydev);
 	return __phy_read_page(phydev);
 }
@@ -748,6 +802,9 @@ int phy_select_page(struct phy_device *phydev, int page)
 {
 	int ret, oldpage;
 
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	oldpage = ret = phy_save_page(phydev);
 	if (ret < 0)
 		return ret;
@@ -782,6 +839,9 @@ int phy_restore_page(struct phy_device *phydev, int oldpage, int ret)
 {
 	int r;
 
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	if (oldpage >= 0) {
 		r = __phy_write_page(phydev, oldpage);
 
@@ -813,6 +873,9 @@ int phy_read_paged(struct phy_device *phydev, int page, u32 regnum)
 {
 	int ret = 0, oldpage;
 
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	oldpage = phy_select_page(phydev, page);
 	if (oldpage >= 0)
 		ret = __phy_read(phydev, regnum);
@@ -834,6 +897,9 @@ int phy_write_paged(struct phy_device *phydev, int page, u32 regnum, u16 val)
 {
 	int ret = 0, oldpage;
 
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	oldpage = phy_select_page(phydev, page);
 	if (oldpage >= 0)
 		ret = __phy_write(phydev, regnum, val);
@@ -857,6 +923,9 @@ int phy_modify_paged_changed(struct phy_device *phydev, int page, u32 regnum,
 {
 	int ret = 0, oldpage;
 
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
 	oldpage = phy_select_page(phydev, page);
 	if (oldpage >= 0)
 		ret = __phy_modify_changed(phydev, regnum, mask, set);
@@ -878,7 +947,12 @@ EXPORT_SYMBOL(phy_modify_paged_changed);
 int phy_modify_paged(struct phy_device *phydev, int page, u32 regnum,
 		     u16 mask, u16 set)
 {
-	int ret = phy_modify_paged_changed(phydev, page, regnum, mask, set);
+	int ret;
+
+	/* If phy not attached, do nothing */
+	PHY_NOT_ATTACHED_CHECK
+
+	ret = phy_modify_paged_changed(phydev, page, regnum, mask, set);
 
 	return ret < 0 ? ret : 0;
 }
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index ac2784192472..3aff74bfead0 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1352,8 +1352,6 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
 
 	phydev->interface = interface;
 
-	phydev->state = PHY_READY;
-
 	/* Initial carrier state is off as the phy is about to be
 	 * (re)initialized.
 	 */
@@ -1371,6 +1369,8 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
 	phy_resume(phydev);
 	phy_led_triggers_register(phydev);
 
+	phydev->state = PHY_READY;
+
 	return err;
 
 error:
-- 
2.26.2

SystemD files*

The service and target for systemd to refresh the network:

[sillyme@MinistryOfSillyWalk linux]$ cd /usr/lib/systemd/system
[sillyme@MinistryOfSillyWalk system]$ cat refresh-network.target 
#  SPDX-License-Identifier: LGPL-2.1+
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Refresh network
After=network.target
Before=multi-user.target

[Install]
WantedBy=refresh-network.service

The service file for systemd to refresh the network:

[sillyme@MinistryOfSillyWalk linux]$ cd /usr/lib/systemd/system
#  SPDX-License-Identifier: LGPL-2.1+
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
[Unit]
Description=Refresh network
After=refresh-network.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/refresh-network.sh
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

The script file for systemd to refresh the network:

[sillyme@MinistryOfSillyWalk system]$ cat /usr/local/bin/refresh-network.sh
tmp="/tmp/refresh-net.$$.log"
command() {
        st=$1
        shift
        logger -s -t "refresh network"  "$* .................."
        eval $* | tee $tmp
        logger -s -t "refresh network" -f $tmp
        logger -s -t "refresh network" "$* ...... RV: $?"
        sleep $st
}

command 0 nmcli networking off
command 3 sudo systemctl stop NetworkManager
command 0 sudo ip link set enp3s0 down
command 0 sudo modprobe -r r8169
command 0 sudo modprobe r8169
command 0 sudo ip link set enp3s0 mode DEFAULT
command 0 sudo ip link set enp3s0 up
command 3 sudo systemctl start NetworkManager
command 0 nmcli networking on

1 Like

Did try to send this upstream to the driver maintainer for review?

I do have discussed with maintainer, he was bit pessimistic to take the fix in, i guess that the needing of userspace thingies are the ones to get rid of first .. i think it is not 'the fix' yet cause needing userspace thingies. I put the above solution for those who needs by all means-fix.

@philm , yes i have, now I try to make fix so, that the userspace does not have to play a part by refreshing the network. In meantime the fix above does the trick.

Starting to debug why the driver needs reload to work, when that is solved, i'll make patch available.

problem recognized: libphy-module get's unloaded for some reason before r8169 driver loads -> missing lowlevel functionality -> not working driver. This only occurs at 1st load.. seeking solution.

[last unloaded: libphy] entries in log BEFORE r8169 is probed

Working kernel patch, no reloading needed anymore:

From 06c5deacf3ca9f9258431756a41ff0ba1792f1f7 Mon Sep 17 00:00:00 2001
From: Lauri Jakku <lja@iki.fi>
Date: Thu, 16 Apr 2020 00:38:51 +0300
Subject: [PATCH] NET: r8169 driver identifying improvement.

Trust device MAC enum + r8169d NIC soft reset
before configuration.

This commit adds enumeration check and allows
driver to be slow to attach.

Signed-off-by: Lauri Jakku <lja@iki.fi>
---
 drivers/net/ethernet/realtek/r8169_main.c     | 24 +++--
 .../net/ethernet/realtek/r8169_phy_config.c   | 80 ++++++++++++++++
 drivers/net/phy/phy-core.c                    | 91 ++++++++++++++++++-
 3 files changed, 182 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index bf5bf05970a2..a85764f6e448 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -640,7 +640,6 @@ MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>");
 MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver");
 module_param_named(debug, debug.msg_enable, int, 0);
 MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., 16=all)");
-MODULE_SOFTDEP("pre: realtek");
 MODULE_LICENSE("GPL");
 MODULE_FIRMWARE(FIRMWARE_8168D_1);
 MODULE_FIRMWARE(FIRMWARE_8168D_2);
@@ -5172,13 +5171,18 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
 	if (!tp->phydev) {
 		mdiobus_unregister(new_bus);
 		return -ENODEV;
-	} else if (!tp->phydev->drv) {
-		/* Most chip versions fail with the genphy driver.
-		 * Therefore ensure that the dedicated PHY driver is loaded.
-		 */
-		dev_err(&pdev->dev, "realtek.ko not loaded, maybe it needs to be added to initramfs?\n");
-		mdiobus_unregister(new_bus);
-		return -EUNATCH;
+	} else {
+		dev_info(&pdev->dev, "PHY version: 0x%x\n", tp->phydev->phy_id);
+		dev_info(&pdev->dev, "MAC version: %d\n", tp->mac_version);
+
+		if (tp->mac_version == RTL_GIGA_MAC_NONE) {
+			/* Most chip versions fail with the genphy driver.
+			 * Therefore ensure that the dedicated PHY driver is loaded.
+			 */
+			dev_err(&pdev->dev, "Not known MAC/PHY version.\n");
+			mdiobus_unregister(new_bus);
+			return -EUNATCH;
+		}
 	}
 
 	/* PHY will be woken up in rtl_open() */
@@ -5513,6 +5517,9 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 		   rtl_chip_infos[chipset].name, dev->dev_addr, xid,
 		   pci_irq_vector(pdev, 0));
 
+	dev_info(&pdev->dev, "PHY version: 0x%x\n", tp->phydev->phy_id);
+	dev_info(&pdev->dev, "MAC version: %d\n", tp->mac_version);
+
 	if (jumbo_max)
 		netif_info(tp, probe, dev,
 			   "jumbo features [frames: %d bytes, tx checksumming: %s]\n",
@@ -5532,6 +5539,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	return rc;
 }
 
+
 static struct pci_driver rtl8169_pci_driver = {
 	.name		= MODULENAME,
 	.id_table	= rtl8169_pci_tbl,
diff --git a/drivers/net/ethernet/realtek/r8169_phy_config.c b/drivers/net/ethernet/realtek/r8169_phy_config.c
index b73f7d023e99..73d604c7a8a8 100644
--- a/drivers/net/ethernet/realtek/r8169_phy_config.c
+++ b/drivers/net/ethernet/realtek/r8169_phy_config.c
@@ -1243,6 +1243,84 @@ static void rtl8125_2_hw_phy_config(struct rtl8169_private *tp,
 	rtl8125_config_eee_phy(phydev);
 }
 
+
+static void rtl8168d_hw_phy_pre_config_actions(struct rtl8169_private *tp,
+						    struct phy_device *phydev)
+{
+	/* Reset the PHY before configuration. There is BIOS bug that gives 
+	 * random PHY ID when device is not soft resetted first. --lja
+	 */
+	genphy_soft_reset(phydev);
+}
+
+
+
+void r8169_hw_phy_pre_config_actions(struct rtl8169_private *tp, struct phy_device *phydev,
+					enum mac_version ver)
+{
+	static const rtl_phy_cfg_fct phy_pre_config_actions[] = {
+		/* PCI devices. */
+		[RTL_GIGA_MAC_VER_02] = NULL,
+		[RTL_GIGA_MAC_VER_03] = NULL,
+		[RTL_GIGA_MAC_VER_04] = NULL,
+		[RTL_GIGA_MAC_VER_05] = NULL,
+		[RTL_GIGA_MAC_VER_06] = NULL,
+		/* PCI-E devices. */
+		[RTL_GIGA_MAC_VER_07] = NULL,
+		[RTL_GIGA_MAC_VER_08] = NULL,
+		[RTL_GIGA_MAC_VER_09] = NULL,
+		[RTL_GIGA_MAC_VER_10] = NULL,
+		[RTL_GIGA_MAC_VER_11] = NULL,
+		[RTL_GIGA_MAC_VER_12] = NULL,
+		[RTL_GIGA_MAC_VER_13] = NULL,
+		[RTL_GIGA_MAC_VER_14] = NULL,
+		[RTL_GIGA_MAC_VER_15] = NULL,
+		[RTL_GIGA_MAC_VER_16] = NULL,
+		[RTL_GIGA_MAC_VER_17] = NULL,
+		[RTL_GIGA_MAC_VER_18] = NULL,
+		[RTL_GIGA_MAC_VER_19] = NULL,
+		[RTL_GIGA_MAC_VER_20] = NULL,
+		[RTL_GIGA_MAC_VER_21] = NULL,
+		[RTL_GIGA_MAC_VER_22] = NULL,
+		[RTL_GIGA_MAC_VER_23] = NULL,
+		[RTL_GIGA_MAC_VER_24] = NULL,
+		[RTL_GIGA_MAC_VER_25] = rtl8168d_hw_phy_pre_config_actions,
+		[RTL_GIGA_MAC_VER_26] = rtl8168d_hw_phy_pre_config_actions,
+		[RTL_GIGA_MAC_VER_27] = rtl8168d_hw_phy_pre_config_actions,
+		[RTL_GIGA_MAC_VER_28] = rtl8168d_hw_phy_pre_config_actions,
+		[RTL_GIGA_MAC_VER_29] = NULL,
+		[RTL_GIGA_MAC_VER_30] = NULL,
+		[RTL_GIGA_MAC_VER_31] = NULL,
+		[RTL_GIGA_MAC_VER_32] = NULL,
+		[RTL_GIGA_MAC_VER_33] = NULL,
+		[RTL_GIGA_MAC_VER_34] = NULL,
+		[RTL_GIGA_MAC_VER_35] = NULL,
+		[RTL_GIGA_MAC_VER_36] = NULL,
+		[RTL_GIGA_MAC_VER_37] = NULL,
+		[RTL_GIGA_MAC_VER_38] = NULL,
+		[RTL_GIGA_MAC_VER_39] = NULL,
+		[RTL_GIGA_MAC_VER_40] = NULL,
+		[RTL_GIGA_MAC_VER_41] = NULL,
+		[RTL_GIGA_MAC_VER_42] = NULL,
+		[RTL_GIGA_MAC_VER_43] = NULL,
+		[RTL_GIGA_MAC_VER_44] = NULL,
+		[RTL_GIGA_MAC_VER_45] = NULL,
+		[RTL_GIGA_MAC_VER_46] = NULL,
+		[RTL_GIGA_MAC_VER_47] = NULL,
+		[RTL_GIGA_MAC_VER_48] = NULL,
+		[RTL_GIGA_MAC_VER_49] = NULL,
+		[RTL_GIGA_MAC_VER_50] = NULL,
+		[RTL_GIGA_MAC_VER_51] = NULL,
+		[RTL_GIGA_MAC_VER_52] = NULL,
+		[RTL_GIGA_MAC_VER_60] = NULL,
+		[RTL_GIGA_MAC_VER_61] = NULL,
+	};
+
+	if (phy_pre_config_actions[ver])
+		phy_pre_config_actions[ver](tp, phydev);
+}
+
+
 void r8169_hw_phy_config(struct rtl8169_private *tp, struct phy_device *phydev,
 			 enum mac_version ver)
 {
@@ -1303,6 +1381,8 @@ void r8169_hw_phy_config(struct rtl8169_private *tp, struct phy_device *phydev,
 		[RTL_GIGA_MAC_VER_60] = rtl8125_1_hw_phy_config,
 		[RTL_GIGA_MAC_VER_61] = rtl8125_2_hw_phy_config,
 	};
+	
+	r8169_hw_phy_pre_config_actions(tp, phydev);
 
 	if (phy_configs[ver])
 		phy_configs[ver](tp, phydev);
diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c
index 66b8c61ca74c..b170185a1ed1 100644
--- a/drivers/net/phy/phy-core.c
+++ b/drivers/net/phy/phy-core.c
@@ -151,6 +151,25 @@ static const struct phy_setting settings[] = {
 };
 #undef PHY_SETTING
 
+#ifdef DEBUG
+#define R8169_ATTACHED_PRINTK \
+	printk("Phy is attached check %s @ %d: %d\n", \
+	__FUNC__, __LINE__, is_attached_check);
+
+#else
+#define R8169_ATTACHED_PRINTK
+#endif
+
+#define PHY_NOT_ATTACHED_CHECK \
+	{ \
+		void *attached_dev_ptr = (phydev) ? phydev->attached_dev : NULL; \
+		int is_attached_check = (attached_dev_ptr != NULL) && \
+                                ((phydev) && (phydev->state >= PHY_READY)); \
+		R8169_ATTACHED_PRINTK \
+		if (! is_attached_check ) return -EOPNOTSUPP; \
+	};
+
+
 /**
  * phy_lookup_setting - lookup a PHY setting
  * @speed: speed to match
@@ -457,6 +476,9 @@ int phy_read_mmd(struct phy_device *phydev, int devad, u32 regnum)
 {
 	int ret;
 
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
+
 	phy_lock_mdio_bus(phydev);
 	ret = __phy_read_mmd(phydev, devad, regnum);
 	phy_unlock_mdio_bus(phydev);
@@ -479,6 +501,9 @@ int __phy_write_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val)
 {
 	int ret;
 
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
+
 	if (regnum > (u16)~0 || devad > 32)
 		return -EINVAL;
 
@@ -518,6 +543,9 @@ int phy_write_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val)
 {
 	int ret;
 
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
+    
 	phy_lock_mdio_bus(phydev);
 	ret = __phy_write_mmd(phydev, devad, regnum, val);
 	phy_unlock_mdio_bus(phydev);
@@ -543,6 +571,10 @@ int phy_modify_changed(struct phy_device *phydev, u32 regnum, u16 mask, u16 set)
 {
 	int ret;
 
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
+
+    
 	phy_lock_mdio_bus(phydev);
 	ret = __phy_modify_changed(phydev, regnum, mask, set);
 	phy_unlock_mdio_bus(phydev);
@@ -587,6 +619,9 @@ int phy_modify(struct phy_device *phydev, u32 regnum, u16 mask, u16 set)
 {
 	int ret;
 
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
+    
 	phy_lock_mdio_bus(phydev);
 	ret = __phy_modify(phydev, regnum, mask, set);
 	phy_unlock_mdio_bus(phydev);
@@ -613,6 +648,9 @@ int __phy_modify_mmd_changed(struct phy_device *phydev, int devad, u32 regnum,
 {
 	int new, ret;
 
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
+
 	ret = __phy_read_mmd(phydev, devad, regnum);
 	if (ret < 0)
 		return ret;
@@ -646,6 +684,10 @@ int phy_modify_mmd_changed(struct phy_device *phydev, int devad, u32 regnum,
 {
 	int ret;
 
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
+
+    
 	phy_lock_mdio_bus(phydev);
 	ret = __phy_modify_mmd_changed(phydev, devad, regnum, mask, set);
 	phy_unlock_mdio_bus(phydev);
@@ -671,6 +713,9 @@ int __phy_modify_mmd(struct phy_device *phydev, int devad, u32 regnum,
 {
 	int ret;
 
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
+
 	ret = __phy_modify_mmd_changed(phydev, devad, regnum, mask, set);
 
 	return ret < 0 ? ret : 0;
@@ -694,6 +739,9 @@ int phy_modify_mmd(struct phy_device *phydev, int devad, u32 regnum,
 {
 	int ret;
 
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
+    
 	phy_lock_mdio_bus(phydev);
 	ret = __phy_modify_mmd(phydev, devad, regnum, mask, set);
 	phy_unlock_mdio_bus(phydev);
@@ -704,7 +752,11 @@ EXPORT_SYMBOL_GPL(phy_modify_mmd);
 
 static int __phy_read_page(struct phy_device *phydev)
 {
-	if (WARN_ONCE(!phydev->drv->read_page, "read_page callback not available, PHY driver not loaded?\n"))
+
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
+
+	if (WARN(!phydev->drv->read_page, "read_page callback not available, PHY driver not loaded?\n"))
 		return -EOPNOTSUPP;
 
 	return phydev->drv->read_page(phydev);
@@ -712,12 +764,16 @@ static int __phy_read_page(struct phy_device *phydev)
 
 static int __phy_write_page(struct phy_device *phydev, int page)
 {
-	if (WARN_ONCE(!phydev->drv->write_page, "write_page callback not available, PHY driver not loaded?\n"))
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
+
+	if (WARN(!phydev->drv->write_page, "write_page callback not available, PHY driver not loaded?\n"))
 		return -EOPNOTSUPP;
 
 	return phydev->drv->write_page(phydev, page);
 }
 
+
 /**
  * phy_save_page() - take the bus lock and save the current page
  * @phydev: a pointer to a &struct phy_device
@@ -728,7 +784,11 @@ static int __phy_write_page(struct phy_device *phydev, int page)
  */
 int phy_save_page(struct phy_device *phydev)
 {
-	phy_lock_mdio_bus(phydev);
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
+
+
+    phy_lock_mdio_bus(phydev);
 	return __phy_read_page(phydev);
 }
 EXPORT_SYMBOL_GPL(phy_save_page);
@@ -748,7 +808,10 @@ int phy_select_page(struct phy_device *phydev, int page)
 {
 	int ret, oldpage;
 
-	oldpage = ret = phy_save_page(phydev);
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
+
+    oldpage = ret = phy_save_page(phydev);
 	if (ret < 0)
 		return ret;
 
@@ -782,6 +845,9 @@ int phy_restore_page(struct phy_device *phydev, int oldpage, int ret)
 {
 	int r;
 
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
+
 	if (oldpage >= 0) {
 		r = __phy_write_page(phydev, oldpage);
 
@@ -812,6 +878,9 @@ EXPORT_SYMBOL_GPL(phy_restore_page);
 int phy_read_paged(struct phy_device *phydev, int page, u32 regnum)
 {
 	int ret = 0, oldpage;
+    
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
 
 	oldpage = phy_select_page(phydev, page);
 	if (oldpage >= 0)
@@ -834,6 +903,10 @@ int phy_write_paged(struct phy_device *phydev, int page, u32 regnum, u16 val)
 {
 	int ret = 0, oldpage;
 
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
+
+    
 	oldpage = phy_select_page(phydev, page);
 	if (oldpage >= 0)
 		ret = __phy_write(phydev, regnum, val);
@@ -856,6 +929,9 @@ int phy_modify_paged_changed(struct phy_device *phydev, int page, u32 regnum,
 			     u16 mask, u16 set)
 {
 	int ret = 0, oldpage;
+    
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
 
 	oldpage = phy_select_page(phydev, page);
 	if (oldpage >= 0)
@@ -878,7 +954,12 @@ EXPORT_SYMBOL(phy_modify_paged_changed);
 int phy_modify_paged(struct phy_device *phydev, int page, u32 regnum,
 		     u16 mask, u16 set)
 {
-	int ret = phy_modify_paged_changed(phydev, page, regnum, mask, set);
+	int ret = -1;
+
+	/* If not attached, do nothing. */
+	PHY_NOT_ATTACHED_CHECK;
+
+	ret = phy_modify_paged_changed(phydev, page, regnum, mask, set);
 
 	return ret < 0 ? ret : 0;
 }
-- 
2.26.2

@philm i'm collecting now maintainer comments and improve accordingly.

1 Like

added , from Lja

Ok, i've pin pointed error what it is: First time, the card is detected as

touko 02 23:19:32 MinistryOfSillyWalk kernel: r8169 0000:02:00.0 eth0: RTL8168d/8111d, 00:24:1d:12:e6:4a, XID 281, IRQ 28
touko 02 23:19:32 MinistryOfSillyWalk kernel: r8169 0000:02:00.0 eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]
touko 02 23:19:32 MinistryOfSillyWalk kernel: r8169 0000:02:00.0: RT 0 & RC 0
touko 02 23:19:32 MinistryOfSillyWalk kernel: r8169 0000:02:00.0: PHY version: 0xc1071002
touko 02 23:19:32 MinistryOfSillyWalk kernel: r8169 0000:02:00.0: MAC version: 23
touko 02 23:19:32 MinistryOfSillyWalk kernel: r8169 0000:02:00.0 eth0: Re-probeing? RC:0, RT: 0
touko 02 23:19:32 MinistryOfSillyWalk kernel: r8169 0000:02:00.0: Loop 0: 0
touko 02 23:19:32 MinistryOfSillyWalk kernel: r8169 0000:02:00.0: status_is_ok ... 0: 0
touko 02 23:19:32 MinistryOfSillyWalk kernel: r8169 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control
touko 02 23:19:32 MinistryOfSillyWalk kernel: libphy: r8169: probed
..
..
..
touko 02 23:19:57 MinistryOfSillyWalk kernel: Generic PHY r8169-200:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=r8169-200:00, irq=IGNORE)
touko 02 23:19:57 MinistryOfSillyWalk kernel: PHY_IS_ATTACHED_CHECK @ 614: 1
touko 02 23:19:57 MinistryOfSillyWalk kernel: PHY_IS_ATTACHED_CHECK @ 614: 1
touko 02 23:19:57 MinistryOfSillyWalk kernel: PHY_IS_ATTACHED_CHECK @ 900: 1
touko 02 23:19:57 MinistryOfSillyWalk kernel: PHY_IS_ATTACHED_CHECK @ 805: 1
touko 02 23:19:57 MinistryOfSillyWalk kernel: PHY_IS_ATTACHED_CHECK @ 781: 1
touko 02 23:19:57 MinistryOfSillyWalk kernel: PHY_IS_ATTACHED_CHECK @ 748: 1
touko 02 23:19:57 MinistryOfSillyWalk kernel: ------------[ cut here ]------------
touko 02 23:19:57 MinistryOfSillyWalk kernel: read_page callback not available, PHY driver not loaded?

Note the PHY driver is supposed to be generic, but the generic driver is missing read_page and write_page callbacks -> NOK NIC... when second time probed (rmmod&insmod done):

touko 02 23:21:21 MinistryOfSillyWalk kernel: r8169 0000:02:00.0: PHY version: 0x1cc912
touko 02 23:21:21 MinistryOfSillyWalk kernel: r8169 0000:02:00.0: MAC version: 23
touko 02 23:21:21 MinistryOfSillyWalk kernel: PHY_IS_ATTACHED_CHECK @ 614: 0
touko 02 23:21:21 MinistryOfSillyWalk kernel: r8169 0000:02:00.0: Loop 0 -> (0)
touko 02 23:21:21 MinistryOfSillyWalk kernel: PHY_IS_ATTACHED_CHECK @ 614: 0
touko 02 23:21:21 MinistryOfSillyWalk kernel: r8169 0000:02:00.0 enp2s0: renamed from eth0
touko 02 23:21:21 MinistryOfSillyWalk kernel: PHY_IS_ATTACHED_CHECK @ 614: 0
touko 02 23:21:21 MinistryOfSillyWalk kernel: PHY_IS_ATTACHED_CHECK @ 614: 1
touko 02 23:21:21 MinistryOfSillyWalk kernel: RTL8211B Gigabit Ethernet r8169-200:00: attached PHY driver [RTL8211B Gigabit Ethernet] (mii_bus:phy_addr=r8169-200:00, irq=IGNORE)
touko 02 23:21:21 MinistryOfSillyWalk kernel: PHY_IS_ATTACHED_CHECK @ 614: 1
touko 02 23:21:21 MinistryOfSillyWalk kernel: PHY_IS_ATTACHED_CHECK @ 614: 1
touko 02 23:21:21 MinistryOfSillyWalk kernel: PHY_IS_ATTACHED_CHECK @ 900: 1
touko 02 23:21:21 MinistryOfSillyWalk kernel: PHY_IS_ATTACHED_CHECK @ 805: 1
touko 02 23:21:21 MinistryOfSillyWalk kernel: PHY_IS_ATTACHED_CHECK @ 781: 1
touko 02 23:21:21 MinistryOfSillyWalk kernel: PHY_IS_ATTACHED_CHECK @ 748: 1
touko 02 23:21:21 MinistryOfSillyWalk kernel: ------------[ cut here ]------------
touko 02 23:21:21 MinistryOfSillyWalk kernel:  phy RD Supported
touko 02 23:21:21 MinistryOfSillyWalk kernel: WARNING: CPU: 2 PID: 792 at drivers/net/phy/phy-core.c:753 phy_save_page+0xc1/0xe3 [libphy]
touko 02 23:21:21 MinistryOfSillyWalk kernel: Modules linked in: r8169(+) realtek libphy fuse rfcomm cmac algif_hash algif_skcipher af_alg bnep btusb btrtl btbcm btintel bluetooth ecdh_generic uvcvideo rfkill ecc snd_usb_audio videobuf2_vmalloc snd_usbmidi_lib videobuf2_memops videobuf2_v4l2 videobuf2_common snd_rawmidi videodev snd_seq_device mc mousedev input_leds joydev squashfs loop amdgpu gpu_sched i2c_algo_bit ttm drm_kms_helper cec rc_core drm agpgart syscopyarea edac_mce_amd sysfillrect kvm_amd snd_hda_codec_realtek ccp snd_hda_codec_generic sysimgblt ledtrig_audio fb_sys_fops snd_hda_codec_hdmi snd_hda_intel rng_core snd_intel_dspcfg kvm snd_hda_codec ppdev snd_hda_core irqbypass snd_hwdep snd_pcm snd_timer snd sp5100_tco parport_pc soundcore parport wmi_bmof pcspkr evdev mac_hid i2c_piix4 k10temp acpi_cpufreq uinput crypto_user ip_tables x_tables hid_generic usbhid hid ohci_pci virtio_net net_failover failover firewire_ohci firewire_core crc_itu_t pata_atiixp sr_mod cdrom ehci_pci ehci_hcd ohci_hcd ata_generic
touko 02 23:21:21 MinistryOfSillyWalk kernel:  pata_acpi pata_jmicron wmi floppy [last unloaded: libphy]

Voila: the NIC may use 'wrong' driver, but it works ok, i'm writting this text on a linux that runs modified kernel. what is missing is phy driver specification.
[/quote]

1 Like

The Solution fix updated to R8168 - kernel 5.6.3 driver broken

@tbg i think that the solution i provide, is not one to go to mainstream kernel, cause it needs user-land configuration. Is it possible still to make into some Manjaro release ?

@philm can be this add as a patch ?

Fixed refresh network ordering cycle, now it works automatically.

1 Like

Forum kindly sponsored by