Bug 216655 - dell-smm-hwmon - unable to get SMM Dell signature XPS 17 9710
Summary: dell-smm-hwmon - unable to get SMM Dell signature XPS 17 9710
Status: RESOLVED IMPLEMENTED
Alias: None
Product: Drivers
Classification: Unclassified
Component: Hardware Monitoring (show other bugs)
Hardware: Intel Linux
: P1 normal
Assignee: Pali Rohár
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-02 21:09 UTC by Antonín Skala
Modified: 2023-05-09 19:03 UTC (History)
3 users (show)

See Also:
Kernel Version: 5.19.0-23-generic
Subsystem:
Regression: No
Bisected commit-id:


Attachments
dmesg and lshw (190.00 KB, application/x-tar)
2022-11-02 21:09 UTC, Antonín Skala
Details
Reduced version of the dell-wmi-ddv driver (2.11 KB, application/gzip)
2022-11-18 15:48 UTC, Armin Wolf
Details
Acpi Table Dump (2.35 MB, text/plain)
2022-11-18 16:30 UTC, Antonín Skala
Details
Updated version of the dell-wmi-ddv driver (2.12 KB, application/gzip)
2022-11-18 16:43 UTC, Armin Wolf
Details
Sensors logs (10.00 KB, application/x-tar)
2022-11-18 17:53 UTC, Antonín Skala
Details
Dell UEFI Diagnosis photo (987.38 KB, image/png)
2022-11-18 18:24 UTC, Antonín Skala
Details
Dell UEFI Diagnosis photo 2 (3.87 MB, application/x-tar)
2022-11-18 18:44 UTC, Antonín Skala
Details
DDV-Archive Logs (652.50 KB, application/x-7z-compressed)
2023-01-05 17:02 UTC, Antonín Skala
Details
hwmon-capable version of the dell-wmi-ddv driver (4.36 KB, application/gzip)
2023-01-09 01:33 UTC, Armin Wolf
Details
dell 7430 bios sensors (331.50 KB, image/jpeg)
2023-01-14 03:14 UTC, Jeffrey zhang
Details
hwmon-capable version of the dell-wmi-ddv driver (17.38 KB, text/x-csrc)
2023-01-14 03:34 UTC, Armin Wolf
Details
Updated version of the dell-wmi-ddv driver (17.42 KB, text/x-csrc)
2023-01-14 03:47 UTC, Armin Wolf
Details
dell 7430 acpidump (3.15 MB, text/plain)
2023-01-14 03:59 UTC, Jeffrey zhang
Details
Updated version of the dell-wmi-ddv driver (17.35 KB, text/x-csrc)
2023-01-14 04:16 UTC, Armin Wolf
Details
Updated version of the dell-wmi-ddv driver with additional logging (18.08 KB, text/x-csrc)
2023-01-15 03:26 UTC, Armin Wolf
Details
Updated version of the dell-wmi-ddv driver with additional logging (18.08 KB, text/x-csrc)
2023-01-16 03:29 UTC, Armin Wolf
Details
Updated version of the dell-wmi-ddv driver with additional logging (18.08 KB, text/x-csrc)
2023-01-16 15:33 UTC, Armin Wolf
Details
Final prototype driver version (18.36 KB, text/x-csrc)
2023-01-22 19:48 UTC, Armin Wolf
Details
Second iteration of the dell-wmi-ddv driver with hwmon support (19.64 KB, text/x-csrc)
2023-02-04 00:25 UTC, Armin Wolf
Details
Second iteration of the dell-wmi-ddv driver with hwmon support (19.74 KB, text/x-csrc)
2023-02-05 19:30 UTC, Armin Wolf
Details
Second iteration of the dell-wmi-ddv driver with hwmon support (20.40 KB, text/x-csrc)
2023-02-07 00:24 UTC, Armin Wolf
Details
Experimental Legacy-Diag-over-WMI driver (1.31 KB, application/gzip)
2023-03-21 18:17 UTC, Armin Wolf
Details
Inspiron 3505 ACPI tables (171.98 KB, text/plain)
2023-03-21 18:48 UTC, Armin Wolf
Details

Description Antonín Skala 2022-11-02 21:09:03 UTC
Created attachment 303122 [details]
dmesg and lshw

Hello, add please support to the driver dell-smm-hwmon for:
Dell Inc. XPS 17 9710/0TXN0W, BIOS 1.13.1 08/23/2022. 

Driver return dell_smm_hwmon: unable to get SMM Dell signature.

Complete dmesg and lshw in attachment.

Thank You
Comment 1 Jean Delvare 2022-11-04 09:09:06 UTC
The error message suggests that your laptop is simply not compatible with the dell-smm-hwmon driver. Unless Dell added a 3rd signature on recent models? Assigning to Pali for further investigation (or for closing if nothing can be done).
Comment 2 Pali Rohár 2022-11-04 17:13:47 UTC
I really do not know what Dell invented in recent models. I do not own any new recent models.

For new model support you would have to ask Dell. Could you try to contact Dell.Client.Kernel@dell.com address? It is mentioned in MAINTAINERS file for more Dell drivers.
Comment 3 Antonín Skala 2022-11-09 21:15:53 UTC
Hi, I send a question to Dell email address. I will report back, when I get a response.
Comment 4 Armin Wolf 2022-11-17 11:12:57 UTC
Since your Dell notebook seems to be quiet recent, maybe you can check if
"/sys/bus/wmi/devices/8A42EA14-4F2A-FD45-6422-0087F7A7E608" exists.
If this is the case, then you might be able to query fan and thermal sensors over the WMI DDV interface. A driver for this interface is coming with kernel 6.2, but the fan sensors interface is currently not supported.

If your notebook has the WMI DDV interface, maybe we can find out more about the fan/thermal sensor interface and properly hook it up to the hwmon subsystem.
Comment 5 Antonín Skala 2022-11-18 12:31:32 UTC
Hello, Yes, this interface exists in my notebook. I will happily help with testing. Could be Your driver run on 5.19, or it relies on some functions from higher versions?
Comment 6 Armin Wolf 2022-11-18 14:29:37 UTC
Yes, the driver depends on some infrastructure changes which will land in kernel 6.2, so you cannot compile the driver as a module.
However i can provide you with a "reduced" version of the driver which will compile under 5.19 and still provide access to the fan/thermal sensor interface.
I can also provide you with a Makefile and instructions on how to build the kernel module on you notebook.
Comment 7 Antonín Skala 2022-11-18 14:35:14 UTC
Okay, when will you have a time, send me a reduced version and Makefile. Instruction would also be fine, so I can prevent any build mistakes. Thank You.
Comment 8 Armin Wolf 2022-11-18 15:48:00 UTC
Created attachment 303212 [details]
Reduced version of the dell-wmi-ddv driver

Archive containing a Makefile and the source code of a reduced version of the dell-wmi-ddv- driver.
Comment 9 Armin Wolf 2022-11-18 15:52:35 UTC
I uploaded an archive containing the source code and a Makefile.
You only need to install the kernel-headers and build-essential (on debian).
Inside the directory, you just need to execute "make" and after that "insmod dell-wmi-ddv.ko".

Can you send me the output of "sudo hexdump /sys/kernel/debug/dell-wmi-ddv-8A42EA14-4F2A-FD45-6422-0087F7A7E608/fan_sensor_information" and
"sudo hexdump /sys/kernel/debug/dell-wmi-ddv-8A42EA14-4F2A-FD45-6422-0087F7A7E608/thermal_sensor_information"?
Comment 10 Antonín Skala 2022-11-18 16:05:12 UTC
Build, signed, insmoded.

lsmod: "dell_wmi_ddv           20480  0"

dmesg: "dell-wmi-ddv 8A42EA14-4F2A-FD45-6422-0087F7A7E608: WMI interface version: 3"

But "/sys/kernel/debug/" do not contain "dell-wmi-ddv...".
Comment 11 Armin Wolf 2022-11-18 16:23:17 UTC
Oh well, your notebook features a more modern DDV WMI interface than mine (version 2).

Can you provide me with an dump of your ACPI tables? The program "acpitool" can be used for that.
This would allow me to add support for interface version 3 to the dell-wmi-ddv driver.
Comment 12 Armin Wolf 2022-11-18 16:24:40 UTC
I correct: acpidump is the name of the program.
Comment 13 Antonín Skala 2022-11-18 16:30:38 UTC
Created attachment 303213 [details]
Acpi Table Dump

Acpi Table dump from Dell Inc. XPS 17 9710/0TXN0W, BIOS 1.14.0 09/06/2022  (dell-wmi-ddv version 3)
Comment 14 Armin Wolf 2022-11-18 16:43:26 UTC
Created attachment 303214 [details]
Updated version of the dell-wmi-ddv driver

Supports interface version 3.
Comment 15 Armin Wolf 2022-11-18 16:45:06 UTC
I uploaded an updated version of the dell-wmi-ddv driver which should support your notebook.

Luckily, they only seemed to have added an additional method.
Comment 16 Antonín Skala 2022-11-18 16:47:59 UTC
fan_sensor_information:
0000000 0902 0006 060a 00ff                    
0000007

thermal_sensor_information:
0000000 3300 0000 7300 002f 0000 2d33 0000 3300
0000010 002f 0000 2f33 0000 4400 0028 0000 3033
0000020 0000 3300 0022 0000 3011 0000 ff00     
000002e
Comment 17 Armin Wolf 2022-11-18 16:56:24 UTC
How many fans are installed inside your notebook?
How fast where they running at the time you executed those commands?
Comment 18 Armin Wolf 2022-11-18 17:12:29 UTC
Also, can you please add the following arguments when executing hexdump:
-v -e '1/1 "%02x\n"'
Comment 19 Antonín Skala 2022-11-18 17:14:55 UTC
Two fans (had to disassemble case)

fan_sensor_information:
02
ed
04
00
eb
04
ff

thermal_sensor_information:
00
32
00
00
00
73
2e
00
00
00
33
2b
00
00
00
33
2e
00
00
00
33
2e
00
00
00
44
26
00
00
00
33
2e
00
00
00
33
1f
00
00
00
11
31
00
00
00
ff

Both fans were stopped.
Comment 20 Armin Wolf 2022-11-18 17:17:47 UTC
Ok, thanks.

Can you provide me the output of those commands if the fans are running?
Comment 21 Antonín Skala 2022-11-18 17:18:57 UTC
fan_sensor_information:
0000000 0002 0000 0000 00ff                    
0000007

thermal_sensor_information:
0000000 2d00 0000 7300 002b 0000 2933 0000 3300
0000010 002a 0000 2a33 0000 4400 0025 0000 2833
0000020 0000 3300 0020 0000 2511 0000 ff00     
000002e

These are when fans were stopped (verified by looking at them when disassembled)
Above should be also stopped as no noise was hear.
Comment 22 Antonín Skala 2022-11-18 17:23:24 UTC
fan_sensor_information:
02
eb
0c
00
e2
0c
ff


thermal_sensor_information
00
63
00
00
00
73
39
00
00
00
33
32
00
00
00
33
34
00
00
00
33
34
00
00
00
44
26
00
00
00
33
31
00
00
00
33
20
00
00
00
11
37
00
00
00
ff

Both spins high. ("stress --cpu 15")
Comment 23 Armin Wolf 2022-11-18 17:24:46 UTC
Interesting, i assume both are running at aprox. 3300 RPM?
Additionally, the output of the "sensors" command could help me to better understand the thermal sensors buffer.
Comment 24 Antonín Skala 2022-11-18 17:28:47 UTC
Can't tel how much it is, but the noise seems to me as max level they ever produced.

ucsi_source_psy_USBC000:003-isa-0000
Adapter: ISA adapter
in0:           5.00 V  (min =  +5.00 V, max =  +5.00 V)
curr1:         0.00 A  (max =  +0.00 A)

ucsi_source_psy_USBC000:001-isa-0000
Adapter: ISA adapter
in0:           5.00 V  (min =  +5.00 V, max =  +5.00 V)
curr1:         0.00 A  (max =  +0.00 A)

coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +100.0°C  (high = +100.0°C, crit = +100.0°C)
Core 0:        +89.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:        +86.0°C  (high = +100.0°C, crit = +100.0°C)
Core 2:       +100.0°C  (high = +100.0°C, crit = +100.0°C)
Core 3:       +100.0°C  (high = +100.0°C, crit = +100.0°C)
Core 4:        +98.0°C  (high = +100.0°C, crit = +100.0°C)
Core 5:       +100.0°C  (high = +100.0°C, crit = +100.0°C)
Core 6:        +89.0°C  (high = +100.0°C, crit = +100.0°C)
Core 7:        +89.0°C  (high = +100.0°C, crit = +100.0°C)

nvme-pci-e200
Adapter: PCI adapter
Composite:    +38.9°C  (low  = -60.1°C, high = +89.8°C)
                       (crit = +94.8°C)

ucsi_source_psy_USBC000:004-isa-0000
Adapter: ISA adapter
in0:           5.00 V  (min =  +0.00 V, max = +19.50 V)
curr1:         6.50 A  (max =  +6.66 A)

ucsi_source_psy_USBC000:002-isa-0000
Adapter: ISA adapter
in0:           5.00 V  (min =  +5.00 V, max =  +5.00 V)
curr1:         0.00 A  (max =  +0.00 A)

iwlwifi_1-virtual-0
Adapter: Virtual device
temp1:        +37.0°C

nvme-pci-e100
Adapter: PCI adapter
Composite:    +40.9°C  (low  =  -0.1°C, high = +82.8°C)
                       (crit = +84.8°C)
Sensor 1:     +33.9°C  (low  = -273.1°C, high = +65261.8°C)
Sensor 2:     +34.9°C  (low  = -273.1°C, high = +65261.8°C)

BAT0-acpi-0
Adapter: ACPI interface
in0:          12.70 V
curr1:       871.00 mA
Comment 25 Armin Wolf 2022-11-18 17:39:40 UTC
Can you provide an output of the commands again while executing sensors at the same time and provide me with that output too? I am currently trying to map individual temperature sensors into the thermal buffer.
Comment 26 Antonín Skala 2022-11-18 17:53:21 UTC
Created attachment 303215 [details]
Sensors logs

Contain debug and sensors output. File name mean subjective fan speed.
Comment 27 Antonín Skala 2022-11-18 18:04:18 UTC
If you need more levels, I could probably add to my bash script sensor reading in cycle and create debug log on temperature change (by X degrees).
Comment 28 Armin Wolf 2022-11-18 18:06:15 UTC
Thank you, but i think i now know the layout of those buffers:

Fan:
Fan type (?)
Fan rpm, low byte
Fan rpm, high byte

Thermal:
Temp max
Temp current
?
?
?
Comment 29 Armin Wolf 2022-11-18 18:10:59 UTC
Regarding the fan type: Im not sure about that one, but you can check this if you notebook supports the "Dell UEFI Preboot Diagnostics".

You can choose it as a boot option when pressing F12 during powerup.
It will take you to a screen (you may need to abort the diag test), and upon choosing "Configuration" (or "Results"), it will show you the current system configuration, including any fan/thermal sensors.

Maybe you can try and take a picture of it?
Comment 30 Antonín Skala 2022-11-18 18:24:32 UTC
Created attachment 303216 [details]
Dell UEFI Diagnosis photo

Sure. If needed, I can send whole content.
Comment 31 Armin Wolf 2022-11-18 18:29:25 UTC
Perfect, the first byte seems to be indeed the fan type (as found in dell-smm-hwmon). Does the UEFI provide any information regarding the temperature sensors?
Comment 32 Antonín Skala 2022-11-18 18:44:20 UTC
Created attachment 303217 [details]
Dell UEFI Diagnosis photo 2

Yes, there are in Health card.
Comment 33 Armin Wolf 2022-11-18 18:54:31 UTC
I do not know where the system gets the temperature sensors labels, but i think the temperature sensor values make sense.

Sadly, the interface seems to provide no way to set the fan speed, only read access seems possible. But maybe dell-smm-hwmon can still provide write access when supplied with the "force=true" module option?
Comment 34 Antonín Skala 2022-11-18 19:01:15 UTC
Cannot tell as:

sudo modprobe i8k force=1

sudo i8kctl
1.0 1.1 G0WZ9G3 -1 -1 -1 -1 -1 -1 -1
Comment 35 Armin Wolf 2022-11-18 19:06:43 UTC
So the interface really is absent.
Luckly "smbios-thermal-ctl" seems to work on your notebook, is the level of control it grants you enough for your needs?
Comment 36 Antonín Skala 2022-11-18 19:15:42 UTC
"smbios-thermal-ctl" cannot find module:

-- dell-smbios-wmi driver not loaded 
   Try loading the dell-smbios-wmi driver 
   Linux : modprobe dell-smbios-wmi 


"lsmod | grep dell"

dell_wmi_ddv           20480  0
dell_smm_hwmon         24576  0
dell_laptop            32768  0
dell_wmi               24576  1 dell_laptop
ledtrig_audio          16384  3 snd_ctl_led,dell_wmi,dell_laptop
dell_smbios            28672  2 dell_wmi,dell_laptop
dcdbas                 20480  1 dell_smbios
dell_wmi_sysman        45056  0
dell_wmi_descriptor    20480  2 dell_wmi,dell_smbios
firmware_attributes_class    16384  1 dell_wmi_sysman
sparse_keymap          16384  2 intel_hid,dell_wmi
wmi                    32768  6 dell_wmi_ddv           20480  0
dell_smm_hwmon         24576  0
dell_laptop            32768  0
dell_wmi               24576  1 dell_laptop
ledtrig_audio          16384  3 snd_ctl_led,dell_wmi,dell_laptop
dell_smbios            28672  2 dell_wmi,dell_laptop
dcdbas                 20480  1 dell_smbios
dell_wmi_sysman        45056  0
dell_wmi_descriptor    20480  2 dell_wmi,dell_smbios
firmware_attributes_class    16384  1 dell_wmi_sysman
sparse_keymap          16384  2 intel_hid,dell_wmi
wmi                    32768  6 dell_wmi_sysman,dell_wmi_ddv,dell_wmi,wmi_bmof,dell_smbios,dell_wmi_descriptor
video                  61440  3 dell_wmi,dell_laptop,i915
dell_wmi_sysman,dell_wmi_ddv,dell_wmi,wmi_bmof,dell_smbios,dell_wmi_descriptor
video                  61440  3 dell_wmi,dell_laptop,i915

Tried to load it, but it's not found.
Comment 37 Armin Wolf 2022-11-18 19:21:13 UTC
Can you try to manually load it?
If it does not work, consider a BIOS upgrade and/or disable the WSMT table via BIOS setup menu.
Comment 38 Armin Wolf 2022-11-18 19:21:57 UTC
On my machine (Inspiron 3505), a BIOS upgrade was necessary for dell-smbios-wmi to load.
Comment 39 Armin Wolf 2022-11-18 19:24:51 UTC
smbios-thermal-ctl should work on your notebook, according to the arch wiki:
https://wiki.archlinux.org/title/Dell_XPS_17_(9710)#Fan_control
Comment 40 Antonín Skala 2022-11-18 19:29:50 UTC
sudo modprobe dell-smbios-wmi
modprobe: FATAL: Module dell-smbios-wmi not found in directory /lib/modules/5.19.0-23-generic

Bios is actual.
Comment 41 Armin Wolf 2022-11-18 19:36:04 UTC
My bad, its integrated into dell-smbios.
Have you executed the command with root permissions?
If yes, then try to deactivate WSMT support inside the BIOS.
Comment 42 Antonín Skala 2022-11-18 19:37:55 UTC
ou, sry, forget to use sudo.

sudo smbios-thermal-ctl -g
Helper function to Get current Thermal Mode settings

 Print Current Status of Thermal Information: 
-------------------------------------------------------------------
 
Current Thermal Modes: 
	 Performance
 
Current Active Acoustic Controller (AAC) Mode: 
	 AAC mode Disabled
 
Current Active Acoustic Controller (AAC) Mode: 
	Global (AAC enable/disable applies to all supported USTT modes)
 
Current Fan Failure Mode: 

sudo smbios-thermal-ctl -i
Libsmbios version : 2.4.3
smbios-thermal-ctl version : 2.4.3

 Print all the Available Thermal Information of your system: 
-------------------------------------------------------------------
 
Supported Thermal Modes: 
	 Balanced
	 Cool Bottom
	 Quiet
	 Performance
 
Supported Active Acoustic Controller (AAC) modes: 
 
Supported AAC Configuration type: 
	Global (AAC enable/disable applies to all supported USTT modes)
Comment 43 Armin Wolf 2022-11-18 19:43:59 UTC
At the moment, this is all the fan control we can provide.

Since i suppose your also interested in being able to retrieve the fan/thermal sensor readings via sensors, i will add support for it to the dell-wmi-ddv driver, which is expected to land in kernel 6.2.

Additionally, dell-smm-hwmon could be made more "silent" when it does not find matching hardware. I will try that too.
Comment 44 Antonín Skala 2022-11-18 19:50:03 UTC
Okay, ping me, if You will need to test something.

6.1.0-rc5 is build for kinetic in mainland, so hopefully 6.2 will be too. 

