Skip to contentSkip to conversation

add Via CHA ID to via-cputemp

PATCH Superseded René Rebe 2 participants 7 messages Nov 17, 2025

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

René Rebe

author
#0 lore raw

PATCH 1/1 add Via CHA ID to via-cputemp

Add Via CHA ID to via-cputemp to support reading that CPU temperature, too.

arch/x86/include/asm/cpu_device_id.h +1 -0
@@ -19,6 +19,7 @@
 #define X86_CENTAUR_FAM6_C7_A		0xa
 #define X86_CENTAUR_FAM6_C7_D		0xd
 #define X86_CENTAUR_FAM6_NANO		0xf
+#define X86_CENTAUR_FAM6_CHA		0x47
 
 #define X86_STEPPINGS(mins, maxs)    GENMASK(maxs, mins)
 /**
drivers/hwmon/via-cputemp.c +3 -1
@@ -134,7 +134,8 @@
 			data->msr_vid = 0x198;
 			break;
 		case 0xF:
-			/* Nano */
+		case 0x47:
+			/* Nano / CHA */
 			data->msr_temp = 0x1423;
 			break;
 		default:
@@ -273,6 +274,7 @@
 	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_C7_A,	NULL),
 	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_C7_D,	NULL),
 	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_NANO,	NULL),
+	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_CHA,	NULL),
 	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 7, X86_MODEL_ANY,		NULL),
 	{}
 };
Signature · 2 lines
  René Rebe, ExactCODE GmbH, Berlin, Germany
  https://exactco.de | https://t2linux.com | https://rene.rebe.de
maintainer
#1 lore raw
Quoted 4 lines · René Rebe

Add Via CHA ID to via-cputemp to support reading that CPU temperature, too.

checkpatch complains:

WARNING: From:/Signed-off-by: email name mismatch: 'From: Ren� Rebe <[email protected]>' != 'Signed-off-by: René Rebe <[email protected]>'

Patch subject should start with "hwmon: (via-cputemp)"

Your patch does not apply to the tip of the upstream kernel (v6.18-rc6). Please rebase before sending the next version.

Information available about "VIA Centaur CHA" suggests that the CPU was never released. You'll have to provide more context and explain why it would be necessary or even make sense to add support for it anyway.

arch/x86/include/asm/cpu_device_id.h line 22

Quoted 8 lines
arch/x86/include/asm/cpu_device_id.h +1 -0
@@ -19,6 +19,7 @@
  #define X86_CENTAUR_FAM6_C7_A		0xa
  #define X86_CENTAUR_FAM6_C7_D		0xd
  #define X86_CENTAUR_FAM6_NANO		0xf
+#define X86_CENTAUR_FAM6_CHA		0x47

I can not touch this code without Ack from x86 maintainers, but you did not copy the respective mailing list nor any x86 maintainers. This is especially necessary since the CPU was never released.

Quoted 16 lines
arch/x86/include/asm/cpu_device_id.h +0 -0
  #define X86_STEPPINGS(mins, maxs)    GENMASK(maxs, mins)
  /**
drivers/hwmon/via-cputemp.c +2 -1
@@ -134,7 +134,8 @@
  			data->msr_vid = 0x198;
  			break;
  		case 0xF:
-			/* Nano */
+		case 0x47:
+			/* Nano / CHA */
  			data->msr_temp = 0x1423;
  			break;
  		default:

drivers/hwmon/via-cputemp.c line 278

Quoted 5 lines
drivers/hwmon/via-cputemp.c +1 -0
@@ -273,6 +274,7 @@
  	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_C7_A,	NULL),
  	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_C7_D,	NULL),
  	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_NANO,	NULL),
+	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_CHA,	NULL),
  	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 7, X86_MODEL_ANY,		NULL),

The hard-coded numbers were changed to defines with commit 5cfc7ac7c1bf6 ("hwmon:
Convert to new X86 CPU match macros"). I don't know why that commit did not also change the case statement above. Either case, I'd suggest to either use defines everywhere or not at all.

Guenter

author
#2 lore raw

Hi,

Quoted 7 lines · Guenter Roeck
Quoted 3 lines · René Rebe

Add Via CHA ID to via-cputemp to support reading that CPU temperature, too.

Quoted 8 lines

checkpatch complains:

WARNING: From:/Signed-off-by: email name mismatch: 'From: Ren� Rebe <[email protected]>' != 'Signed-off-by: René Rebe <[email protected]>'

Patch subject should start with "hwmon: (via-cputemp)"

Your patch does not apply to the tip of the upstream kernel (v6.18-rc6). Please rebase before sending the next version.

ah my bad, it applied for years and the stable release, I should of course have tested it with latest git. I only work thru the hundreds of patches people complain I did not upstream.

Quoted 3 lines

Information available about "VIA Centaur CHA" suggests that the CPU was never released. You'll have to provide more context and explain why it would be necessary or even make sense to add support for it anyway.

Well they are popular enough that I have two and even this Linus Tech Tips YT channel got one, ...

I have no problem to keep it in https://t2linux.com <https://t2linux.com/> for fun, but I’m happy to rebase it if to document this last VIA CPU driver bits. Your call I guess.

René

Quoted 40 lines

arch/x86/include/asm/cpu_device_id.h 2025-10-07 17:12:32.812472408 +0200 line 22

Quoted 7 lines
arch/x86/include/asm/cpu_device_id.h 2025-10-07 17:12:32.812472408 +0200 renamed from arch/x86/include/asm/cpu_device_id.h 2025-10-07 17:07:15.564453320 +0200 +1 -0
@@ -19,6 +19,7 @@
 #define X86_CENTAUR_FAM6_C7_A 0xa
 #define X86_CENTAUR_FAM6_C7_D 0xd
 #define X86_CENTAUR_FAM6_NANO 0xf
+#define X86_CENTAUR_FAM6_CHA 0x47

I can not touch this code without Ack from x86 maintainers, but you did not copy the respective mailing list nor any x86 maintainers. This is especially necessary since the CPU was never released.

Quoted 15 lines
arch/x86/include/asm/cpu_device_id.h 2025-10-07 17:12:32.812472408 +0200 renamed from arch/x86/include/asm/cpu_device_id.h 2025-10-07 17:07:15.564453320 +0200 +0 -0
   #define X86_STEPPINGS(mins, maxs)    GENMASK(maxs, mins)
 /**
drivers/hwmon/via-cputemp.c 2025-10-07 17:53:55.232621776 +0200 renamed from drivers/hwmon/via-cputemp.c 2025-10-07 17:03:12.142438673 +0200 +2 -1
@@ -134,7 +134,8 @@
  data->msr_vid = 0x198;
  break;
  case 0xF:
- /* Nano */
+ case 0x47:
+ /* Nano / CHA */
  data->msr_temp = 0x1423;
  break;
  default:

drivers/hwmon/via-cputemp.c 2025-10-07 17:53:55.232621776 +0200 line 278

Quoted 5 lines
drivers/hwmon/via-cputemp.c 2025-10-07 17:53:55.232621776 +0200 renamed from drivers/hwmon/via-cputemp.c 2025-10-07 17:03:12.142438673 +0200 +1 -0
@@ -273,6 +274,7 @@
  X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_C7_A, NULL),
  X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_C7_D, NULL),
  X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_NANO, NULL),
+ X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_CHA, NULL),
  X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 7, X86_MODEL_ANY, NULL),

The hard-coded numbers were changed to defines with commit 5cfc7ac7c1bf6 ("hwmon:
Convert to new X86 CPU match macros"). I don't know why that commit did not also change the case statement above. Either case, I'd suggest to either use defines everywhere or not at all.

Guenter

Signature · 1 line
https://exactco.de - https://t2linux.com - https://rene.rebe.de
maintainer
#3 lore raw
Quoted 25 lines · René Rebe

Hi,

Quoted 7 lines · Guenter Roeck
Quoted 3 lines · René Rebe

Add Via CHA ID to via-cputemp to support reading that CPU temperature, too.

Quoted 8 lines

checkpatch complains:

WARNING: From:/Signed-off-by: email name mismatch: 'From: Ren� Rebe <[email protected]>' != 'Signed-off-by: René Rebe <[email protected]>'

Patch subject should start with "hwmon: (via-cputemp)"

Your patch does not apply to the tip of the upstream kernel (v6.18-rc6). Please rebase before sending the next version.

ah my bad, it applied for years and the stable release, I should of course have tested it with latest git. I only work thru the hundreds of patches people complain I did not upstream.

Quoted 3 lines

Information available about "VIA Centaur CHA" suggests that the CPU was never released. You'll have to provide more context and explain why it would be necessary or even make sense to add support for it anyway.

Quoted 6 lines

Well they are popular enough that I have two and even this Linus Tech Tips YT channel got one, ...

I have no problem to keep it in https://t2linux.com <https://t2linux.com/> for fun, but I’m happy to rebase it if to document this last VIA CPU driver bits. Your call I guess.

No, the x86 maintainers need to make that decision.

Guenter

author
#4 lore raw
In reply to Guenter Roeck

Hi,

On Mon, 17 Nov 2025 07:44:04 -0800,
Guenter Roeck <[email protected]> wrote:
...

Quoted 3 lines

Your patch does not apply to the tip of the upstream kernel (v6.18-rc6). Please
rebase before sending the next version.

strange, does for me with patch, anyway, will rebase.

...

Quoted 7 lines

drivers/hwmon/via-cputemp.c line 278

Quoted 6 lines
drivers/hwmon/via-cputemp.c +1 -0
@@ -273,6 +274,7 @@
  	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_C7_A,	NULL),
  	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_C7_D,	NULL),
  	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_NANO,	NULL),
