From patchwork Fri Dec 27 14:35:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 3411991 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B5C2BC02DC for ; Fri, 27 Dec 2013 14:22:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 724F520163 for ; Fri, 27 Dec 2013 14:22:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 81DDE20125 for ; Fri, 27 Dec 2013 14:22:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754684Ab3L0OV6 (ORCPT ); Fri, 27 Dec 2013 09:21:58 -0500 Received: from v094114.home.net.pl ([79.96.170.134]:54834 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753080Ab3L0OV6 (ORCPT ); Fri, 27 Dec 2013 09:21:58 -0500 Received: from cmw246.neoplus.adsl.tpnet.pl [83.31.150.246] (HELO vostro.rjw.lan) by serwer1319399.home.pl [79.96.170.134] with SMTP (IdeaSmtpServer v0.80) id 8310cecd4e34bdc6; Fri, 27 Dec 2013 15:21:56 +0100 From: "Rafael J. Wysocki" To: Viresh Kumar , Josh Boyer Cc: Dirk Brandewie , "cpufreq@vger.kernel.org" , Linux PM list , "Linux-Kernel@Vger. Kernel. Org" Subject: Re: intel_pstate divide error with v3.13-rc4-256-gb7000ad Date: Fri, 27 Dec 2013 15:35:29 +0100 Message-ID: <2312220.jMindkoXyA@vostro.rjw.lan> User-Agent: KMail/4.10.5 (Linux/3.12.0-rc6+; KDE/4.10.5; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tuesday, December 24, 2013 09:36:01 PM Viresh Kumar wrote: > Adding Dirk.. > > On 24 December 2013 20:06, Josh Boyer wrote: > > Hi All, > > > > We've had a report [1] that the pstate driver causes KVM guests to > > fail to boot because of a divide error. See the backtrace below. > > > > 4.839784] Intel P-state driver initializing. > > [ 4.859972] Intel pstate controlling: cpu 0 > > [ 4.867653] cpufreq: __cpufreq_add_dev: ->get() failed > > After a call to ->init(), ->get() is supposed to work. > @Dirk: Any idea why it failed? Well, it looks like sample->freq is 0 in intel_pstate_get(). > And then I don't know what made this divide by zero to happen :) From code inspection it looks like that is caused by the intel_pstate_get_scaled_busy() called from intel_pstate_adjust_busy_pstate(), so it appears that cpu->pstate.current_state is 0 at that point. I'm wondering if something like the (untested) patch below helps, then? Rafael --- drivers/cpufreq/intel_pstate.c | 5 +++++ 1 file changed, 5 insertions(+) -- 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 Index: linux-pm/drivers/cpufreq/intel_pstate.c =================================================================== --- linux-pm.orig/drivers/cpufreq/intel_pstate.c +++ linux-pm/drivers/cpufreq/intel_pstate.c @@ -652,6 +652,11 @@ static int intel_pstate_init_cpu(unsigne cpu = all_cpu_data[cpunum]; intel_pstate_get_cpu_pstates(cpu); + if (!cpu->pstate.current_state) { + all_cpu_data[cpunum] = NULL; + kfree(cpu); + return -ENODATA; + } cpu->cpu = cpunum;