]> www.infradead.org Git - users/willy/linux.git/commitdiff
cpuidle: use first valid target residency as poll time
authorMarcelo Tosatti <mtosatti@redhat.com>
Fri, 6 Dec 2019 15:07:41 +0000 (13:07 -0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 9 Dec 2019 09:37:16 +0000 (10:37 +0100)
Commit 259231a04561 ("cpuidle: add poll_limit_ns to cpuidle_device
structure") changed, by mistake, the target residency from the first
available sleep state to the last available sleep state (which should
be longer).

This might cause excessive polling.

Fixes: 259231a04561 ("cpuidle: add poll_limit_ns to cpuidle_device structure")
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Cc: 5.4+ <stable@vger.kernel.org> # 5.4+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpuidle/cpuidle.c

index 0005be5ea2b45f560a2a378a3c66b89354b3fb42..15877b4311438b924277d57adf14d62bc4aed6b3 100644 (file)
@@ -382,6 +382,7 @@ u64 cpuidle_poll_time(struct cpuidle_driver *drv,
                        continue;
 
                limit_ns = (u64)drv->states[i].target_residency_ns;
+               break;
        }
 
        dev->poll_limit_ns = limit_ns;