+ X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_CHA, NULL),
  	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 7, X86_MODEL_ANY,		NULL),
Quoted 7 lines

The hard-coded numbers were changed to defines with commit 5cfc7ac7c1bf6 ("hwmon:
Convert to new X86 CPU match macros"). I don't know why that commit did not also
change the case statement above. Either case, I'd suggest to either use defines
everywhere or not at all.

As this warnings also annoy me quite a bit:

rene@centaur:~# dmesg  | grep depre
[    0.992068] via_cputemp via_cputemp.0: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[    0.992249] via_cputemp via_cputemp.1: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[    0.992443] via_cputemp via_cputemp.2: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[    0.993148] via_cputemp via_cputemp.3: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[    1.003503] via_cputemp via_cputemp.4: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[    1.004619] via_cputemp via_cputemp.5: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[    1.005364] via_cputemp via_cputemp.6: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[    1.006004] via_cputemp via_cputemp.7: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().

I can finally fix that while at it, too.

Do you prefer a 3 part series fixing this, the defines, and cha001 on top or is one patch okay for this relatively simple changes?

Thanks,

Rene

Signature · 2 lines
  René Rebe, ExactCODE GmbH, Berlin, Germany
  https://exactco.de | https://t2linux.com | https://rene.rebe.de
maintainer
#5 lore raw
Quoted 39 lines · René Rebe

Hi,

On Mon, 17 Nov 2025 07:44:04 -0800,
Guenter Roeck <[email protected]> wrote:
...

Quoted 3 lines

Your patch does not apply to the tip of the upstream kernel (v6.18-rc6). Please
rebase before sending the next version.

strange, does for me with patch, anyway, will rebase.

...

Quoted 7 lines

drivers/hwmon/via-cputemp.c line 278

Quoted 6 lines
drivers/hwmon/via-cputemp.c +1 -0
@@ -273,6 +274,7 @@
   	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_C7_A,	NULL),
   	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_C7_D,	NULL),
   	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_NANO,	NULL),
+ X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 6, X86_CENTAUR_FAM6_CHA, NULL),
   	X86_MATCH_VENDOR_FAM_MODEL(CENTAUR, 7, X86_MODEL_ANY,		NULL),
Quoted 7 lines

The hard-coded numbers were changed to defines with commit 5cfc7ac7c1bf6 ("hwmon:
Convert to new X86 CPU match macros"). I don't know why that commit did not also
change the case statement above. Either case, I'd suggest to either use defines
everywhere or not at all.

As this warnings also annoy me quite a bit:

rene@centaur:~# dmesg  | grep depre
[    0.992068] via_cputemp via_cputemp.0: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[    0.992249] via_cputemp via_cputemp.1: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[    0.992443] via_cputemp via_cputemp.2: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[    0.993148] via_cputemp via_cputemp.3: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[    1.003503] via_cputemp via_cputemp.4: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[    1.004619] via_cputemp via_cputemp.5: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[    1.005364] via_cputemp via_cputemp.6: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[    1.006004] via_cputemp via_cputemp.7: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
Quoted 5 lines

I can finally fix that while at it, too.

Do you prefer a 3 part series fixing this, the defines, and cha001 on top or is one patch okay for this relatively simple changes?

If by "simple change" you mean just calling hwmon_device_register_with_info() with NULL chip parameter, that won't work (the API would reject it). It would have to be a proper conversion. That would be straightforward, but I would not call it simple, and it would have to be a separate patch.

You could of course try to cheat and call hwmon_device_register_for_thermal(), but I would reject that. A conversion to use hwmon_device_register_with_groups() would also not be acceptable; see Documentation/hwmon/hwmon-kernel-api.rst for acceptable API functions.

The defines can be changed together with the cha patch. Just add "While at it, use defines for all CPU model checks" or similar to the patch description.

Thanks,
Guenter

maintainer
#6 lore raw
In reply to René Rebe
Quoted 11 lines · René Rebe

Hi,

On Mon, 17 Nov 2025 07:44:04 -0800,
Guenter Roeck <[email protected]> wrote:
...

Quoted 3 lines

Your patch does not apply to the tip of the upstream kernel (v6.18-rc6). Please
rebase before sending the next version.

strange, does for me with patch, anyway, will rebase.

Yes, it does, but the parent SHA of your patch is not in the upstream kernel, and thus git is not able to apply it.

Guenter