Skip to content

Conversation

@zhugengyu
Copy link

@zhugengyu zhugengyu commented Jul 8, 2025

This PR is to fix cpu frequency scaling in some arm64 platform

1): the current acpi_pcc.c do not handle for reg->BitWidth = 32 case,therefore some arm64 platform failed with Data aligment abort when init cppc
2): the current acpi_pcc.c mis-use mask when write new cpu freq into pcc channel

static ACPI_STATUS
pcc_send_command(struct pcc_subspace *ss, ACPI_GENERIC_ADDRESS *reg,
    uint32_t command, int flags, ACPI_INTEGER val)
{
  ...
	if ((flags & PCC_WRITE) != 0) {
		mask = __BITS(reg->BitOffset + reg->BitWidth - 1,
			      reg->BitOffset);
		ACPI_MOVE_64_TO_64(&tmp, data + reg->Address);
		tmp &= mask; // shall be 'tmp &= ~mask;' here
		tmp |= __SHIFTIN(val, mask);
		ACPI_MOVE_64_TO_64(data + reg->Address, &tmp);
	}
}
  • I verify the code in my ARM64 pc with ubench before and after cpu-freq scale
  • My build is
./build.sh -U -u -j12 -O /usr/obj.aarch64 -m evbarm -a aarch64 release
  • My test platform is
arm64# uname -a
NetBSD arm64 10.1_STABLE NetBSD 10.1_STABLE (GENERIC64) #14: Tue Jul  8 06:26:17 CST 2025
  • cpu-freq scale

image

  • scale freq to 2500MHz
    image

  • scale freq to 625MHz
    image

  • before change the code, my ARM64 PC would failed to boot when acpi_cppc is enabled

163bb6486ca06e03fd1f30d1d89a768

netbsd-srcmastr pushed a commit that referenced this pull request Oct 17, 2025
	usr.bin/calendar/calendars/calendar.christian: revision 1.15
	usr.bin/calendar/calendars/calendar.holiday: revision 1.36
	usr.bin/calendar/calendars/calendar.usholiday: revision 1.13
	usr.bin/calendar/calendars/calendar.netbsd: revision 1.52
	usr.bin/calendar/calendars/calendar.judaic: revision 1.13

- adjust dates of floating holidays for 2026
- correct and add missing release dates of NetBSD
  - taken from https://www.NetBSD.org/releases/formal.html#history
netbsd-srcmastr pushed a commit that referenced this pull request Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant