Re: [PATCH v3 0/2] platform/x86: toshiba_acpi: HWMON Fan RPM support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 9/2/22 19:40, Arvid Norlander wrote:
> Hi,
> 
> Lets hope for third time being the charm!
> 
> Changelog
> =========
> v2: Fixed feedback on usage of HWMON interfaces in patch 2.
> v3: Fixed #ifdef handling in patch 2.
> 
> Fan
> ===
> 
> Currently /sys/bus/acpi/devices/TOS6208:00/fan allows controlling the fan
> by writing 0 (off) or 1 (on at low speed). However when reading I have
> observed values up to 64 (fan at full speed during prime95 stress test).
> 
> Removing the check for "zero or one" shows that on the Z830 at least 64
> levels do indeed seem possible. In fact higher values can be written.
> 
> But anything above ~50 seems to max out the RPM.
> 
> I don't know how to detect the supported range, so I have not created a
> patch for this. Advice is welcome.
> 
> 
> Fan RPM
> =======
> 
> There is a way to read Fan RPM:
> 
> #define HCI_FAN_RPM 0x45
> 
> This one is weird. On windows I have observed the cooling self test program
> (which supposedly verifies that the cooling is working correctly) calling
> this a few different ways. Here is a summary of what I managed to figure
> out:
> 
> HCI_SET, 0x45, 0, 1, 0, 0: This sets the fan to run at max speed, but it
> will not be visible when reading /sys/bus/acpi/devices/TOS6208:00/fan.
> I will refer to this operation as "set-max-fan" below.
> 
> The only way I found to stop it running at max RPM is to use HCI_FAN
> (e.g. 0 > /sys/bus/acpi/devices/TOS6208:00/fan or call the ACPI method
> directly).
> 
> However the get method is more interesting:
> 
> HCI_GET, 0x45, 0, 1, 0, 0 returns: {0x0, 0x45, fan_rpm, 0x1db0, 0x0, 0x0}
> 
> I believe fan_rpm is accurate, without any scaling factors needed:
> * It behaves properly (higher value when fan is louder/faster/higher
>   pitched, 0 when fan is off).
> * It matches the value range reported by HwInfo64 on Windows (which seems
>   to be able to read this, I have not looked into how it does that).
> * Unfortunately there is no tool by Toshiba that exposes the numerical
>   value that I can find (that would have been ideal). Nor is it shown in
>   BIOS. The Windows tools "Toshiba PC Health Monitor" reports everything in
>   percentages. Yes even the temperatures!
> * It is definitely a loud and whiny fan, even by laptop standards, so the
>   high reported RPM range of 3540-7600 RPM could make sense. Though it did
>   seem a bit high.
> * Finally, to be sure, I borrowed a tachometer from work. Yes, the fan
>   really spins that fast. Byt it is only 30 mm, so I guess that makes
>   sense.
> 
> HCI_GET 0x45, 0, 0, 0, 0 returns: {0x0, 0x45, fan_rpm, 0x0, 0x0, 0x0}
> 
> The Windows software does *not* use this variant as far as I have observed.
> It appears to work the same except that it doesn't return 0x1db0 in index 3.
> 
> I'm not sure, but I strongly suspect 0x1db0 could be the max RPM (7600).
> The most I have observed when using "set-max-fan" is 0x1da6 (7590 RPM),
> which is very close. Note that this is significantly more than I can get
> using just HCI_FAN, which seems to max out at 0x17ac (6060 RPM).
> 
> 
> Patches
> =======
> 
> I'm not personally particularly interested in user space control of fan
> speed, plus the fact that there is a way to make the fan go faster than
> the *other* max speed makes me wonder about the safety of running the fan
> at that speed for prolonged periods of time. Thus, I have only added a
> read-only hwmon interface for reading the fan RPM.
> 
> I elected to use the same call that the Windows code does, which fetches
> what I believe is the max RPM. I think it is safer to stay as close as
> possible to that code. However I don't currently make use of this value,
> suggestions for where to use it are welcome.
> 
> Note! I assume that if the FAN RPM call do not result in an error, that
> it is in fact supported. This may not be true. I would welcome testing by
> anyone who owns a Toshiba laptop!
> 
> Best regards,
> Arvid Norlander
> 
> Arvid Norlander (2):
>   platform/x86: toshiba_acpi: Add fan RPM reading (internals)
>   platform/x86: toshiba_acpi: Add fan RPM reading (hwmon interface)

Thank you for your patch-series, I've applied the series to my
review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.

Regards,

Hans






[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux