* [PATCH v1] cpuidle: driver: Update microsecond values of state parameters as needed
@ 2023-02-07 19:59 Rafael J. Wysocki
2023-02-09 18:16 ` Artem Bityutskiy
0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2023-02-07 19:59 UTC (permalink / raw)
To: Linux PM; +Cc: LKML, Zhang Rui, Artem Bityutskiy
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
If the cpuidle driver provides the target residency and exit latency in
nanoseconds, the corresponding values in microseconds need to be set to
reflect the provided numbers in order for the sysfs interface to show
them correctly, so make __cpuidle_driver_init() do that.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/cpuidle/driver.c | 4 ++++
1 file changed, 4 insertions(+)
Index: linux-pm/drivers/cpuidle/driver.c
===================================================================
--- linux-pm.orig/drivers/cpuidle/driver.c
+++ linux-pm/drivers/cpuidle/driver.c
@@ -183,11 +183,15 @@ static void __cpuidle_driver_init(struct
s->target_residency_ns = s->target_residency * NSEC_PER_USEC;
else if (s->target_residency_ns < 0)
s->target_residency_ns = 0;
+ else
+ s->target_residency = s->target_residency_ns / NSEC_PER_USEC;
if (s->exit_latency > 0)
s->exit_latency_ns = s->exit_latency * NSEC_PER_USEC;
else if (s->exit_latency_ns < 0)
s->exit_latency_ns = 0;
+ else
+ s->exit_latency = s->exit_latency_ns / NSEC_PER_USEC;
}
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v1] cpuidle: driver: Update microsecond values of state parameters as needed
2023-02-07 19:59 [PATCH v1] cpuidle: driver: Update microsecond values of state parameters as needed Rafael J. Wysocki
@ 2023-02-09 18:16 ` Artem Bityutskiy
0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2023-02-09 18:16 UTC (permalink / raw)
To: Rafael J. Wysocki, Linux PM; +Cc: LKML, Zhang Rui
On Tue, 2023-02-07 at 20:59 +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> If the cpuidle driver provides the target residency and exit latency in
> nanoseconds, the corresponding values in microseconds need to be set to
> reflect the provided numbers in order for the sysfs interface to show
> them correctly, so make __cpuidle_driver_init() do that.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-09 18:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-07 19:59 [PATCH v1] cpuidle: driver: Update microsecond values of state parameters as needed Rafael J. Wysocki
2023-02-09 18:16 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox