linux icon indicating copy to clipboard operation
linux copied to clipboard

loongson3_cpufreq 驱动加载失败

Open KatyushaScarlet opened this issue 1 year ago • 1 comments

分支:loongarch-next 加载驱动时输出:

insmod: ERROR: could not insert module drivers/cpufreq/loongson3_cpufreq.ko: Operation not permitted

出错位置:

static int configure_cpufreq_info(void)
{
	int ret;
	union smc_message msg;

	msg.cmd		= CMD_GET_VERSION;
	msg.extra	= 0;
	msg.complete	= 0;
	ret = do_service_request(&msg);
	if (ret < 0 || msg.val < 0x1)
		return -EPERM;
......

此处 msg.val 返回值为0 假如注释该处,则出错位置如下:

......
	ret = cpufreq_register_driver(&loongson3_cpufreq_driver);
	if (ret)
		goto err;
......

此处 ret 返回值为-19

固件中的 DVFS 功能是开启的。 固件版本与相关信息如下:

# dmidecode 3.6
Getting SMBIOS data from sysfs.
SMBIOS 3.2.0 present.
Table at 0xFE3B0000.

Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
	Vendor: Loongson
	Version: Loongson-UDK2018-V4.0.05132-beta10
	Release Date: 07/26/2023
	ROM Size: 4 MB
	Characteristics:
		PCI is supported
		BIOS is upgradeable
		Boot from CD is supported
		Selectable boot is supported
		BIOS ROM is socketed
		Serial services are supported (int 14h)
		USB legacy is supported
		UEFI is supported
	BIOS Revision: 4.0

Handle 0x0001, DMI type 1, 27 bytes
System Information
	Manufacturer: Loongson
	Product Name: Loongson-3A5000M-7A1000-Laptop-Eascs-L71
	Version: Not Specified
	Serial Number: Not Specified
	UUID: Not Present
	Wake-up Type: Power Switch
	SKU Number: Not Specified
	Family: Not Specified
......

KatyushaScarlet avatar Jun 15 '24 17:06 KatyushaScarlet

loongson3_cpufreq目前有两种方案,旧方案是4.19内核使用的方案,新方案是上游使用的方案。两种方案需要不同的固件,旧版固件只能使用旧方案,新版固件同时兼容内核的旧方案和新方案。

chenhuacai avatar Jun 23 '24 03:06 chenhuacai