From: Hiroshi Miura Subject: [PATCH] speedstep-centrino: fix cpu_cur_freq when resume. Date: Fri, 24 Sep 2004 22:58:10 +0900 Sender: cpufreq-bounces@www.linux.org.uk Message-ID: <874qlnpy4t.wl%miura@da-cha.org> References: <87acvh7e15.wl%miura@da-cha.org> <20040923080207.GA14010@dominikbrodowski.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - =?ISO-2022-JP?B?IhskQjRdGyhC?= =?ISO-2022-JP?B?GyRCMiwbKEIi?=) Return-path: In-Reply-To: <20040923080207.GA14010@dominikbrodowski.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: cpufreq-bounces+glkc-cpufreq=gmane.org@www.linux.org.uk Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: cpufreq@www.linux.org.uk Hi, I tested and decide speedstep-centrino needs .resume function. ~# echo "1000000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed ~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq 1000000 ~# cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 9 model name : Intel(R) Pentium(R) M processor 1100MHz stepping : 5 cpu MHz : 997.561 <<<>>>> ~# cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 9 model name : Intel(R) Pentium(R) M processor 1100MHz stepping : 5 cpu MHz : 598.548 ~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq 1000000 ~# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq 600000 ~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq 600000 This result tell me that after resume we should call /sys/.../cpuinfo_cur_freq, in other words, call "cur_freq = cpufreq_get(policy->cpu);" in cpufreq.c. "cpufreq_get()" is same as "get_cur_freq(unsigned int cpu)" in speedstep-centrino.c. In my patch, .resume function calls get_cur_freq(0) and set internal state variable 'p.state' to proper value. p.state is only for depricated /proc/acpi/.../performance interface. so what we need is just calling get_cur_freq(0). At Thu, 23 Sep 2004 10:02:07 +0200, Dominik Brodowski wrote: > > On Thu, Sep 23, 2004 at 02:25:10PM +0900, Hiroshi Miura wrote: > > Hi, > > > > My note pc, Panasonic Let's Note CF-R3(Pentium M 1.1GHz), troubles when resume. > > BIOS set cpu p-state as of ac-line state. > > Centrino driver can not detect change through suspend/resume. > > Actually, it should. Only the (deprecated) > /proc/acpi/processor/*/performance interface may show a wrong current state, > /sys/devices/system/cpu/cpu0/cpufreq/{scaling,cpuinfo}_cur_freq should be > updated by doing a call to ->get(). > > Oh, and what suspend method are you using? > > Dominik > -- Hiroshi Miura --- http://www.da-cha.org/ --- miura@da-cha.org NTTDATA Corp. OpenSource Software Center. --- miurahr@nttdata.co.jp NTTDATA Intellilink Corp. OpenSource Engineering Dev. -- miurahr@intellilink.co.jp Key fingerprint = 9117 9407 5684 FBF1 4063 15B4 401D D077 04AB 8617