From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751606AbbHRB7P (ORCPT ); Mon, 17 Aug 2015 21:59:15 -0400 Received: from mga02.intel.com ([134.134.136.20]:40641 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750985AbbHRB7N (ORCPT ); Mon, 17 Aug 2015 21:59:13 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,698,1432623600"; d="scan'208";a="750521770" Message-ID: <55D2923E.7030202@intel.com> Date: Tue, 18 Aug 2015 10:02:38 +0800 From: Yu Chen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Ingo Molnar CC: rjw@rjwysocki.net, pavel@ucw.cz, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, rui.zhang@intel.com, x86@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86, suspend: Save/restore THERM_CONTROL register for suspend References: <1439800192-3034-1-git-send-email-yu.c.chen@intel.com> <20150817101115.GA27204@gmail.com> In-Reply-To: <20150817101115.GA27204@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (not sure if previous reply has been sent out) Hi, Ingo, thanks for your review, On 08/17/2015 06:11 PM, Ingo Molnar wrote: > > * Chen Yu wrote: > > > So what your changelog fails to mention: > > - You only add this code to the 64-bit kernel. Are 32-bit kernels not affected? > I missed the 32-bit case, I'll adjust them to 32/64-bit common path. > - the MSR read is done unconditionally. Is MSR_IA32_THERM_CONTROL available > architecturally and readable (and has sensible values) on all 64-bit capable > x86 CPUs that run this code path? > MSR_IA32_THERM_CONTROL is avaliable on Intel Pentium 4, Xeon, Pentium M and later processors, so I think not all of the 32/64-bit x86 CPUs have this regiser. Maybe codes like this would be more reasonable? save: ctx->clock_modulation_saved = !rdmsrl_safe(MSR_IA32_THERM_CONTROL, &ctxt->clock_modulation); retore: if (ctxt->clock_modulation_saved) wrmsrl(MSR_IA32_THERM_CONTROL, ctxt->clock_modulation); Best Regards, Yu > Thanks, > > Ingo > -- > To unsubscribe from this list: send the line "unsubscribe linux-pm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >