lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240614-ls3k-mips-v1-7-7614340ace7d@flygoat.com>
Date: Fri, 14 Jun 2024 16:40:15 +0100
From: Jiaxun Yang <jiaxun.yang@...goat.com>
To: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, 
 Conor Dooley <conor+dt@...nel.org>, 
 Thomas Bogendoerfer <tsbogend@...ha.franken.de>, 
 Qing Zhang <zhangqing@...ngson.cn>, Binbin Zhou <zhoubinbin@...ngson.cn>, 
 Huacai Chen <chenhuacai@...nel.org>
Cc: devicetree@...r.kernel.org, linux-mips@...r.kernel.org, 
 linux-kernel@...r.kernel.org, Jiaxun Yang <jiaxun.yang@...goat.com>, 
 stable@...r.kernel.org
Subject: [PATCH 07/10] platform: mips: cpu_hwmon: Disable driver on
 unsupported hardware

cpu_hwmon is unsupported on CPUs without loongson_chiptemp
register and csr.

Cc: stable@...r.kernel.org
Signed-off-by: Jiaxun Yang <jiaxun.yang@...goat.com>
---
 drivers/platform/mips/cpu_hwmon.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/platform/mips/cpu_hwmon.c b/drivers/platform/mips/cpu_hwmon.c
index d8c5f9195f85..2ac2f31090f9 100644
--- a/drivers/platform/mips/cpu_hwmon.c
+++ b/drivers/platform/mips/cpu_hwmon.c
@@ -139,6 +139,9 @@ static int __init loongson_hwmon_init(void)
 		csr_temp_enable = csr_readl(LOONGSON_CSR_FEATURES) &
 				  LOONGSON_CSRF_TEMP;
 
+	if (!csr_temp_enable && !loongson_chiptemp[0])
+		return -ENODEV;
+
 	nr_packages = loongson_sysconf.nr_cpus /
 		loongson_sysconf.cores_per_package;
 

-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