@@ -174,6 +174,7 @@ static int __cpuidle_cooling_register(struct device_node *np,
struct idle_inject_device *ii_dev;
struct cpuidle_cooling_device *idle_cdev;
struct thermal_cooling_device *cdev;
+ unsigned int entry_latency_us;
unsigned int idle_duration_us = TICK_USEC;
unsigned int latency_us = UINT_MAX;
char dev_name[THERMAL_NAME_LENGTH];
@@ -198,7 +199,9 @@ static int __cpuidle_cooling_register(struct device_node *np,
}
of_property_read_u32(np, "duration-us", &idle_duration_us);
- of_property_read_u32(np, "exit-latency-us", &latency_us);
+ if (!of_property_read_u32(np, "entry-latency-us", &entry_latency_us) &&
+ idle_duration_us > entry_latency_us)
+ latency_us = idle_duration_us - entry_latency_us;
idle_inject_set_duration(ii_dev, TICK_USEC, idle_duration_us);
idle_inject_set_latency(ii_dev, latency_us);