Every access to the fan RPM(read/write) is provide an a freezes by the around 500ms Model: DMI: Dell Inc. Inspiron 7720/ , BIOS A17 05/19/2015 That I'm trying understand from where freezes hapend. This is read RPM value: [15567.022496] dell_smm_hwmon: i8k_hwmon_show_fan [15567.022499] dell_smm_hwmon: i8k_get_fan_speed 0 [15567.523122] dell_smm_hwmon: smm(0x02a3 0x0000) = 0x0a52 (took 488908 usecs) And write fan speed: [14494.740165] dell_smm_hwmon: smm(0x01a3 0x0200) = 0x0000 (took 489212 usecs) Fan control is work just fine at all, but the lags with SMP lock with 500ms isn't good. [root@dell-i7 ~]# sensors coretemp-isa-0000 Adapter: ISA adapter Package id 0: +41.0°C (high = +87.0°C, crit = +105.0°C) Core 0: +41.0°C (high = +87.0°C, crit = +105.0°C) Core 1: +41.0°C (high = +87.0°C, crit = +105.0°C) Core 2: +41.0°C (high = +87.0°C, crit = +105.0°C) Core 3: +34.0°C (high = +87.0°C, crit = +105.0°C) acpitz-virtual-0 Adapter: Virtual device temp1: +39.0°C (crit = +106.0°C) temp2: +39.0°C (crit = +106.0°C) dell_smm-virtual-0 Adapter: Virtual device Processor Fan: 3247 RPM CPU: +42.0°C Ambient: +32.0°C GPU: +31.0°C Other: +64.0°C Other values(such as temp) read isn't provied the lags, because the operation is took < 1000us
This looks like as another problem in Dell BIOS/firmware. Freeze is caused by SMM call implemented by Dell BIOS/firmware which is not under control of kernel. And therefore kernel cannot fix that call. If Dell does not fix it (which I doubt due to old machine) then the only way is to disable accessing processor fan on your machine based on DMI data. Please provide DMI data from these files, including whitespaces and special characters... /sys/class/dmi/id/sys_vendor /sys/class/dmi/id/product_name
I have seen this problem myself on older Dell machines. So far I just accepted it as a fact of life, but I agree - if people complain, the "fix" is really to take the functionality away. One option might be to take it away but add a module parameter to override the default. That might be useful anyway so people can disable fan speed reporting without having to recompile the kernel.
Yes, one way is blacklist that operation. Guenter Roeck says right, override is may useful for some people. Here is: [root@dell-i7 ~]# cat /sys/class/dmi/id/product_name | xxd 00000000: 496e 7370 6972 6f6e 2037 3732 300a Inspiron 7720. [root@dell-i7 ~]# cat /sys/class/dmi/id/sys_vendor | xxd 00000000: 4465 6c6c 2049 6e63 2e20 2020 2020 2020 Dell Inc. 00000010: 2020 0a
Created attachment 256637 [details] [PATCH 1/2] hwmon: (dell-smm) Enable broken functionality via "force" module param
Created attachment 256639 [details] [PATCH 2/2] hwmon: (dell-smm) Disable fan support for Dell Inspiron 7720
Try these two patches.
Created attachment 260809 [details] Replace DMI_EXACT_MATCH with DMI_MATCH in i8k_blacklist_fan_support_dmi_table
Created attachment 260811 [details] Replace DMI_EXACT_MATCH with DMI_MATCH in i8k_blacklist_fan_type_dmi_table
Created attachment 260813 [details] Add Dell Vostro 3360 to i8k_blacklist_fan_support_dmi_table
Confirming the same issue with Dell Vostro 3360. Also, confirming that disabling fan support eliminates freezes. I had to replace DMI_EXACT_MATCH with DMI_MATCH to make quirks work for me, otherwise DMI is not matched. Also, attaching a patch that adds Dell Vostro 3360 to i8k_blacklist_fan_support_dmi_table.
On Friday 24 November 2017 11:15:13 bugzilla-daemon@bugzilla.kernel.org wrote: > I had to replace DMI_EXACT_MATCH with DMI_MATCH to make quirks work > for me, otherwise DMI is not matched. Hi! Please use exact match, we do not want to match random machines with substrings in blacklist. If exact match did not worked, it means that you specified just substring of DMI string.
I believe, exact match didn't work because DMI vendor contains extra spaces: [~]$ cat /sys/class/dmi/id/sys_vendor | xxd 00000000: 4465 6c6c 2049 6e63 2e20 2020 2020 2020 Dell Inc. 00000010: 2020 0a . [~]$ i=`cat /sys/class/dmi/id/sys_vendor`; echo "'"$i"'" 'Dell Inc. '
On Friday 24 November 2017 11:20:10 bugzilla-daemon@bugzilla.kernel.org wrote: > --- Comment #12 from Oleksandr Natalenko (oleksandr@natalenko.name) --- > I believe, exact match didn't work because DMI vendor contains extra spaces: That is not truth, it would work. > [~]$ cat /sys/class/dmi/id/sys_vendor | xxd > 00000000: 4465 6c6c 2049 6e63 2e20 2020 2020 2020 Dell Inc. > 00000010: 2020 0a . > > [~]$ i=`cat /sys/class/dmi/id/sys_vendor`; echo "'"$i"'" > 'Dell Inc. ' You just need to include whole string as is with all spaces and special characters.
Created attachment 260815 [details] [PATCH] hwmon: (dell-smm) Disable fan support for Dell Vostro 3360 I had to specify vendor with all extra spaces to make DMI_EXACT_MATCH work.
(In reply to Oleksandr Natalenko from comment #14) > Created attachment 260815 [details] > [PATCH] hwmon: (dell-smm) Disable fan support for Dell Vostro 3360 First of all, why not to use DMI_MATCH() instead? Next, is about tags in the patch. Tested-by: is implied by author of the patch (otherwise the question how it was tested at all?!). Reported-by: makes not much sense if SoB (author) is the same person.
(In reply to Andy Shevchenko from comment #15) > First of all, why not to use DMI_MATCH() instead? Erm, citing Pali: | Please use exact match, we do not want to match | random machines with substrings in blacklist. This makes sense to me. > Next, is about tags in the patch. > > Tested-by: is implied by author of the patch (otherwise the question how it > was tested at all?!). > > Reported-by: makes not much sense if SoB (author) is the same person. Okay.
#16: I buy that for the machine name, but not for the manufacturer. It is just a little unlikely that there is a second Dell Inc. (with fewer spaces) around.
Created attachment 260831 [details] [PATCH] hwmon: (dell-smm) Disable fan support for Dell Vostro 3360 Taking into account comments posted above.
Created attachment 261239 [details] [PATCH] hwmon: (dell-smm) Disable fan support for Dell Vostro 3360 Added Reviewed-by as per ML discussion.
@Guenter Roeck will you process patches from this bugzilla ticket? Feel free to change DMI_EXACT_MATCH to DMI_MATCH. But because this problem was reported in 2017-05-13, it would be nice to have it fixed as patches already exist.
@Pali: You know how to submit patches for the upstream kernel, even more so since you are the maintainer of the affected driver. Maybe your expectation is that upstream maintainers pick patches from where-ever the submitter happens to send them to, but that is not how kernel development works, and you should know that. Please send any patches you want to see upstream to the hwmon mailing list and Cc: me, and I'll be happy to process them.
Fixed in 4.16 by blacklist
I might have the same issue with a Dell XPS13 9333. Reading "/sys/devices/virtual/hwmon/hwmon2/fan1_input" takes about 500ms and causes a short but noticeable lag/freeze. I've noticed it since some time ago when running "sensors" but I installed "tlp" recently and now I notice the lag more often at (seemingly) random times. Unfortunately, I'm not well-versed and do not know how to test if disabling fan support fixes the problem. I'm also cautious about what "taking functionality away" might mean. user@hostname:~$ strace -Ty -e read cat /sys/devices/virtual/hwmon/hwmon2/fan1_input read(3</lib/x86_64-linux-gnu/libc-2.26.so>, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\22\2\0\0\0\0\0"..., 832) = 832 <0.000017> read(3</sys/devices/virtual/hwmon/hwmon2/fan1_input>, "3692\n", 131072) = 5 <0.501844> 3692 read(3</sys/devices/virtual/hwmon/hwmon2/fan1_input>, "", 131072) = 0 <0.000013> +++ exited with 0 +++ user@hostname:~$ strace -Ty -e read sensors 2>&1 | grep fan1_input read(3</sys/devices/virtual/hwmon/hwmon2/fan1_input>, "3642\n", 4096) = 5 <0.501666> user@hostname:~$ sudo strace -Ty -e read tlp-stat 2>&1 | grep fan1_input read(0</sys/devices/virtual/hwmon/hwmon2/fan1_input>, "3", 1) = 1 <0.502211> read(0</sys/devices/virtual/hwmon/hwmon2/fan1_input>, "0", 1) = 1 <0.003049> read(0</sys/devices/virtual/hwmon/hwmon2/fan1_input>, "6", 1) = 1 <0.000996> read(0</sys/devices/virtual/hwmon/hwmon2/fan1_input>, "2", 1) = 1 <0.002996> read(0</sys/devices/virtual/hwmon/hwmon2/fan1_input>, "\n", 1) = 1 <0.000077> user@hostname:~$ cat /proc/version Linux version 4.13.0-43-generic (buildd@lgw01-amd64-026) (gcc version 7.2.0 (Ubuntu 7.2.0-8ubuntu3.2)) #48-Ubuntu SMP Wed May 16 12:18:48 UTC 2018 user@hostname:~$ sudo dmidecode -t 1,0 -q System Information Manufacturer: Dell Inc. Product Name: XPS13 9333 [...] BIOS Information Vendor: Dell Inc. Version: A08 Release Date: 08/31/2015 user@hostname:~$ cat /sys/class/dmi/id/sys_vendor Dell Inc. user@hostname:~$ cat /sys/class/dmi/id/product_name XPS13 9333
(In reply to inbox-kernelorg from comment #23) > I might have the same issue with a Dell XPS13 9333. > > Reading "/sys/devices/virtual/hwmon/hwmon2/fan1_input" takes about 500ms and > causes a short but noticeable lag/freeze. I've noticed it since some time > ago when running "sensors" but I installed "tlp" recently and now I notice > the lag more often at (seemingly) random times. > > Unfortunately, I'm not well-versed and do not know how to test if disabling > fan support fixes the problem. I'm also cautious about what "taking > functionality away" might mean. Shall you be able to compile the kernel and test things if the blacklisting patch is provided?
Created attachment 276303 [details] [PATCH] hwmon: (dell-smm) Disable fan support for Dell XPS13 9333 I hope I'm doing this right. After compiling the kernel with the attached changes, installing and rebooting, the file "/sys/devices/virtual/hwmon/hwmon2/fan1_input" doesn't exist anymore. No more freezes when running "sensors" and "tlp-stats". "sensors" doesn't report fan speed anymore, though. I guess that was the whole point. Otherwise, everything seems to be working as usual but I'll continue testing.
(In reply to Helge Eichelberg from comment #25) > Created attachment 276303 [details] > [PATCH] hwmon: (dell-smm) Disable fan support for Dell XPS13 9333 > > I hope I'm doing this right. > > After compiling the kernel with the attached changes, installing and > rebooting, the file "/sys/devices/virtual/hwmon/hwmon2/fan1_input" doesn't > exist anymore. No more freezes when running "sensors" and "tlp-stats". > "sensors" doesn't report fan speed anymore, though. I guess that was the > whole point. Otherwise, everything seems to be working as usual but I'll > continue testing. Yup, precisely. I was going to post exactly the same patch for you. Feel free to push it into the upstream, BTW.
#26: Yes, please post the patch upstream. Please don't forget to sign it.