kendryte / k230_sdk

Kendryte K230 SDK
BSD 2-Clause "Simplified" License
170 stars 38 forks source link

[Feature]: r8152 network interface does not come up with only Linux config #35

Closed negge closed 2 months ago

negge commented 11 months ago

Feature description

Using the k230_evb_only_linux_defconfig as a template, I created a k230_canmv_defconfig that is only Linux and uses all 512MB of memory.

However, no matter what I do I always get this error bringing up the network adapter when booting:

[    2.755204] usb 2-1: New USB device found, idVendor=0bda, idProduct=8152, bcdDevice=20.00
[    2.763408] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.770548] usb 2-1: Product: USB 10/100 LAN
[    2.774821] usb 2-1: Manufacturer: Realtek
[    2.778919] usb 2-1: SerialNumber: 000000000000
[    2.783665] mmc1: err:-110 ocr=0x0 
[    2.788434] r8152 2-1:1.0: Unknown version 0x08f0

Please add a full k230_canmv_only_linux_defconf that works with the Realtek USB hardware and boots up with eth0.

Want resolve what problem

No response

Anything else

No response

negge commented 11 months ago

I was able to get it working. There is a race condition in the r8152 driver bring up. If you reboot the machine over and over eventually it works. I was on faster storage and so it always failed.

This has been fixed in newer kernels (among many other bugs). Any chance of moving to a 6.6 (or later) kernel that has hwprobe()?

xiangbingj commented 11 months ago

I was able to get it working. There is a race condition in the r8152 driver bring up. If you reboot the machine over and over eventually it works. I was on faster storage and so it always failed.

This has been fixed in newer kernels (among many other bugs). Any chance of moving to a 6.6 (or later) kernel that has hwprobe()?

Thank you very much for providing the information. Considering the workload, it should not be moved to the 6.6 kernel, but we can refer to the 6.6 kernel to fix this bug.

negge commented 10 months ago

Just as an update, other folks who have the same K230 have tried backporting kernel patches for the r8152 network driver and are still seeing issues with it coming online:

10:36 < courmisch> well maybe someone should ping that bug to point out that the kernel fixes don't really address the problem 10:43 < courmisch> What I see is that backporting most (admittedly not all, since some of them depend on netdev API changes) seems to fix the immediate issue of "unknown version"... but the eth0 device just ends up in NO-CARRIER mode 10:44 < courmisch> TBH, I'm starting to suspect the USB controller is at fault, not the NIC

There is likely another issue than just missing kernel fixes for the r8152 driver.

xiangbingj commented 10 months ago

Just as an update, other folks who have the same K230 have tried backporting kernel patches for the r8152 network driver and are still seeing issues with it coming online:

10:36 < courmisch> well maybe someone should ping that bug to point out that the kernel fixes don't really address the problem 10:43 < courmisch> What I see is that backporting most (admittedly not all, since some of them depend on netdev API changes) seems to fix the immediate issue of "unknown version"... but the eth0 device just ends up in NO-CARRIER mode 10:44 < courmisch> TBH, I'm starting to suspect the USB controller is at fault, not the NIC

There is likely another issue than just missing kernel fixes for the r8152 driver. This bug is really puzzling. This bug doesn't appear every time. Have you tested it on the canmv development board? I cannot reproduce this bug on the canmv development board. I've only encountered this bug when using an external USB to Ethernet device. I once wondered if it was related to the USB to Ethernet hardware circuit. I think we can solve this bug based on more experiments.

wuwentao commented 2 months ago

please doule check with latest sdk code, this issue should be fixed. and we also not received any new response for a long time, so just close current issue.

if you found this issue still exist with latest code, you still can reopen current issue and continue report bug.

Thanks