From patchwork Wed Aug 9 01:57:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Clark X-Patchwork-Id: 9889429 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1A6AD60317 for ; Wed, 9 Aug 2017 02:00:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AA1C289A9 for ; Wed, 9 Aug 2017 02:00:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3C7928A1D; Wed, 9 Aug 2017 02:00:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 873D228A09 for ; Wed, 9 Aug 2017 02:00:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfGFD-0004AW-5v; Wed, 09 Aug 2017 01:57:11 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfGFB-0004AM-Sy for xen-devel@lists.xenproject.org; Wed, 09 Aug 2017 01:57:10 +0000 Received: from [85.158.143.35] by server-10.bemta-6.messagelabs.com id B6/EC-03582-5FB6A895; Wed, 09 Aug 2017 01:57:09 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrJIsWRWlGSWpSXmKPExsVyMXThQd0v2V2 RBsuPalh83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBkbrzsXHGCrmPtyFVMD41rWLkYuDiGBmYwS x95/YgZxWATus0g8+fiNDcSREPjNInFx0zfGLkZOIKdI4vm8HawQdqHElhXf2UFsXgFBiZMzn 7B0MXIAjfKUOHrJCCTMJmAusb5vB1gri4CKRFPvGkaQEl6BAIlVz0xBwsICHhIXZzxlArFFBJ Qk7q2aDGYzC4hK7FnYzgxha0q0bv/NPoGRbxaSZbOQpBYwMq1i1ChOLSpLLdI1NNJLKspMzyj JTczM0TU0MNPLTS0uTkxPzUlMKtZLzs/dxAgMKgYg2MF4eWPAIUZJDiYlUd5N2p2RQnxJ+SmV GYnFGfFFpTmpxYcYZTg4lCR4g7O6IoUEi1LTUyvSMnOA4Q2TluDgURLhlQVJ8xYXJOYWZ6ZDp E4xWnJcubLuCxNH04ctQHLKge1fmIRY8vLzUqXEeWtBGgRAGjJK8+DGwWLwEqOslDAvI9CBQj wFqUW5mSWo8q8YxTkYlYR5r4NM4cnMK4Hb+groICaggyJ8O0EOKklESEk1MC7rYBFdFhXOcMh jjtDXec9X37YP0da6O6/811ObbacMe+4smigclGIstNN5z1nR/5alr5dOOG62hVlY0G3q4ftX 5106H9YjvUGU+cvXllue/PmmeyzFmmTTCxsvPDm3uab7lf+9OUtND54/e8eGpz/QMHke//0tT YX3PK7NsRIwTFhSUnhG/ZESS3FGoqEWc1FxIgBarqEYvAIAAA== X-Env-Sender: christopher.w.clark@gmail.com X-Msg-Ref: server-10.tower-21.messagelabs.com!1502243827!70418396!1 X-Originating-IP: [209.85.161.193] X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 35251 invoked from network); 9 Aug 2017 01:57:08 -0000 Received: from mail-yw0-f193.google.com (HELO mail-yw0-f193.google.com) (209.85.161.193) by server-10.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 9 Aug 2017 01:57:08 -0000 Received: by mail-yw0-f193.google.com with SMTP id t139so3549442ywg.1 for ; Tue, 08 Aug 2017 18:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=cgpWdRQs3W1jSRg6sD+IQCz+2bfbIjeiaDB/ohK06Ec=; b=jqT52NUebJ9PYc9tmPImgGf9jdUfDOC69xoLpmwO9nfmuvzi+NgQWBrtda2fpH+rnC ZXisnrx8fD+823148NXpGLbNzSl8PtZeUGXDr/3Pte6JNv70TMmIfyZr4W7ovTmVdn/k fL6S7822FrZW71OUyvC7pQg5I13nk/oXPedU6NqGOMecjtMHfC+Og0W0OQyMqM8Bqb29 IWZyXv3CtaV9zeSJn8Hu+312wLs9LF4q16r4ygmubDOh12lUku09RGHCcGYj5iAesSAa DBMBIH1MFPd7sFXrXJxY3Dn9ucCozzVo8ekQs9k7uwQwqJ5KyhasL/n9fqgAU7cfzqWW fnYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=cgpWdRQs3W1jSRg6sD+IQCz+2bfbIjeiaDB/ohK06Ec=; b=a4qf/3l2MfWGhSAZlcYCNLyLFtq/w06wIjasNmJcB5nsgGKnAXAcqK7y6L1qKvF584 6St0qN0OOZsEeKqQnxcKULqfUGG5wLdAwXzweA4a2AzJGgweoMcGnpKbU5pIzwgo6s0w eeDN8Fg83ZPATJw+g2yJpdaL8BxXBxlZnUU+U64NIi9Ate3LC6DBL/HozbqVUDq0gwFf eDF+DIWxDNgQnJxR/q3yfT2KX3fswVZKyLAKyxKZUWzX5V6lBOZDUOY7/5nCyVIWTsuH cKpji4fEPnIiM+9J64fMTmwgXZuMGTazeDOvtf6LhAZStirKlB/vfBc/TUUW7PzHIZ0u r42g== X-Gm-Message-State: AHYfb5g2snaBnohTuGBlkzsEujF7Khxf71onRKt2lA8ogcSRaAdRFP0o vwZxMm0pghALnFVBvIltIFZqkWr/SjIu7L0= X-Received: by 10.37.36.14 with SMTP id k14mr4883772ybk.211.1502243827161; Tue, 08 Aug 2017 18:57:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.172.25 with HTTP; Tue, 8 Aug 2017 18:57:06 -0700 (PDT) From: Christopher Clark Date: Tue, 8 Aug 2017 18:57:06 -0700 Message-ID: To: xen-devel@lists.xenproject.org Cc: jbeulich@suse.com Subject: [Xen-devel] [PATCH] cpufreq: only stop ondemand governor if already started X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Avoid panic in cpufreq_gov_stop. Only execute the CPUFREQ_GOV_STOP logic if the governor has actually been started. Patch originated in OpenXT. Signed-off-by: Christopher Clark --- xen/drivers/cpufreq/cpufreq_ondemand.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/drivers/cpufreq/cpufreq_ondemand.c b/xen/drivers/cpufreq/cpufreq_ondemand.c index 7fdba03..fe6c63d 100644 --- a/xen/drivers/cpufreq/cpufreq_ondemand.c +++ b/xen/drivers/cpufreq/cpufreq_ondemand.c @@ -273,6 +273,10 @@ int cpufreq_governor_dbs(struct cpufreq_policy *policy, unsigned int event) break; case CPUFREQ_GOV_STOP: + if ( !this_dbs_info->enable ) + /* Already not enabled */ + break; + dbs_timer_exit(this_dbs_info); dbs_enable--;