MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.68k stars 491 forks source link

Odroid C1 | USB ports are not functional #7089

Open MichaIng opened 1 month ago

MichaIng commented 1 month ago

It has been enabled in Armbian for edge branch: https://github.com/armbian/build/pull/6559/files But it has no hot-plug detection, keyboard input misses keystrokes, boot takes longer an additional kernel errors show up: https://github.com/MichaIng/DietPi/issues/6332#issuecomment-2125957003

Enabling it in current branch seems to worsen those symptoms: https://github.com/MichaIng/DietPi/issues/6332#issuecomment-2127837112

A udev event loop seems to cause issues, probably the USB hub or device is repetitively disconnected and reconnected kernel-wise.

For now, we leave it disabled, until a fix for trouble-free USB usage has been found.

juanlufont commented 1 month ago

I will keep an eye on this issue and I will test new images when possible :+1:

MichaIng commented 3 weeks ago

@th2j Let's continue the topic here.

First of all, please try edge kernel. The PR at Armbian at least states, that it fixes the USB hub, but the same change did not work with current kernel branch:

apt install linux-{image,dtb}-edge-meson

I'll do a rebuild of the current kernel based on latest mainline Linux and Armbian patches + the config change from this PR. And also a rebuild of edge, just in case something has changed in mainline Linux in the meantime.

th2j commented 3 weeks ago

ok usb works now, thanks

this doesn't seem to be a problem, but i have new warnings from boot :

root@DietPi:~# journalctl -b -p warning juin 12 15:28:10 DietPi dhclient[326]: send_packet: No buffer space available juin 12 15:28:10 DietPi dhclient[326]: dhclient.c:2600: Failed to send 300 byte long packet over eth0 interface

MichaIng commented 3 weeks ago

Okay, please let me know whether there are any issues with your USB DAC, since @juanlufont reported missing keystrokes when using a USB keyboard.

Regarding your boot warnings: It is from the DHCP client. As long as you do have network/an IP address, it seems to have succeeded later, so you can ignore them. You can check the whole log of network bringup:

journalctl -u ifup@eth0

Nearly all Armbian kernel patches for the Odroid C1, are about fixing HDMI: https://github.com/armbian/build/tree/main/patch/kernel/archive/meson-6.6

However, there have been quite a lot of commits in mainline Linux in the meantime: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/log/drivers/gpu/drm/meson/meson_drv.c?h=linux-6.6.y

Armbian patches are not regularly revisited, especially for SBCs which have no Armbian maintainer (like Odroid C1), are often many years old, just ported from one Linux version to the next. I could hence imagine that most or all of these patches are obsolete, and probably conflicting. Would not have been the first time. If one of your guys is open to test a few things, I would generate new kernel builds with all these patches removed, to see whether this does not break HDMI output, and probably even fixes USB support on Linux 6.6.

th2j commented 3 weeks ago

i can test it but i am not an expert

Le mer. 12 juin 2024 à 17:11, MichaIng @.***> a écrit :

Okay, please let me know whether there are any issues with your USB DAC, since @juanlufont https://github.com/juanlufont reported missing keystrokes when using a USB keyboard.

Regarding your boot warnings: It is from the DHCP client. As long as you do have network/an IP address, it seems to have succeeded later, so you can ignore them. You can check the whole log of network bringup:

journalctl -u @.***


Nearly all Armbian kernel patches for the Odroid C1, are about fixing HDMI: https://github.com/armbian/build/tree/main/patch/kernel/archive/meson-6.6

However, there have been quite a lot of commits in mainline Linux in the meantime: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/log/drivers/gpu/drm/meson/meson_drv.c?h=linux-6.6.y

Armbian patches are not regularly revisited, especially for SBCs which have no Armbian maintainer (like Odroid C1), are often many years old, just ported from one Linux version to the next. I could hence imagine that most or all of these patches are obsolete, and probably conflicting. Would not have been the first time. If one of your guys is open to test a few things, I would generate new kernel builds with all these patches removed, to see whether this does not break HDMI output, and probably even fixes USB support on Linux 6.6.

— Reply to this email directly, view it on GitHub https://github.com/MichaIng/DietPi/issues/7089#issuecomment-2163289639, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASDV3R7RACRCIUYULHRIDFTZHBQJ3AVCNFSM6AAAAABIJX5JM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRTGI4DSNRTHE . You are receiving this because you were mentioned.Message ID: @.***>

MichaIng commented 3 weeks ago

Do you have a way to edit the content of this drive from another system, just in case it breaks something? Since you have the edge kernel installed, that one will remain on the system, but some symlinks in /boot need to be altered to point back to the edge kernel/dtb/initramfs, if something happens.

However, here the "current" kernel build with Armbian patches removed, hence unmodified mainline Linux 6.6.y:

cd /tmp
wget https://dietpi.com/downloads/binaries/testing/linux-{dtb,image}-current-meson.deb
dpkg -i linux-{dtb,image}-current-meson.deb
reboot
th2j commented 3 weeks ago

