Skip to contentSkip to conversation

hwmon: (aspeed-pwm-tacho) reduce fan_tach period

PATCH Superseded Patrick Venture 1 participant 1 message Jun 20, 2017

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (aspeed-pwm-tacho) reduce fan_tach period

Through testing a variety of fan_tach values 0xc0 was found to provide ideal fan_tach read performance. The fans were also as responsive to speed changes as desired. This is part of a performance tweak for the responsiveness of the driver.

Tested: This was tested on the Quanta-Q71l.

Caveat: I found that if a fan is broken this fan_tach period is too short if used to get a reliable response and ETIMEDOUT will return. I also found that if I set a fan's PWM to below 30% it would have a similar issue returning the fan_tach. However, that was in combination with another patch that mimics the reference driver behavior that no longer sleeps. In our DCs, we never expect to run fans below this threshold and it increases the responsiveness of the read fan_tach response.

If suggested, we could move these knobs into device-trees or allow device-tree overrides to these defaults with very few edits.

---
 drivers/hwmon/aspeed-pwm-tacho.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/aspeed-pwm-tacho.c +1 -1
index 48403a2115be..9b0796ead21d 100644
@@ -150,7 +150,7 @@
 #define M_PWM_PERIOD 0x5F
 #define M_TACH_CLK_DIV 0x00
 #define M_TACH_MODE 0x00
-#define M_TACH_UNIT 0x1000
+#define M_TACH_UNIT 0x00c0
 #define INIT_FAN_CTRL 0xFF
 
 struct aspeed_pwm_tacho_data {
Signature · 1 line
2.13.1.518.g3df882009-goog