Anyway, Thank You.
Comment 45 Armin Wolf 2022-12-05 16:05:28 UTC
The dell-smm-hwmon driver should be more silent now when it does not find any matching hardware. The necessary change will land in 6.2.

Regarding the sensor support inside dell-wmi-ddv: It will likely take a bit longer due to the driver sharing code with the dell-smm-hwmon driver.
Comment 46 Armin Wolf 2023-01-05 16:08:09 UTC
I found out that the layout of the thermal buffer is different:
Thermal:
type
Temp current
?
Temp max
?

The first byte tells us the type of the thermal sensor, the maximum Temperature is encoded in the 4th byte. Do you have Windows installed in a dualboot configuration? If yes, could you send me the contents of the directory
"C:\ProgramData\Dell\DellDataVault\Archive\"? It should contain logs regarding the thermal sensors, which could be used to decode the remaining buffer.
Comment 47 Antonín Skala 2023-01-05 17:02:36 UTC
Created attachment 303529 [details]
DDV-Archive Logs

Sure. I packed all files except ones with suffix *.dat. They were too big for archive so I packed only first of them.
Comment 48 Armin Wolf 2023-01-09 01:33:01 UTC
Created attachment 303557 [details]
hwmon-capable version of the dell-wmi-ddv driver
Comment 49 Armin Wolf 2023-01-09 01:35:33 UTC
I finally created a working hwmon-capable prototype of the dell-wmi-ddv driver.
Could you test it under a 6.2.0-rcX-series kernel?
Comment 50 Jeffrey zhang 2023-01-14 02:18:32 UTC
Hey Armin

I am using Latitude 7430 and has the /sys/bus/wmi/devices/8A42EA14-4F2A-FD45-6422-0087F7A7E608/ path on archlinux

I installed the linux-mainline 6.2rc3-1 from archlinuxcn repo and build the latest dell-wmi-ddv driver you provided

Seem it works


$ sudo smbios-thermal-ctl -g
Helper function to Get current Thermal Mode settings

 Print Current Status of Thermal Information: 
-------------------------------------------------------------------
 
Current Thermal Modes: 
	 Performance
 
Current Active Acoustic Controller (AAC) Mode: 
	 AAC mode Disabled
 
Current Active Acoustic Controller (AAC) Mode: 
	Global (AAC enable/disable applies to all supported USTT modes)
 
Current Fan Failure Mode:






$ sudo sensors
coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +42.0°C  (high = +100.0°C, crit = +100.0°C)
Core 0:        +39.0°C  (high = +100.0°C, crit = +100.0°C)
Core 4:        +39.0°C  (high = +100.0°C, crit = +100.0°C)
Core 8:        +38.0°C  (high = +100.0°C, crit = +100.0°C)
Core 12:       +39.0°C  (high = +100.0°C, crit = +100.0°C)
Core 16:       +38.0°C  (high = +100.0°C, crit = +100.0°C)
Core 17:       +38.0°C  (high = +100.0°C, crit = +100.0°C)
Core 18:       +38.0°C  (high = +100.0°C, crit = +100.0°C)
Core 19:       +38.0°C  (high = +100.0°C, crit = +100.0°C)
Core 20:       +42.0°C  (high = +100.0°C, crit = +100.0°C)
Core 21:       +42.0°C  (high = +100.0°C, crit = +100.0°C)
Core 22:       +42.0°C  (high = +100.0°C, crit = +100.0°C)
Core 23:       +42.0°C  (high = +100.0°C, crit = +100.0°C)

iwlwifi_1-virtual-0
Adapter: Virtual device
temp1:        +38.0°C  

nvme-pci-0100
Adapter: PCI adapter
Composite:    +35.9°C  (low  = -273.1°C, high = +82.8°C)
                       (crit = +84.8°C)
Sensor 1:     +35.9°C  (low  = -273.1°C, high = +65261.8°C)

dell_ddv-virtual-0
Adapter: Virtual device
Processor Fan: 1083 RPM
CPU:            +42.0°C  (low  =  +0.0°C, high =  +0.0°C)
Other:          +38.0°C  (low  =  +0.0°C, high =  +0.0°C)
Memory:         +41.0°C  (low  =  +0.0°C, high =  +0.0°C)
Other:          +40.0°C  (low  =  +0.0°C, high =  +0.0°C)
Ambient:        +42.0°C  (low  =  +0.0°C, high =  +0.0°C)
Ambient:        +43.0°C  (low  =  +0.0°C, high =  +0.0°C)
temp7:          +28.0°C  (low  =  +0.0°C, high =  +0.0°C)

ucsi_source_psy_USBC000:002-isa-0000
Adapter: ISA adapter
in0:          20.00 V  (min =  +5.00 V, max = +20.00 V)
curr1:         2.88 A  (max =  +2.88 A)

ucsi_source_psy_USBC000:001-isa-0000
Adapter: ISA adapter
in0:           5.00 V  (min =  +5.00 V, max =  +5.00 V)
curr1:         0.00 A  (max =  +0.00 A)

BAT0-acpi-0
Adapter: ACPI interface
in0:          16.92 V  
curr1:       1000.00 uA 




