public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
From: Patrick Venture <venture@google.com>
To: venture@google.com, joel@jms.id.au, linux@roeck-us.net
Cc: linux-hwmon@vger.kernel.org, raltherr@google.com
Subject: [PATCH] hwmon: (aspeed-pwm-tacho) reduce fan_tach period
Date: Tue, 20 Jun 2017 14:41:35 -0700	[thread overview]
Message-ID: <20170620214135.195572-1-venture@google.com> (raw)

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.

Signed-off-by: Patrick Venture <venture@google.com>
---
 drivers/hwmon/aspeed-pwm-tacho.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-tacho.c
index 48403a2115be..9b0796ead21d 100644
--- a/drivers/hwmon/aspeed-pwm-tacho.c
+++ b/drivers/hwmon/aspeed-pwm-tacho.c
@@ -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 {
-- 
2.13.1.518.g3df882009-goog


                 reply	other threads:[~2017-06-20 21:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170620214135.195572-1-venture@google.com \
    --to=venture@google.com \
    --cc=joel@jms.id.au \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=raltherr@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox