[SRU] Bump unmatched CPU clock rate to 1.2 GHz

Bug #1941622 reported by Dimitri John Ledkov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
u-boot (Ubuntu)
Fix Released
Wishlist
Unassigned
Focal
Fix Released
Wishlist
Heinrich Schuchardt

Bug Description

[Impact]

Bump SiFive Unmatched CPU clock rate from 1.0 GHz to 1.2 GHz as used by upstream U-Boot.

This is the maximum frequency that according to SiFive is stable on all boards.

[Test Plan]

 * System with these patches boots, operates normally without overheating. CPU clock speed is increased form 1.0 GHz to 1.2 GHz.

[Where problems could occur]

 * Overheating, instability, panics. (Should not occur according to the board vendor)

[Other Info]

 * wgrant & multiple SiFive forum users report even 1.5 GHz to be stable

description: updated
no longer affects: linux-riscv (Ubuntu)
Revision history for this message
Heinrich Schuchardt (xypron) wrote :

The CPU clock rate is currently set in U-Boot SPL. SiFive said that there are boards that are unstable over 1.2 GHz. So raising to 1.5 GHz is not an option.

Currently the shut of temperature of the CPU is 108 °C. In the SiFive repo there is a patch for lowering this to 85°C. I would advise not to change the clock speed via the U-Boot dtb without adjusting the CPU temperature limit too.

$ sensors # from lm-sensors package
tmp451-i2c-0-4c
Adapter: i2c-ocores
M/B Temp: +46.1°C (low = +0.0°C, high = +85.0°C)
                       (crit = +85.0°C, hyst = +75.0°C)
CPU Temp: +48.2°C (low = +0.0°C, high = +85.0°C)
                       (crit = +108.0°C, hyst = +98.0°C)

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

The relevant U-Boot patch to change the CPU max temperature to 85 °C (in U-Boot) is here:

https://github.com/sifive/meta-sifive/blob/2021.08/recipes-bsp/u-boot/files/unmatched/0012-board-sifive-spl-Set-remote-thermal-of-TMP451-to-85-.patch

This patch has not been sent upstream yet.

For the HiFive Unleashed there is a patch series defining multiple operating points that has been rejected by upstream. I did not see the same for the HiFive Unmatched:

[PATCH 0/3] Dynamic CPU frequency switching for the HiFive
https://lore.kernel<email address hidden>/
https://github.com/sifive/meta-sifive/blob/2021.08/recipes-kernel/linux/files/0010-riscv-sifive-unleashed-define-opp-table-cpufreq.patch

Changed in u-boot (Ubuntu):
status: New → Won't Fix
Revision history for this message
Brian Murray (brian-murray) wrote : Proposed package upload rejected

An upload of u-boot to hirsute-proposed has been rejected from the upload queue for the following reason: "The changes uploaded included a lot more than just bumping the CPU clock rate. Additionally, the referenced bug has a status of Won't Fix.".

Revision history for this message
Heinrich Schuchardt (xypron) wrote : Re: Bump unmatched CPU clock rate to 1.5GHz

In commit 2113c0045c2a ("riscv: dts: add fu740 support") we have

   assigned-clock-rates = <1200000000>;

According to communication by SiFive this is the highest frequency that they can guarantee all boards to support.

u-boot-2021.01+dfsg uses

    assigned-clock-rates = <1001000000>;

Dave Jones (waveform)
Changed in u-boot (Ubuntu):
status: Won't Fix → In Progress
Revision history for this message
Heinrich Schuchardt (xypron) wrote :
Dave Jones (waveform)
Changed in u-boot (Ubuntu Focal):
status: New → In Progress
assignee: nobody → Heinrich Schuchardt (xypron)
summary: - Bump unmatched CPU clock rate to 1.5GHz
+ [SRU] Bump unmatched CPU clock rate to 1.5GHz
description: updated
tags: added: riscv64
summary: - [SRU] Bump unmatched CPU clock rate to 1.5GHz
+ [SRU] Bump unmatched CPU clock rate to 1.2 GHz
Revision history for this message
Heinrich Schuchardt (xypron) wrote :

To check that the patch has the desired effect I ran

    glpsol -m /usr/share/doc/glpk-utils/examples/tsp.mod

with different U-Boot versions and noted down the solution time:

1.0 GHz - 5.2 s - current Focal U-Boot version
1.2 GHz - 4.3 s - revised Focal U-Boot version
1.5 GHz - 3.5 s - my board works fine at 1.5 GHz

