Naughty timer ACPI-safe, hangs on FreeBSD on Koolu

After updating the CVS tree from STABLE, rebuilding and reinstalling world and the kernel, I have found that:

  • boot hangs at DHCP discovery (dhclient), devd start-up, and one more place;
  • key repeating doesn’t work, you have to press a key every time;
  • the date doesn’t update;
  • you can’t restart or shut down.

All these have one thing in common: they happen when the counter doesn’t tick.

After noodling around for quite some time with the kernel config and make.conf, I finally understood this wasn’t the reason. See, the GENERIC kernel that kame with the FreeBSD 7.0 CD (and I backed that up after installing, right away) worked, and the GENERIC kernel re-compiled didn’t.

I thought it was related to the build tools. No, not.

Turned out it was the counter (timer). See, your system has several:

% sysctl kern.timecounter.choice
kern.timecounter.choice: TSC(800) ACPI-fast(1000) i8254(0) dummy(-1000000)
% sysctl kern.timecounter.hardware
kern.timecounter.hardware: ACPI-fast

Now, this stuff happened on a Koolu, and it had an ACPI-safe, quality 850, so that got chosen by default. Turned out it didn’t work.

You can do several things:

  • you can boot the same kernel without ACPI, just select the appropriate option;
  • or you can load it by hand:
    sudo sysctl kern.timecounter.hardware=TSC

  • or automatically – add this to /etc/sysctl.conf:
    (Make sure there are no quotes in the latter!)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: