All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon: (aspeed-pwm-tacho) increase fan tach period (again)
@ 2022-07-14 14:23 ` Paul Fertser
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Fertser @ 2022-07-14 14:23 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Joel Stanley, Patrick Venture
  Cc: Andrew Jeffery, linux-hwmon, linux-arm-kernel, linux-aspeed,
	linux-kernel, Paul Fertser

The old value allows measuring fan speeds down to about 970 RPM and
gives timeout for anything less than that. It is problematic because it
can also be used as an indicator for fan failure or absence.

Despite having read the relevant section of "ASPEED AST2500/AST2520 A2
Datasheet – V1.7" multiple times I wasn't able to figure out what
exactly "fan tach period" and "fan tach falling point of period" mean
(both are set by the driver from the constant this patch is amending).

Experimentation with a Tioga Pass OCP board (AST2500 BMC) showed that
value of 0x0108 gives time outs for speeds below 1500 RPM and the value
offered by the patch is good for at least 750 RPM (the fans can't spin
any slower so the lower bound is unknown). Measuring with the fans
spinning takes about 30 ms, sometimes down to 18 ms, so about the same
as with the previous value.

This constant was last changed in
762b1e88801357770889d013c5d20fe110d1f456.

Signed-off-by: Paul Fertser <fercerpav@gmail.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 3cb88d6fbec0..d11f674e3dc3 100644
--- a/drivers/hwmon/aspeed-pwm-tacho.c
+++ b/drivers/hwmon/aspeed-pwm-tacho.c
@@ -159,7 +159,7 @@
  * 11: reserved.
  */
 #define M_TACH_MODE 0x02 /* 10b */
-#define M_TACH_UNIT 0x0210
+#define M_TACH_UNIT 0x0420
 #define INIT_FAN_CTRL 0xFF
 
 /* How long we sleep in us while waiting for an RPM result. */
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] hwmon: (aspeed-pwm-tacho) increase fan tach period (again)
@ 2022-07-14 14:23 ` Paul Fertser
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Fertser @ 2022-07-14 14:23 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Joel Stanley, Patrick Venture
  Cc: Andrew Jeffery, linux-hwmon, linux-arm-kernel, linux-aspeed,
	linux-kernel, Paul Fertser

The old value allows measuring fan speeds down to about 970 RPM and
gives timeout for anything less than that. It is problematic because it
can also be used as an indicator for fan failure or absence.

Despite having read the relevant section of "ASPEED AST2500/AST2520 A2
Datasheet – V1.7" multiple times I wasn't able to figure out what
exactly "fan tach period" and "fan tach falling point of period" mean
(both are set by the driver from the constant this patch is amending).

Experimentation with a Tioga Pass OCP board (AST2500 BMC) showed that
value of 0x0108 gives time outs for speeds below 1500 RPM and the value
offered by the patch is good for at least 750 RPM (the fans can't spin
any slower so the lower bound is unknown). Measuring with the fans
spinning takes about 30 ms, sometimes down to 18 ms, so about the same
as with the previous value.

This constant was last changed in
762b1e88801357770889d013c5d20fe110d1f456.

Signed-off-by: Paul Fertser <fercerpav@gmail.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 3cb88d6fbec0..d11f674e3dc3 100644
--- a/drivers/hwmon/aspeed-pwm-tacho.c
+++ b/drivers/hwmon/aspeed-pwm-tacho.c
@@ -159,7 +159,7 @@
  * 11: reserved.
  */
 #define M_TACH_MODE 0x02 /* 10b */
-#define M_TACH_UNIT 0x0210
+#define M_TACH_UNIT 0x0420
 #define INIT_FAN_CTRL 0xFF
 
 /* How long we sleep in us while waiting for an RPM result. */
-- 
2.32.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] hwmon: (aspeed-pwm-tacho) increase fan tach period (again)
  2022-07-14 14:23 ` Paul Fertser
@ 2022-07-15 23:34   ` Guenter Roeck
  -1 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2022-07-15 23:34 UTC (permalink / raw)
  To: Paul Fertser
  Cc: Jean Delvare, Joel Stanley, Patrick Venture, Andrew Jeffery,
	linux-hwmon, linux-arm-kernel, linux-aspeed, linux-kernel

On Thu, Jul 14, 2022 at 05:23:44PM +0300, Paul Fertser wrote:
> The old value allows measuring fan speeds down to about 970 RPM and
> gives timeout for anything less than that. It is problematic because it
> can also be used as an indicator for fan failure or absence.
> 
> Despite having read the relevant section of "ASPEED AST2500/AST2520 A2
> Datasheet – V1.7" multiple times I wasn't able to figure out what
> exactly "fan tach period" and "fan tach falling point of period" mean
> (both are set by the driver from the constant this patch is amending).
> 
> Experimentation with a Tioga Pass OCP board (AST2500 BMC) showed that
> value of 0x0108 gives time outs for speeds below 1500 RPM and the value
> offered by the patch is good for at least 750 RPM (the fans can't spin
> any slower so the lower bound is unknown). Measuring with the fans
> spinning takes about 30 ms, sometimes down to 18 ms, so about the same
> as with the previous value.
> 
> This constant was last changed in
> 762b1e88801357770889d013c5d20fe110d1f456.
> 
> Signed-off-by: Paul Fertser <fercerpav@gmail.com>

Patrick - any feedback ? Would it be possible to test this change with
Quanta-q71l ? Or do you envision no problems ?

Thanks,
Guenter

> ---
>  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 3cb88d6fbec0..d11f674e3dc3 100644
> --- a/drivers/hwmon/aspeed-pwm-tacho.c
> +++ b/drivers/hwmon/aspeed-pwm-tacho.c
> @@ -159,7 +159,7 @@
>   * 11: reserved.
>   */
>  #define M_TACH_MODE 0x02 /* 10b */
> -#define M_TACH_UNIT 0x0210
> +#define M_TACH_UNIT 0x0420
>  #define INIT_FAN_CTRL 0xFF
>  
>  /* How long we sleep in us while waiting for an RPM result. */

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] hwmon: (aspeed-pwm-tacho) increase fan tach period (again)
@ 2022-07-15 23:34   ` Guenter Roeck
  0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2022-07-15 23:34 UTC (permalink / raw)
  To: Paul Fertser
  Cc: Jean Delvare, Joel Stanley, Patrick Venture, Andrew Jeffery,
	linux-hwmon, linux-arm-kernel, linux-aspeed, linux-kernel

On Thu, Jul 14, 2022 at 05:23:44PM +0300, Paul Fertser wrote:
> The old value allows measuring fan speeds down to about 970 RPM and
> gives timeout for anything less than that. It is problematic because it
> can also be used as an indicator for fan failure or absence.
> 
> Despite having read the relevant section of "ASPEED AST2500/AST2520 A2
> Datasheet – V1.7" multiple times I wasn't able to figure out what
> exactly "fan tach period" and "fan tach falling point of period" mean
> (both are set by the driver from the constant this patch is amending).
> 
> Experimentation with a Tioga Pass OCP board (AST2500 BMC) showed that
> value of 0x0108 gives time outs for speeds below 1500 RPM and the value
> offered by the patch is good for at least 750 RPM (the fans can't spin
> any slower so the lower bound is unknown). Measuring with the fans
> spinning takes about 30 ms, sometimes down to 18 ms, so about the same
> as with the previous value.
> 
> This constant was last changed in
> 762b1e88801357770889d013c5d20fe110d1f456.
> 
> Signed-off-by: Paul Fertser <fercerpav@gmail.com>

Patrick - any feedback ? Would it be possible to test this change with
Quanta-q71l ? Or do you envision no problems ?

Thanks,
Guenter

> ---
>  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 3cb88d6fbec0..d11f674e3dc3 100644
> --- a/drivers/hwmon/aspeed-pwm-tacho.c
> +++ b/drivers/hwmon/aspeed-pwm-tacho.c
> @@ -159,7 +159,7 @@
>   * 11: reserved.
>   */
>  #define M_TACH_MODE 0x02 /* 10b */
> -#define M_TACH_UNIT 0x0210
> +#define M_TACH_UNIT 0x0420
>  #define INIT_FAN_CTRL 0xFF
>  
>  /* How long we sleep in us while waiting for an RPM result. */

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] hwmon: (aspeed-pwm-tacho) increase fan tach period (again)
  2022-07-14 14:23 ` Paul Fertser
@ 2022-07-21  3:49   ` Guenter Roeck
  -1 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2022-07-21  3:49 UTC (permalink / raw)
  To: Paul Fertser
  Cc: Jean Delvare, Joel Stanley, Patrick Venture, Andrew Jeffery,
	linux-hwmon, linux-arm-kernel, linux-aspeed, linux-kernel

On Thu, Jul 14, 2022 at 05:23:44PM +0300, Paul Fertser wrote:
> The old value allows measuring fan speeds down to about 970 RPM and
> gives timeout for anything less than that. It is problematic because it
> can also be used as an indicator for fan failure or absence.
> 
> Despite having read the relevant section of "ASPEED AST2500/AST2520 A2
> Datasheet – V1.7" multiple times I wasn't able to figure out what
> exactly "fan tach period" and "fan tach falling point of period" mean
> (both are set by the driver from the constant this patch is amending).
> 
> Experimentation with a Tioga Pass OCP board (AST2500 BMC) showed that
> value of 0x0108 gives time outs for speeds below 1500 RPM and the value
> offered by the patch is good for at least 750 RPM (the fans can't spin
> any slower so the lower bound is unknown). Measuring with the fans
> spinning takes about 30 ms, sometimes down to 18 ms, so about the same
> as with the previous value.
> 
> This constant was last changed in
> 762b1e88801357770889d013c5d20fe110d1f456.
> 
> Signed-off-by: Paul Fertser <fercerpav@gmail.com>

I did not get any further feedback, so:

Applied to linux-next.

Thanks,
Guenter

> ---
>  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 3cb88d6fbec0..d11f674e3dc3 100644
> --- a/drivers/hwmon/aspeed-pwm-tacho.c
> +++ b/drivers/hwmon/aspeed-pwm-tacho.c
> @@ -159,7 +159,7 @@
>   * 11: reserved.
>   */
>  #define M_TACH_MODE 0x02 /* 10b */
> -#define M_TACH_UNIT 0x0210
> +#define M_TACH_UNIT 0x0420
>  #define INIT_FAN_CTRL 0xFF
>  
>  /* How long we sleep in us while waiting for an RPM result. */

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] hwmon: (aspeed-pwm-tacho) increase fan tach period (again)
@ 2022-07-21  3:49   ` Guenter Roeck
  0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2022-07-21  3:49 UTC (permalink / raw)
  To: Paul Fertser
  Cc: Jean Delvare, Joel Stanley, Patrick Venture, Andrew Jeffery,
	linux-hwmon, linux-arm-kernel, linux-aspeed, linux-kernel

On Thu, Jul 14, 2022 at 05:23:44PM +0300, Paul Fertser wrote:
> The old value allows measuring fan speeds down to about 970 RPM and
> gives timeout for anything less than that. It is problematic because it
> can also be used as an indicator for fan failure or absence.
> 
> Despite having read the relevant section of "ASPEED AST2500/AST2520 A2
> Datasheet – V1.7" multiple times I wasn't able to figure out what
> exactly "fan tach period" and "fan tach falling point of period" mean
> (both are set by the driver from the constant this patch is amending).
> 
> Experimentation with a Tioga Pass OCP board (AST2500 BMC) showed that
> value of 0x0108 gives time outs for speeds below 1500 RPM and the value
> offered by the patch is good for at least 750 RPM (the fans can't spin
> any slower so the lower bound is unknown). Measuring with the fans
> spinning takes about 30 ms, sometimes down to 18 ms, so about the same
> as with the previous value.
> 
> This constant was last changed in
> 762b1e88801357770889d013c5d20fe110d1f456.
> 
> Signed-off-by: Paul Fertser <fercerpav@gmail.com>

I did not get any further feedback, so:

Applied to linux-next.

Thanks,
Guenter

> ---
>  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 3cb88d6fbec0..d11f674e3dc3 100644
> --- a/drivers/hwmon/aspeed-pwm-tacho.c
> +++ b/drivers/hwmon/aspeed-pwm-tacho.c
> @@ -159,7 +159,7 @@
>   * 11: reserved.
>   */
>  #define M_TACH_MODE 0x02 /* 10b */
> -#define M_TACH_UNIT 0x0210
> +#define M_TACH_UNIT 0x0420
>  #define INIT_FAN_CTRL 0xFF
>  
>  /* How long we sleep in us while waiting for an RPM result. */

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-07-21  3:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-14 14:23 [PATCH] hwmon: (aspeed-pwm-tacho) increase fan tach period (again) Paul Fertser
2022-07-14 14:23 ` Paul Fertser
2022-07-15 23:34 ` Guenter Roeck
2022-07-15 23:34   ` Guenter Roeck
2022-07-21  3:49 ` Guenter Roeck
2022-07-21  3:49   ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.