is it possible we can control the fan speed directly? rather then the Thermal Modes which i think is not very good.
Comment 51 Armin Wolf 2023-01-14 02:25:45 UTC
Sadly no, its not possible to control the fan speed directly, at least to without the legacy SMM interface :-(.

I noticed that the 7th temperature channel has no associated label, likely because his thermal type is unknown. Could you provide some pictures of the hardware monitoring section inside your BIOS so i can add the missing label?

Also it seems most machines do not support the min/max thermal attributes. I will change the driver to not display them if both min and max are 0.
Comment 52 Armin Wolf 2023-01-14 02:29:34 UTC
Maybe a BIOS update can fix smbios-thermal-ctl on your Latitude 7430?
Comment 53 Jeffrey zhang 2023-01-14 02:41:13 UTC
Maybe a BIOS update can fix smbios-thermal-ctl on your Latitude 7430?


And the BIOS is the latest

cat /proc/i8k                                    
1.0 1.9 XXXXX -22 -22 -22 -22 -22 -1 -22


the smbios-thermal-ctl should work

$ smbios-thermal-ctl --set-thermal-mode Quiet      
[sudo] password for jeffrey: 
Helper function to Set Thermal Mode
Thermal Information Set successfully to: Quiet
Comment 54 Armin Wolf 2023-01-14 02:45:19 UTC
The lates version seems to be 1.10.0, while yours seems to be 1.9.X.
Comment 55 Armin Wolf 2023-01-14 02:47:58 UTC
Also you are better of using dmidecode when checking your BIOS version, i8k/dell-smm-hwmon only displays the first three digits.
Comment 56 Jeffrey zhang 2023-01-14 02:50:38 UTC
Yes, upgrading.

BTW, where i can find the `monitoring section inside your BIOS`, I can not found this section. cloud you give me more info ?
Comment 57 Armin Wolf 2023-01-14 02:52:32 UTC
If such a section is not available inside your main BIOS menu, then it often can be found inside the builtin diagnostic software (usually available as boot option).
Comment 58 Jeffrey zhang 2023-01-14 03:14:48 UTC
Created attachment 303595 [details]
dell 7430 bios sensors
Comment 59 Jeffrey zhang 2023-01-14 03:17:49 UTC
the bios thermals sections is uploaded and the bios is the latest one 


dmidecode 3.4
Getting SMBIOS data from sysfs.
SMBIOS 3.4 present.

Handle 0x0001, DMI type 0, 26 bytes
BIOS Information
	Vendor: Dell Inc.
	Version: 1.10.0
	Release Date: 11/14/2022
	ROM Size: 32 MB
	Characteristics:
		PCI is supported
		PNP is supported
		BIOS is upgradeable
		BIOS shadowing is allowed
		Boot from CD is supported
		Selectable boot is supported
		EDD is supported
		Print screen service is supported (int 5h)
		8042 keyboard services are supported (int 9h)
		Serial services are supported (int 14h)
		Printer services are supported (int 17h)
		ACPI is supported
		USB legacy is supported
		Smart battery is supported
		BIOS boot specification is supported
		Function key-initiated network boot is supported
		Targeted content distribution is supported
		UEFI is supported
	BIOS Revision: 1.10


latest sensors is

```
dell_ddv-virtual-0
Adapter: Virtual device
Processor Fan:  873 RPM
CPU:            +42.0°C  (low  =  +0.0°C, high =  +0.0°C)
Other:          +38.0°C  (low  =  +0.0°C, high =  +0.0°C)
Memory:         +42.0°C  (low  =  +0.0°C, high =  +0.0°C)
Other:          +40.0°C  (low  =  +0.0°C, high =  +0.0°C)
Ambient:        +42.0°C  (low  =  +0.0°C, high =  +0.0°C)
Ambient:        +43.0°C  (low  =  +0.0°C, high =  +0.0°C)
temp7:          +27.0°C  (low  =  +0.0°C, high =  +0.0°C)
```


smbios-thermal-ctl works too


$ sudo smbios-thermal-ctl --set-thermal-mode Performance
Helper function to Set Thermal Mode
Thermal Information Set successfully to: Performance

$ sudo smbios-thermal-ctl -g                            
Helper function to Get current Thermal Mode settings

 Print Current Status of Thermal Information: 
-------------------------------------------------------------------
 
Current Thermal Modes: 
	 Performance
 
Current Active Acoustic Controller (AAC) Mode: 
	 AAC mode Disabled
 
Current Active Acoustic Controller (AAC) Mode: 
	Global (AAC enable/disable applies to all supported USTT modes)
 
Current Fan Failure Mode:
Comment 60 Armin Wolf 2023-01-14 03:34:33 UTC
Created attachment 303596 [details]
hwmon-capable version of the dell-wmi-ddv driver
Comment 61 Armin Wolf 2023-01-14 03:37:22 UTC
Great, it seems temperature channel 7 is called "DIMM". I uploaded a improved version of the driver, load it and execute sensors, when check dmesg for a message containing "Unknown thermal sensor type:".
Comment 62 Jeffrey zhang 2023-01-14 03:38:52 UTC
Got this 


dell-wmi-ddv 8A42EA14-4F2A-FD45-6422-0087F7A7E608: Unknown thermal sensor type: 0xff
Comment 63 Armin Wolf 2023-01-14 03:47:31 UTC
Created attachment 303597 [details]
Updated version of the dell-wmi-ddv driver
Comment 64 Jeffrey zhang 2023-01-14 03:51:49 UTC
It is fixed

dell_ddv-virtual-0
Adapter: Virtual device
Processor Fan: 3713 RPM
CPU:            +60.0°C  (low  =  +0.0°C, high =  +0.0°C)
Other:          +33.0°C  (low  =  +0.0°C, high =  +0.0°C)
Memory:         +50.0°C  (low  =  +0.0°C, high =  +0.0°C)
Other:          +38.0°C  (low  =  +0.0°C, high =  +0.0°C)
Ambient:        +50.0°C  (low  =  +0.0°C, high =  +0.0°C)
Ambient:        +44.0°C  (low  =  +0.0°C, high =  +0.0°C)
DIMM:           +28.0°C  (low  =  +0.0°C, high =  +0.0°C)
Comment 65 Armin Wolf 2023-01-14 03:53:12 UTC
Wait, i am confused: "DIMM" is already listed as "Memory", so temperature channel 7 would be "Primary Battery Thermistor", but that is usually not reported thru this interface.

Could you provide me with the content of /sys/kernel/debug/dell-wmi-ddv-<GUID>/thermal_sensor_buffer? (needs root to read and even ls!)
Comment 66 Armin Wolf 2023-01-14 03:57:09 UTC
Also, could you provide me with the output of acpidump? I might be able to see if the last thermal sensor entry is indeed the battery temperature.
Comment 67 Jeffrey zhang 2023-01-14 03:59:46 UTC
Created attachment 303598 [details]
dell 7430 acpidump
Comment 68 Jeffrey zhang 2023-01-14 03:59:55 UTC
like this? 

sudo hexdump /sys/kernel/debug/dell-wmi-ddv-8A42EA14-4F2A-FD45-6422-0087F7A7E608/thermal_sensor_information
0000000 3800 0000 3300 0021 0000 3022 0000 3300
0000010 0025 0000 2f44 0000 4400 002a 0000 1bff
0000020 0000 ff00                              
0000024

sudo hexdump -v -e '1/1 "%02x\n"' /sys/kernel/debug/dell-wmi-ddv-8A42EA14-4F2A-FD45-6422-0087F7A7E608/thermal_sensor_information
00
37
00
00
00
33
20
00
00
00
22
2f
00
00
00
33
25
00
00
00
44
30
00
00
00
44
2a
00
00
00
ff
1b
00
00
00
ff


> need be out, will reply later.
Comment 69 Armin Wolf 2023-01-14 04:16:47 UTC
Created attachment 303599 [details]
Updated version of the dell-wmi-ddv driver
Comment 70 Jeffrey zhang 2023-01-14 11:37:05 UTC
now is

dell_ddv-virtual-0
Adapter: Virtual device
Processor Fan:   1252 RPM
CPU:              +43.0°C  (low  =  +0.0°C, high =  +0.0°C)
Other:            +38.0°C  (low  =  +0.0°C, high =  +0.0°C)
Memory:           +41.0°C  (low  =  +0.0°C, high =  +0.0°C)
Other:            +40.0°C  (low  =  +0.0°C, high =  +0.0°C)
Ambient:          +42.0°C  (low  =  +0.0°C, high =  +0.0°C)
Ambient:          +44.0°C  (low  =  +0.0°C, high =  +0.0°C)
Primary Battery:  +26.0°C  (low  =  +0.0°C, high =  +0.0°C)
Comment 71 Armin Wolf 2023-01-14 16:25:08 UTC
Nice, i will modify the driver so he filters out tempX_min/tempX_max attributes which both are zero.

Can you check if "/sys/class/power_supply/<battery name>/temp" and "/sys/class/power_supply/<battery name>/eppid" exist?
Comment 72 Jeffrey zhang 2023-01-15 01:23:00 UTC
grep . -R /sys/class/power_supply/BAT0/temp /sys/class/power_supply/BAT0/eppid
/sys/class/power_supply/BAT0/temp:302
/sys/class/power_supply/BAT0/eppid:CN0Y86WGSLW0023M85VPA00




dell_ddv-virtual-0
Adapter: Virtual device
Processor Fan:   1577 RPM
CPU:              +44.0°C  (low  =  +0.0°C, high =  +0.0°C)
Other:            +38.0°C  (low  =  +0.0°C, high =  +0.0°C)
Memory:           +42.0°C  (low  =  +0.0°C, high =  +0.0°C)
Other:            +41.0°C  (low  =  +0.0°C, high =  +0.0°C)
Ambient:          +43.0°C  (low  =  +0.0°C, high =  +0.0°C)
Ambient:          +44.0°C  (low  =  +0.0°C, high =  +0.0°C)
Primary Battery:  +28.0°C  (low  =  +0.0°C, high =  +0.0°C)
Comment 73 Armin Wolf 2023-01-15 02:26:04 UTC
Strange, the battery temperature and the primary battery temperature do not match.

I will soon upload a version of the driver which display more diagnostic messages during loading, maybe the battery matching algorithm is faulty.
Comment 74 Armin Wolf 2023-01-15 03:26:40 UTC
Created attachment 303604 [details]
Updated version of the dell-wmi-ddv driver with additional logging
Comment 75 Armin Wolf 2023-01-15 03:28:14 UTC
I uploaded yet another updated version of the driver, can you send me the dmesg output after loading the module and the serial number of your battery (/sys/class/power_supply/<battery>/serial_number)?
Comment 76 Jeffrey zhang 2023-01-15 04:12:20 UTC
$ dmesg
[90061.872982] dell-wmi-ddv 8A42EA14-4F2A-FD45-6422-0087F7A7E608: WMI interface version: 3
[90061.876521] dell-wmi-ddv 8A42EA14-4F2A-FD45-6422-0087F7A7E608: Serial for index 1: 0
[90061.880227] dell-wmi-ddv 8A42EA14-4F2A-FD45-6422-0087F7A7E608: Serial for index 2: 0
[90061.883349] dell-wmi-ddv 8A42EA14-4F2A-FD45-6422-0087F7A7E608: Serial for index 3: 0
[90061.958579] dell-wmi-ddv 8A42EA14-4F2A-FD45-6422-0087F7A7E608: Matching battery (0) with index 1
[90061.958593] ACPI: battery: new extension: Dell DDV Battery Extension


$ cat /sys/class/power_supply/BAT0/serial_number
7621
Comment 77 Armin Wolf 2023-01-15 06:06:21 UTC
So the current battery matching algorithm is indeed faulty, the battery is matched to an index with a (likely) invalid serial number.

In case you are running a dualboot configuration with Windows, could you provide me the files inside the directory "C:\ProgramData\Dell\DTP\Logs\DTP.Instrumentation.SubAgent\"? I strongly suspect that they contain information on how the preinstalled Dell software matches the batteries.

As for the hwmon part: i already submitted a RFC patch on the mailinglist, it will however take some time as the reviewers/maintainers are currently quite busy.
Comment 78 Jeffrey zhang 2023-01-15 09:32:02 UTC
sorry , my system is linux only, no windows. so can not provide that file.
Comment 79 Armin Wolf 2023-01-15 13:35:14 UTC
No problem, i will upload a modified version of the driver later which simply probes all available indices, so we can figure out which index matches to your battery (serial 7621).

If you have some knowledge of C, then you can even edit the driver yourself. Just increase the iteration count of the for-loop to 255.
Comment 80 Jeffrey zhang 2023-01-16 02:37:51 UTC
no problem, i can handle this.
Comment 81 Armin Wolf 2023-01-16 03:29:56 UTC
Created attachment 303611 [details]
Updated version of the dell-wmi-ddv driver with additional logging

Increased the iteration count to 255.
Comment 82 Armin Wolf 2023-01-16 03:30:29 UTC
Ok, i updated the driver just in case.
Comment 83 Armin Wolf 2023-01-16 15:33:31 UTC
Created attachment 303613 [details]
Updated version of the dell-wmi-ddv driver with additional logging

Forgot to actually pass the index as an argument.
Comment 84 Armin Wolf 2023-01-16 15:35:33 UTC
It was my fault, i always passed "0" as the battery index when getting the serial number instead of passing the value from 0 to 255.

I fixed it now, it should now log the correct serial numbers.
Comment 85 Jeffrey zhang 2023-01-18 15:39:36 UTC
it this what you wanna? 

[25486.961197] dell-wmi-ddv 8A42EA14-4F2A-FD45-6422-0087F7A7E608: WMI interface version: 3
[25486.966182] dell-wmi-ddv 8A42EA14-4F2A-FD45-6422-0087F7A7E608: Serial for index 0: 0
[25486.971184] dell-wmi-ddv 8A42EA14-4F2A-FD45-6422-0087F7A7E608: Serial for index 1: 7621
[25486.976518] dell-wmi-ddv 8A42EA14-4F2A-FD45-6422-0087F7A7E608: Serial for index 2: 0
...
[25488.289497] dell-wmi-ddv 8A42EA14-4F2A-FD45-6422-0087F7A7E608: Serial for index 255: 0
[25488.385730] dell-wmi-ddv 8A42EA14-4F2A-FD45-6422-0087F7A7E608: Matching battery (0) with index 1
Comment 86 Armin Wolf 2023-01-18 17:18:05 UTC
Yes, this is it.
It seems that your battery is indeed matched to the correct index, as both serial numbers match.

I dont know why the "Primary battery" sensor measures a different temperature than the method which directly asks for the battery temperature.

Can you check if the difference between those two sensors occurs regularly?
Comment 87 Armin Wolf 2023-01-22 19:48:26 UTC
Created attachment 303635 [details]
Final prototype driver version
Comment 88 Armin Wolf 2023-01-22 19:50:21 UTC
The hwmon patch is now ready for upstreaming,i changed the following things:
- added additional fan and thermal types found by trial and error (thermal type 0xff is recognized as "Unknown", so i think its not the primary battery)
- added support for thermal zones
- general code cleanup

Could you test it again? If there are no problems, then i will submit the necessary patches for kernel 6.3.
Comment 89 Antonín Skala 2023-01-22 22:57:56 UTC
Hello, kernel 6.2.0-rc5 finally arieved into Umuntu Mainland so I can test it out.

Your latest version gives me this error:

$ make
make -C /lib/modules/`uname -r`/build M=`pwd` modules
make[1]: Vstupuje se do adresáře „/usr/src/linux-headers-6.2.0-060200rc5-generic“
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.2.0-9ubuntu1) 12.2.0
  You are using:           gcc-12 (Ubuntu 12.2.0-3ubuntu1) 12.2.0
  LD [M]  /home/tony/Stažené/dell-wmi-ddv/dell-wmi-ddv.ko
  BTF [M] /home/tony/Stažené/dell-wmi-ddv/dell-wmi-ddv.ko
Skipping BTF generation for /home/tony/Stažené/dell-wmi-ddv/dell-wmi-ddv.ko due to unavailability of vmlinux
make[1]: Opouští se adresář „/usr/src/linux-headers-6.2.0-060200rc5-generic“

After signing when I try load it:


sudo modprobe dell-wmi-ddv 
modprobe: ERROR: could not insert 'dell_wmi_ddv': Unknown symbol in module, or unknown parameter (see dmesg)

But dmesg is empty (no new line appended)
Comment 90 Armin Wolf 2023-01-22 23:00:59 UTC
I think you need to also update your compiler used to build the module, and you need to install the appropriate kernel headers.
Comment 91 Armin Wolf 2023-01-22 23:03:31 UTC
Are you sure you booted into the right kernel?
Comment 92 Armin Wolf 2023-01-22 23:36:36 UTC
Wait, when unloading the dell-wmi-ddv driver, the battery drivee also gets unloaded,leading to such an error message.

Reload the module like this:
modprobe -r dell-wmi-ddv
modprobe battery
insmod dell-wmi-ddv
Comment 93 Armin Wolf 2023-01-25 15:44:58 UTC
Any progress on the testing?
Comment 94 Antonín Skala 2023-01-26 18:20:59 UTC
$ sensors
ucsi_source_psy_USBC000:003-isa-0000
Adapter: ISA adapter
in0:           5.00 V  (min =  +5.00 V, max =  +5.00 V)
curr1:         0.00 A  (max =  +0.00 A)

