Open rmanosuthi opened 5 years ago
I've seen exactly the same behavior with my UV32VD zenbook and have to the slightest idea why this is happening, in fact, and I've also looked into this earlier, simply the rpm outputs are garbage, thus the module avoids it's initialization.
as a quick hack you might simply try removing the rpm checks (your log even shows that the first try for fan1 works but not for fan2, then both do not work, then again 1 and not 2, finally both work and the module inits.
Sooo, if you remove like this: https://github.com/daringer/asus-fan/blob/47bcbe4bd3e2a2227535bb69ff6517a96b0a993e/asus_fan.c#L922 and this: https://github.com/daringer/asus-fan/blob/47bcbe4bd3e2a2227535bb69ff6517a96b0a993e/asus_fan.c#L938 if-clause, you might overcome this error and the module should always load (because the check afterwards never fails in your log)...
pretty hacky, but make it an parameter for the module during insmod and I'll happily take it in with a pull-request...
Happy to look into this one as I have the same line of laptop.
fix merged, thank you @savisitor15
The G752VT have the 0 RPM and DISABLE FAN. When we get -1, this mean it's disabled.
If you're running the latest build you can simply give it the module parameter: force_rpm_override=1 It's like a force_load=1 but just slightly lighter.
the issue is the ACPI driver, it sometimes returns hex(ff) for the fan speed, even though it does actually report there being a fan.
@daringer YET about this device ASUS G752VT ( Maybe variants).
They work well, both fan's are recognized besides we need to use the
Comments means we dont have YET this working? Thank you!
More about my findings.. I'm trying to debug what is wrong ( OBS: I'm not versed in C. ):
if (asus_data.variant == ASUS_FAN_HW_G752VT)
{
dbg_msg("|--> evaluate acpi request: \\_SB.PCI0.LPCB.EC0.TH0R");
ret = acpi_evaluate_integer(NULL, "\\_SB.PCI0.LPCB.EC0.TH0R", NULL, &value);
dbg_msg("|--> acpi request returned: %s", acpi_format_exception(ret));
dbg_msg("|--> acpi request returned value: %d", value);
}
else
{
dbg_msg("|--> evaluate acpi request: \\_SB.PCI0.LPCB.EC0.TH1R");
ret = acpi_evaluate_integer(NULL, "\\_SB.PCI0.LPCB.EC0.TH1R", NULL, &value);
dbg_msg("|--> acpi request returned: %s", acpi_format_exception(ret));
dbg_msg("|--> acpi request returned value: %d", value);
}
if (ret != AE_OK) {
err_msg("read_temp", "failed reading temperature, errcode: %s",
acpi_format_exception(ret));
return ret;
}
size = sprintf((char *)&buf, "%llu\n", value);
dbg_msg("|--> size: %d", size);
return size;
}
static ssize_t temp1_label(struct device *dev, struct device_attribute *attr,
char *buf) {
dbg_msg("|--> TEMP1_LABEL: %s", sprintf(buf, "%s\n", TEMP1_LABEL));
return sprintf(buf, "%s\n", TEMP1_LABEL);
}
static ssize_t temp1_crit(struct device *dev, struct device_attribute *attr,
char *buf) {
dbg_msg("|--> TEMP1_CRIT: %d", sprintf(buf, "%d\n", TEMP1_CRIT));
return sprintf(buf, "%d\n", TEMP1_CRIT);
}
I GET this return.
[ 5825.433348] asus-fan (debug) - |--> TEMP1_LABEL: (efault)
[ 5825.433378] asus-fan (debug) - temp-id: 1 | get (acpi eval)
[ 5825.433379] asus-fan (debug) - |--> evaluate acpi request: \_SB.PCI0.LPCB.EC0.TH0R
[ 5825.433866] asus-fan (debug) - |--> acpi request returned: AE_OK
[ 5825.433869] asus-fan (debug) - |--> acpi request returned value: 58
[ 5825.433871] asus-fan (debug) - |--> size: 3
[ 5825.433940] asus-fan (debug) - |--> TEMP1_CRIT: 4
for some reason I cant get this values passed to;
if (temp != AE_OK) {
err_msg("init", "temperature read probe failed");
} else {
info_msg("init", "temp-id: 1 | success getting temp");
hwmon_attrs[11] = &dev_attr_temp1_input.attr;
hwmon_attrs[12] = &dev_attr_temp1_label.attr;
hwmon_attrs[13] = &dev_attr_temp1_crit.attr;
}
So! Can you or someone help me to debug this in a better way? I have a lot of free time and the device to test.
ok, took some time, but at least have some ideas/clarifications:
#define
const is writtenTEMP1_CRIT
seems to be 4 (as you pasted) this feels broken, guess it is #defined as 105asus_data.variant
as you've already done, then the sprintf()-call will write the temperature as %llu
into buf
(which represents the output seen on cat .../hwmonX/temp1_input
) input1_temp
is available within the hwmon-files
or leaves hwmon_attrs[11...13]
equal to NULL
in order to not show it.Ok so far about the concepts here, to make it work I would propose trying the following:
hwmon_attrs[...]
lines will always be executed, here I would expect that all should work for your machine (at least from what is shown in your dmesg
output)Just checked the current master for now @HorstBaerbel 's restructuring will ease these discussions massively... so running to review it
Hello @daringer ! I'm back from the cave after my first report... The project still under development?
So! Now I'm using another model from Asus ROG. the GT 752VY ( basically the same from previous report) Only the vk and VSK variant are different.
The system still not report the correct temperature. My actual findings:
Using the original code just changing the \\_SB.PCI0.LPCB.EC0.TH1R
to \\_SB.PCI0.LPCB.EC0.TH0R
and add the dbg_msg("|--> size: %llu\n", value);
dbg_msg("|--> TEMP1_LABEL: %s\n", TEMP1_LABEL);
dbg_msg("|--> TEMP1_CRIT %d\n", TEMP1_CRIT);
to receive some debug:
static ssize_t temp1_input(struct device *dev, struct device_attribute *attr,
char *buf) {
acpi_status ret;
unsigned long long int value;
ssize_t size = 0;
dbg_msg("temp-id: 1 | get (acpi eval)");
// acpi call
ret = acpi_evaluate_integer(NULL, "\\_SB.PCI0.LPCB.EC0.TH1R", NULL, &value);
if (ret != AE_OK) {
err_msg("read_temp", "failed reading temperature, errcode: %s",
acpi_format_exception(ret));
return ret;
}
size = sprintf((char *)&buf, "%llu\n", value);
dbg_msg("|--> size: %llu\n", size);
return size;
}
static ssize_t temp1_label(struct device *dev, struct device_attribute *attr,
char *buf) {
dbg_msg("|--> TEMP1_LABEL: %s\n", TEMP1_LABEL);
return sprintf(buf, "%s\n", TEMP1_LABEL);
}
static ssize_t temp1_crit(struct device *dev, struct device_attribute *attr,
char *buf) {
dbg_msg("|--> TEMP1_CRIT %d\n", TEMP1_CRIT);
return sprintf(buf, "%d\n", TEMP1_CRIT);
}
I'm receiving this result:
asus-fan (debug) - |--> acpi request returned: AE_OK
asus-fan (debug) - fan-id: 1 | get RPM
asus-fan (debug) - fan-id: 1 | get control state
asus-fan (debug) - |--> TEMP1_CRIT 105
asus-fan (debug) - temp-id: 1 | get (acpi eval)
asus-fan (debug) - |--> size: 3
asus-fan (debug) - |--> TEMP1_LABEL: gfx_temp
and inside sensors:
CPU Fan: 1832 RPM (min = 11 RPM, max = 256 RPM)
GFX Fan: 1672 RPM (min = 11 RPM, max = 256 RPM)
gfx_tem: N/A (crit = +0.1°C)
Why we are using size = sprintf((char *)&buf, "%llu\n", value);
? We get just the SIZE from the value and not the Temperature value by itself.
I'm missing something?
After change the line size = sprintf((char *)&buf, "%llu\n", value);
to size = sprintf(buf, "%llu\n", value);
the result change to
asus-fan (debug) - |--> TEMP1_CRIT 105
asus-fan (debug) - temp-id: 1 | get (acpi eval)
asus-fan (debug) - |--> ret: 0
asus-fan (debug) - |--> size: 73
asus-fan (debug) - |--> TEMP1_LABEL: gfx_temp
and inside sensors:
CPU Fan: 2823 RPM (min = 11 RPM, max = 256 RPM)
GFX Fan: 1672 RPM (min = 11 RPM, max = 256 RPM)
gfx_temp: +0.1°C (crit = +0.1°C)
Thank you again.
Hello,
I'm having a very strange problem with this module... sometimes the fans are recognized in
sensors
and/sys/class/hwmon/hwmonX
but sometimes they aren't. NBFC reliably works with this laptop for reference.Here's the dmesg log (I manually unloaded and reloaded it multiple times)
asus-wmi is not loaded. Even when it's loaded the same behaviour applies.
Here's my current kernel config since I'm on Gentoo config-4.19.3-gentoo.txt