Mathew Hodson (mhodson)
Changed in u-boot (Ubuntu):
importance: Undecided → Wishlist
Changed in u-boot (Ubuntu Focal):
importance: Undecided → Wishlist
Revision history for this message
Heinrich Schuchardt (xypron) wrote :

~ubuntu-sru: please, review the SRU

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

Jammy uses a newer U-Boot version, where this problem is fixed.

Changed in u-boot (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

 $ dput u-boot_2021.01+dfsg-3ubuntu0\~20.04.4_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /tmp/pkgs/focal/u-boot_2021.01+dfsg-3ubuntu0~20.04.4_source.changes: Valid signature from 1E918B66765B3E31
Checking signature on .dsc
gpg: /tmp/pkgs/focal/u-boot_2021.01+dfsg-3ubuntu0~20.04.4.dsc: Valid signature from 1E918B66765B3E31
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading u-boot_2021.01+dfsg-3ubuntu0~20.04.4.dsc: done.
  Uploading u-boot_2021.01+dfsg-3ubuntu0~20.04.4.debian.tar.xz: done.
  Uploading u-boot_2021.01+dfsg-3ubuntu0~20.04.4_source.buildinfo: done.
  Uploading u-boot_2021.01+dfsg-3ubuntu0~20.04.4_source.changes: done.
Successfully uploaded packages.

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

The change looks good, but since I'm not familiar with these u-boot parts, I'd like to know the following before proceeding:

1) I assume this is a runtime change that happens after updating the u-boot packages on an installed SiFive drive, right? Does the change happen instantly after upgrade of the package? Or on next reboot?
2) The test case is not too clear about how one checks if the patch is in effect or not. How can one confirm that the effective CPU clock speed is now different? Is it just a matter of `cat /proc/cpuinfo`?

Can you please update the description with these clarifications?

Changed in u-boot (Ubuntu Focal):
status: In Progress → Incomplete
Revision history for this message
Heinrich Schuchardt (xypron) wrote :

>> 1) I assume this is a runtime change that happens after updating the u-boot
>> packages on an installed SiFive drive, right? Does the change happen instantly
>> after upgrade of the package? Or on next reboot?

The change is only visible after rebooting.

>> 2) The test case is not too clear about how one checks if the patch is in
>> effect or not. How can one confirm that the effective CPU clock speed is
>> now different? Is it just a matter of `cat /proc/cpuinfo`?

You can check that in U-Boot that the control device tree has the new setting:

fdt addr $fdtcontroladdr
fdt print

For measuring the actual speed I used package glpk-utils.

I measured the execution time of the command

glpsol -m /usr/share/doc/glpk-utils/examples/tsp.mod

I suggest to check both before and after upgrade.

Revision history for this message
Brian Murray (brian-murray) wrote :

The additional information in comment #11 (the need to reboot and how to check the speed of the device) should be added to the test plan in the bug description so that the bug is easier for anyone to follow. I'll go ahead and accept it anyway, but please update the bug description.

Changed in u-boot (Ubuntu Focal):
status: Incomplete → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Dimitri, or anyone else affected,

Accepted u-boot into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/u-boot/2021.01+dfsg-3ubuntu0~20.04.4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

SRU testing
===========

I have tested on an SiFive HiFive Unmatched board using a fully updated Focal server image on an SD card.

Before the new package:

U-Boot 2021.01+dfsg-3ubuntu0~20.04.3 (Jul 30 2021 - 14:38:17 +0000)
glpsol -m tsp.mod
Time used: 5.1 secs

With the new package:

https://launchpad.net/ubuntu/+source/u-boot/2021.01+dfsg-3ubuntu0~20.04.4/+build/22598935/+files/u-boot-sifive_2021.01+dfsg-3ubuntu0~20.04.4_riscv64.deb

U-Boot 2021.01+dfsg-3ubuntu0~20.04.4 (Sep 21 2021 - 15:55:38 +0000)
glpsol -m tsp.mod
Time used: 4.5 secs

The new U-Boot results in the expected speedup of programs.
The system runs stable.

Best regards

Heinrich

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package u-boot - 2021.01+dfsg-3ubuntu0~20.04.4

---------------
u-boot (2021.01+dfsg-3ubuntu0~20.04.4) focal; urgency=medium

  * Raise CPU frequency to 1.2 GHz as used in upstream U-Boot in
    d/p/0011-riscv-sifive-dts-fu740-Add-board-u-boot.dtsi-files.patch
    (LP: #1941622)

 -- Heinrich Schuchardt <email address hidden> Tue, 21 Sep 2021 17:55:38 +0200

Changed in u-boot (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for u-boot has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.