ucsi_source_psy_USBC000:001-isa-0000
Adapter: ISA adapter
in0:           5.00 V  (min =  +5.00 V, max =  +5.00 V)
curr1:         0.00 A  (max =  +0.00 A)

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +49.0°C  (high = +100.0°C, crit = +100.0°C)
Core 0:        +45.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:        +46.0°C  (high = +100.0°C, crit = +100.0°C)
Core 2:        +46.0°C  (high = +100.0°C, crit = +100.0°C)
Core 3:        +50.0°C  (high = +100.0°C, crit = +100.0°C)
Core 4:        +49.0°C  (high = +100.0°C, crit = +100.0°C)
Core 5:        +44.0°C  (high = +100.0°C, crit = +100.0°C)
Core 6:        +48.0°C  (high = +100.0°C, crit = +100.0°C)
Core 7:        +48.0°C  (high = +100.0°C, crit = +100.0°C)

nvme-pci-e200
Adapter: PCI adapter
Composite:    +40.9°C  (low  = -60.1°C, high = +89.8°C)
                       (crit = +94.8°C)

ucsi_source_psy_USBC000:004-isa-0000
Adapter: ISA adapter
in0:           5.00 V  (min =  +0.00 V, max = +19.50 V)
curr1:         6.50 A  (max =  +6.66 A)

ucsi_source_psy_USBC000:002-isa-0000
Adapter: ISA adapter
in0:           5.00 V  (min =  +5.00 V, max =  +5.00 V)
curr1:         0.00 A  (max =  +0.00 A)

dell_ddv-virtual-0
Adapter: Virtual device
Video Fan:   1251 RPM
CPU Fan:     1245 RPM
CPU:          +48.0°C  (low  =  +0.0°C, high =  +0.0°C)
NB:           +45.0°C  (low  =  +0.0°C, high =  +0.0°C)
Other:        +43.0°C  (low  =  +0.0°C, high =  +0.0°C)
Other:        +46.0°C  (low  =  +0.0°C, high =  +0.0°C)
Other:        +45.0°C  (low  =  +0.0°C, high =  +0.0°C)
Ambient:      +39.0°C  (low  =  +0.0°C, high =  +0.0°C)
Other:        +47.0°C  (low  =  +0.0°C, high =  +0.0°C)
Other:        +31.0°C  (low  =  +0.0°C, high =  +0.0°C)
Video:        +47.0°C  (low  =  +0.0°C, high =  +0.0°C)

iwlwifi_1-virtual-0
Adapter: Virtual device
temp1:        +34.0°C  

nvme-pci-e100
Adapter: PCI adapter
Composite:    +42.9°C  (low  =  -0.1°C, high = +82.8°C)
                       (crit = +84.8°C)
Sensor 1:     +35.9°C  (low  = -273.1°C, high = +65261.8°C)
Sensor 2:     +38.9°C  (low  = -273.1°C, high = +65261.8°C)

BAT0-acpi-0
Adapter: ACPI interface
in0:          12.62 V  
curr1:       1000.00 uA 


$ dmesg
dell-wmi-ddv 8A42EA14-4F2A-FD45-6422-0087F7A7E608: WMI interface version: 3


Yes, but I have problem with running self signed modules on kernel higher than 5.19. It seems like that there was some change that breaks a way I sign them.
Comment 95 Armin Wolf 2023-01-26 18:26:08 UTC
Thanks for the feedback.

Since the driver seems to work without issues, i will submit the patch to the kernel mailing list. I will add a Tested-by tag containing your name and email adress, so you get credited with testing the driver, ok?
Comment 96 Antonín Skala 2023-01-26 19:14:58 UTC
Created attachment 303653 [details]
attachment-17771-0.html

Oh, yes. Thank You

čt 26. 1. 2023 v 19:26 odesílatel <bugzilla-daemon@kernel.org> napsal:

> https://bugzilla.kernel.org/show_bug.cgi?id=216655
>
> --- Comment #95 from Armin Wolf (W_Armin@gmx.de) ---
> Thanks for the feedback.
>
> Since the driver seems to work without issues, i will submit the patch to
> the
> kernel mailing list. I will add a Tested-by tag containing your name and
> email
> adress, so you get credited with testing the driver, ok?
>
> --
> You may reply to this email to add a comment.
>
> You are receiving this mail because:
> You reported the bug.
Comment 97 Jeffrey zhang 2023-01-27 01:03:26 UTC
sorry for the delay

here is the latest sensors output. Last one become Unknown..

dell_ddv-virtual-0
Adapter: Virtual device
CPU Fan:        0 RPM
CPU:          +34.0°C  (low  =  +0.0°C, high =  +0.0°C)
Other:        +35.0°C  (low  =  +0.0°C, high =  +0.0°C)
Memory:       +33.0°C  (low  =  +0.0°C, high =  +0.0°C)
Other:        +42.0°C  (low  =  +0.0°C, high =  +0.0°C)
Ambient:      +34.0°C  (low  =  +0.0°C, high =  +0.0°C)
Ambient:      +39.0°C  (low  =  +0.0°C, high =  +0.0°C)
Unknown:      +24.0°C  (low  =  +0.0°C, high =  +0.0°C)
Comment 98 Antonín Skala 2023-01-27 09:53:37 UTC
Just note, when running $ sensors, values from ddv are printed one at time with some delay. Values from other drivers přint immediately.
Comment 99 Armin Wolf 2023-01-27 10:06:06 UTC
How long is the delay?
Comment 100 Antonín Skala 2023-01-27 10:14:08 UTC
Unloaded:

real	0m0,034s
user	0m0,005s
sys	0m0,000s

Loaded:

real	0m2,560s
user	0m0,000s
sys	0m0,907s


Running sensors:

....
nvme-pci-e200
Adapter: PCI adapter
Composite:    +39.9°C  (low  = -60.1°C, high = +89.8°C)
                       (crit = +94.8°C)

dell_ddv-virtual-0
Adapter: Virtual device
(Printed immediately) 
(about one second Delay)
Video Fan:    975 RPM
(each line with small delay)
Video:        +47.0°C  (low  =  +0.0°C, high =  +0.0°C)

(Prints immediately)
iwlwifi_1-virtual-0
Adapter: Virtual device
temp1:        +33.0°C 
...
Comment 101 Armin Wolf 2023-01-27 10:25:24 UTC
Can you provide me with the value of "/sys/class/hwmon/<ddv hwmon device>/device/expensive"? Because this flag usually signals when certain WMI operations are expensive in regard to processing time.
I could then implement some caching logic if the problem is too severe.
Comment 102 Antonín Skala 2023-01-27 10:31:03 UTC
cat /sys/class/hwmon/hwmon7/device/expensive
0
Comment 103 Armin Wolf 2023-01-27 10:50:16 UTC
The reason for this delay is that the WMI interface only allows for querying all sensor values of all sensors present inside the system, so a single slow sensor slows down every single sensor read. The reason for this is that the firmware interface was likely designed for bulk data collection, not for individual sensor access (this could also be the reason why the expensive flag is not set).

Since the hwmon sysfs interface mandates individual sensor access, reading a single sensors requires reading all sensors. I will try to implement some caching logic so sequential reading of sensor values does not take 2 seconds anymore.

Does reading the sensors cause some sort of stuttering (audio lag, input lag, ..)?
Comment 104 Antonín Skala 2023-01-27 14:02:15 UTC
Nothing hearable or visible.
Comment 105 Armin Wolf 2023-01-27 14:26:05 UTC
Nice, this means that likely no faulty SMM handler is causing this delay, otherwise the whole machine would freeze for ~1 second.

I will modify the driver to cache the sensor buffers for a certain amount of time, this should lessen the impact of the slow sensor speed.
Comment 106 Armin Wolf 2023-02-04 00:25:06 UTC
Created attachment 303684 [details]
Second iteration of the dell-wmi-ddv driver with hwmon support
Comment 107 Armin Wolf 2023-02-04 00:25:52 UTC
The patch series got only partially merged, i was asked change the hwmon part a bit.
The changes are:
- introduce sensor buffer caching (should speed up sensors and other tools)
- fix sensor buffer handling
- proper Kconfig handling
- style fixes

Can you guys please test the driver on your machines again?

Armin Wolf
Comment 108 Antonín Skala 2023-02-04 22:00:17 UTC
Yes, this is much better.

Unloaded:
real	0m0,031s
user	0m0,000s
sys	0m0,006s

Loaded:
real	0m0,109s
user	0m0,000s
sys	0m0,030s
Comment 109 Armin Wolf 2023-02-04 22:18:42 UTC
Great to hear.

I am going to submit the necessary patches soon.
Comment 110 Armin Wolf 2023-02-05 19:30:18 UTC
Created attachment 303696 [details]
Second iteration of the dell-wmi-ddv driver with hwmon support

Now with fixed locking.
Comment 111 Armin Wolf 2023-02-05 19:31:38 UTC
And i found an potential issue inside the new caching code.
Comment 112 Armin Wolf 2023-02-05 19:49:07 UTC
Could you please test again?
Comment 113 Antonín Skala 2023-02-05 19:54:06 UTC
Sure, no noticeable lag, sensors values are changing each sensors run.
Seems Ok.


Loaded:
real	0m0,106s
user	0m0,000s
sys	0m0,029s

Unloaded:
real	0m0,031s
user	0m0,000s
sys	0m0,006s
Comment 114 Armin Wolf 2023-02-07 00:24:40 UTC
Created attachment 303702 [details]
Second iteration of the dell-wmi-ddv driver with hwmon support

Now with fixed suspend/resume handling.
Comment 115 Armin Wolf 2023-02-07 00:26:42 UTC
I found just another issue when suspending and resuming the driver.
I also enabled async probing to speed up booting on machines with slow sensor reads.

Can you guys test the suspend/resume behavior of the updated driver?
Comment 116 Antonín Skala 2023-02-09 11:25:20 UTC
Resume/suspend seems ok. Nothing odd shown in dmesg, and laptop sleep/wakes up as always.
Comment 117 Armin Wolf 2023-02-28 13:37:22 UTC
The necessary changes are now slated to be included in the upcoming 6.3 release.
Thank you all for testing the patches.
Comment 118 Armin Wolf 2023-03-21 18:17:29 UTC
Created attachment 303996 [details]
Experimental Legacy-Diag-over-WMI driver

Experimental driver for issuing legacy diagnostic SMM calls over WMI.
Comment 119 Armin Wolf 2023-03-21 18:21:18 UTC
While doing some ACPI research on my Dell notebook, i found another previously unknown WMI interface. It seems this interface can be used to issue SMM calls to access fan and temperature sensors, just like the dell-smm-hwmon driver.

Can you compile and load the dell-diag-wmi module and report if any dmesg messages appear?
Comment 120 Pali Rohár 2023-03-21 18:33:16 UTC
Interesting... Could you upload WDG and BMF buffers of your WMI interface? There can be something more interested in it (parse them via wmidump and bmfdec).
Comment 121 Armin Wolf 2023-03-21 18:48:53 UTC
Created attachment 303997 [details]
Inspiron 3505 ACPI tables
Comment 122 Armin Wolf 2023-03-21 18:53:40 UTC
Description of WMI interface:

Warning: Instance of class is not supported yet
Warning: Instance of class is not supported yet
Warning: Instance of class is not supported yet
Warning: Instance of class is not supported yet
Warning: Instance of class is not supported yet
Warning: Instance of class is not supported yet
#pragma namespace("\\\\.\\root\\dcim\\sysman\\diagnostics")
[WMI, Provider("Provider_DiagnosticsServices"), Dynamic, Locale("MS\\0x409"), Description("RunDellDiag"), guid("{F1DDEE52-063C-4784-A11E-8A06684B9B01}")]
class LegacyDiags {
  [key, read] string InstanceName;
  [read] boolean Active;

  [WmiMethodId(1), Implemented, read, write, Description("Legacy Method ")] void Execute([in, out] uint32 EaxLen, [in, out, WmiSizeIs("EaxLen") : ToInstance] uint8 EaxVal[], [in, out] uint32 EbxLen, [in, out, WmiSizeIs("EbxLen") : ToInstance] uint8 EbxVal[], [in, out] uint32 EcxLen, [in, out, WmiSizeIs("EcxLen") : ToInstance] uint8 EcxVal[], [in, out] uint32 EdxLen, [in, out, WmiSizeIs("EdxLen") : ToInstance] uint8 EdxVal[]);
};`
Comment 123 Antonín Skala 2023-05-09 08:09:35 UTC
Hi, I just got hands on kernel 6.3.1. DDV works great in sensors and are quite fast. Thank You

real	0m0,100s
user	0m0,001s
sys	0m0,026s
Comment 124 Armin Wolf 2023-05-09 16:41:07 UTC
Great to hear. You may mark this bug report as resolved then.

Note You need to log in before you can comment on or make changes to this bug.