it doesn't boot, i will reinstall from scratch, i don't know how to manually switch to the old kernel

MichaIng commented 3 weeks ago

it doesn't boot

That is weird. You mean it does not boot at all, or is there just no HDMI output? Because, as said, most of the Armbian patches are around enabling HDMI, which was at least broken in mainline Linux for some years.

i don't know how to manually switch to the old kernel

As said, there are 3 symlinks in /boot: Image (pointing to vmlinuz-*), dtb (pointing to dtb-*) and uInitrd (pointing to uInitrd-*), which should currently all point to the 6.6.x version. You need to recreated those symlinks to point to the 6.8.x version, to "revert" to the functional edge kernel.

MichaIng commented 3 weeks ago

I also generated newer edge kernel builds. So @juanlufont, if you want to test whether these enhance USB support in your case:

cd /tmp
wget https://dietpi.com/downloads/binaries/testing/linux-{dtb,image}-edge-meson.deb
dpkg -i linux-{dtb,image}-edge-meson.deb
reboot

I want to apply the reboot fix to all existing C1 users, lifting the hold on kernel packages, but of course we cannot do so, when this breaks USB instead. So would be good to know whether the edge kernel solves both, in which case I would apply that one instead. Since we control package releases ourselves now, shipping edge kernel builds is not such an issue anymore. Previously, using the Armbian repo, it was always a higher risk that any edge kernel upgrade breaks things, because it is pretty untested.

juanlufont commented 3 weeks ago

@MichaIng I will test it this weekend

th2j commented 3 weeks ago

it doesn't boot

That is weird. You mean it does not boot at all, or is there just no HDMI output? Because, as said, most of the Armbian patches are around enabling HDMI, which was at least broken in mainline Linux for some years.

i don't know how to manually switch to the old kernel

As said, there are 3 symlinks in /boot: Image (pointing to vmlinuz-*), dtb (pointing to dtb-*) and uInitrd (pointing to uInitrd-*), which should currently all point to the 6.6.x version. You need to recreated those symlinks to point to the 6.8.x version, to "revert" to the functional edge kernel.

It does't boot at all, I reinstall from scratch. The usb wasn't working so i updated to edge and it works now. Reboot is also ok

In /boot, i don't see the symlink :

root@DietPi:~# ls -l /boot total 33980 -rwxr-xr-x 1 root root 3274 12 mai 23:14 boot.ini -rwxr-xr-x 1 root root 205117 25 mai 17:28 config-6.8.11-edge-meson drwxr-xr-x 4 root root 4096 13 juin 13:21 dietpi -rwxr-xr-x 1 root root 18092 12 mai 22:00 dietpi-LICENSE.txt -rwxr-xr-x 1 root root 16059 12 mai 22:00 dietpi-README.md -rwxr-xr-x 1 root root 17865 13 juin 14:36 dietpi.txt -rwxr-xr-x 1 root root 3950 12 mai 23:12 dietpi-wifi.txt drwxr-xr-x 2 root root 2048 13 juin 13:58 dtb -rwxr-xr-x 1 root root 6395385 13 juin 13:01 initrd.img-6.6.32-current-meson -rwxr-xr-x 1 root root 6398149 13 juin 13:59 initrd.img-6.8.11-edge-meson -rwxr-xr-x 1 root root 4422658 25 mai 17:28 System.map-6.8.11-edge-meson -rwxr-xr-x 1 root root 10900032 25 mai 17:28 uImage -rwxr-xr-x 1 root root 6398213 13 juin 13:59 uInitrd

MichaIng commented 3 weeks ago

It does't boot at all

Crazy that mainline Linux support is then completely broken. Would be interesting to see UART/serial console output. Aside of HDMI support, two Armbian patches revert each an upstream commit, regarding PWM and clock speeds. Maybe those are strictly required. However, let's not waste too much time with this.

In /boot, i don't see the symlink

Oh right, it has a dedicated boot FAT partition, hence no symlinks. In this case, we move/rename the files/dirs, so reverting is not possible 🤔. I think we should copy them instead, to allow switching back and forth between installed kernel versions. The Odroid C1 is however literally the only left SBC where this is the case/still needed 😄. EDIT: Ah, outside of our control, respectively would need to be changed in the Armbian build system. Not worth the efforts for a single old SBC.

Okay, focusing on edge kernel, then the only left thing would be to have some more tests results about USB stability, i.e. whether e.g. the new build (Linux 6.9 already) fixes the missing keystrokes issue.

MichaIng commented 4 days ago

I just pushed new kernel builds to our APT server, including "current" ones based on latest upstream with CONFIG_USB_ONBOARD_HUB=y. Could someone give those a last try, so see whether by any chance this works now as well with "current" Linux 6.6?

If not, especially @juanlufont could you give the "edge" ones another try, to see whether those provide stable USB support for you now as well? I'd in case create fresh images with edge kernel for now, and migrate all existing Odroid C1 system to that one, to avoid a regression when upgrading from the old Linux 6.1 kernel, where USB was still working.