Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754561AbdGSXRg (ORCPT ); Wed, 19 Jul 2017 19:17:36 -0400 Received: from mail-it0-f42.google.com ([209.85.214.42]:35106 "EHLO mail-it0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753919AbdGSXR3 (ORCPT ); Wed, 19 Jul 2017 19:17:29 -0400 MIME-Version: 1.0 In-Reply-To: References: From: "Rafael J. Wysocki" Date: Thu, 20 Jul 2017 01:17:28 +0200 X-Google-Sender-Auth: P5WD_9pByT_07aEM_Mi76FqWBEI Message-ID: Subject: Re: cpuidle and cpufreq coupling? To: Florian Fainelli Cc: Linux Kernel Mailing List , Linux PM , Viresh Kumar , "Rafael J. Wysocki" , Markus Mayer , Daniel Lezcano Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1132 Lines: 29 On Thu, Jul 20, 2017 at 12:54 AM, Florian Fainelli wrote: > Hi, > > We have a particular ARM CPU design that is drawing quite a lot of > current upon exit from WFI, and it does so in a way even before the > first instruction out of WFI is executed. That means we cannot influence > directly the exit from WFI other than by changing the state in which it > would be previously entered because of this "dead" time during which the > internal logic needs to ramp up back where it left. > > A naive approach to solving this problem because we have CPU frequency > scaling available would be to do the following: > > - just before entering WFI, switch to a low frequency OPP > - enter WFI > - upon exit from WFI, ramp up the frequency back to e.g: highest OPP > > Some of the parts that I am not exactly clear on would be: > > - would that qualify as a cpuidle governor of some kind that ties in > which cpufreq? > - would using cpufreq_driver_fast_switch() be an appropriate API to use > from outside Generally, the idle driver is expected to manipulate OPPs as suitable for it at the low level. Thanks, Rafael