1

Booting up Ubuntu 24.04 spends a very long time (around two minutes) while apparently detecting various USB devices of my MacBookPro7,1 (mid-2010 13").

I have tried to identify the devices printed out during this slow process and attempted to disable their detection and load, by adding their blacklist designations to /etc/modprobe.d/blacklist entries, but that did not change the behaviour I see. After adding to the blacklist, I recreated the initrd with sudo initramfs -u and then hardware-rebooted.

Here's the video of a boot-up before making any changes: https://youtu.be/_RnZXyePNfw

Here's the video of a boot-up after blacklisting appleir, appleir_hid, ohci-pci, ohci-firewire and ohci: https://www.youtube.com/watch?v=tBt5mqwwOCo

As you can see, my change actually made the boot process slower. So, maybe that wasn't a good guess. In the initial video after the hang releases, you can see an error message about the the "tsc" clocksource unstable because of a detected clock skew. Whereas, after my change you can see a new message, where it says "workqueue: hub_event hogged CPU for >10000us 4 times, consider switching to WQ_UNBOUND"

I do not understand whether either of these messages are something that I can recover from as an installer/user.

Running systemd-analyze simply tells me that the kernel took 4.7s to start.

Jack Z.
  • 193

3 Answers3

8

I too had this problem on MacBookPro7,1 under 22.04.5 LTS. For me it did not become untenable until kernel 6.8.0-45. USB device discovery took many minutes, with warnings about "hub_event hogged CPU". That was a red herring, however. The real clue was discovered by disabling quiet and splash and observing that device discovery became fast again, once the kernel announced:

kernel: clocksource: Switched to clocksource hpet

Adding this kernel flag fixed it for me: clocksource=hpet

Update: this did indeed also work as alternative, and results in even less kernel chatter/complaint: tsc=unstable

Cheers

whorfin
  • 96
1

I have the same issue and also on MacBookPro7,1.

It seems to be a regression/bug in the kernel, because, if I downgrade the kernel that comes with Ubuntu 24.04 - currently v. 6.8.0-39 - to the latest Ubuntu mainline LTS kernel - currently v. 6.6.42 - then the problem goes away. And, at least on my MacBookPro7,1, this older kernel seems to work fine.

An article explaining how to install and use a nice GUI to install and manage Ubuntu mainline kernels

Alternatively, you can download and install Ubuntu mainline kernels manually like this (for v. 6.6.42):

  1. Download the 4 .deb files from https://kernel.ubuntu.com/mainline/v6.6.42/amd64/
  2. cd ~/Downloads/
  3. sudo apt install ./linux-headers-6.6.42-060642_6.6.42-060642.202407250837_all.deb
  4. sudo apt install ./linux-headers-6.6.42-060642-generic_6.6.42-060642.202407250837_amd64.deb
  5. sudo apt install ./linux-modules-6.6.42-060642-generic_6.6.42-060642.202407250837_amd64.deb
  6. sudo apt install ./linux-image-unsigned-6.6.42-060642-generic_6.6.42-060642.202407250837_amd64.deb

The order in which you install these .deb files matters, because they depend on each other, but it's no big deal if you get it wrong - apt will fail and tell you about the missing dependency.

You can see all available Ubuntu mainline kernels here: https://kernel.ubuntu.com/mainline/.

You can see which kernels are LTS and which aren't on the official website of the Linux kernel - https://www.kernel.org/ - or on https://en.wikipedia.org/wiki/Linux_kernel_version_history.

And, yes, I've checked, the problem is already present in 6.8.0 (i.e. 6.8), so they must have introduced it either in 6.8.0 or in 6.7.x. And, yes, unfortunately, the problem is still there in 6.9.9.

What I don't know how to do is make Grub load a different kernel by default - for me, it always seems to default to the kernel with the highest version number - but the good thing is that, if you can get the Grub menu to show up at boot-time, you can choose which kernel to use from this menu whenever you boot.

To force the Grub menu to appear on our MacBookPro7,1, see How to get the GRUB menu to show up at boot-time in Ubuntu 24.04 and/or 22.04 on MacBookPro7,1 (mid-2010 13")

Jack Z.
  • 193
-1

Solution to this was to try earlier Ubuntu releases. I replaced with Elementary Linux 7.1. Problem solved for now!

https://linux-hardware.org/?probe=cbccdbbf42