From patchwork Mon Oct 13 15:37:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dirk.brandewie@gmail.com X-Patchwork-Id: 5076921 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 34AE99F65C for ; Mon, 13 Oct 2014 15:38:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6AE40201C7 for ; Mon, 13 Oct 2014 15:38:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7C90A201FE for ; Mon, 13 Oct 2014 15:38:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754287AbaJMPh6 (ORCPT ); Mon, 13 Oct 2014 11:37:58 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:48013 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754054AbaJMPh5 (ORCPT ); Mon, 13 Oct 2014 11:37:57 -0400 Received: by mail-pa0-f53.google.com with SMTP id kq14so6029301pab.40 for ; Mon, 13 Oct 2014 08:37:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GQQRoJoLfroG24OvsLok9oO7v5PjF695krCz0+E04Xg=; b=I/oaJg93U9MjZM6gZaW7llCEQu5hWr4dtN6hkwruPkEIQYKOlDXfDsglw+XL/ET1NK YV7LEe0J3PJBYg6p0HwrT4VWQ4DVOG/ev9vLbS1vpbeTBNkcTNqqpHUPf7kmwHzfigpp qh6I2Wq4l5j9gbyGLJkCS155Fi44xdaaA/ebD44f55j55D3u5/7IRxuEy6sTbXS+T+je b8/Z9KzmOW+1Bx65p2Tb8OXx2TaKOgZ6xG4XK8+5NPuBOH8EqJKYzU3fH58JE9pyIFz+ X/5ADTdLBl15DYKok/kzakvw69PnHAm/mGK7BVpq+OJyObSGHhSLLGZ0PSfed/L/mYeS fMmg== X-Received: by 10.67.14.97 with SMTP id ff1mr376744pad.77.1413214676725; Mon, 13 Oct 2014 08:37:56 -0700 (PDT) Received: from echolake.localdomain (static-50-43-32-60.bvtn.or.frontiernet.net. [50.43.32.60]) by mx.google.com with ESMTPSA id dg5sm10340216pdb.54.2014.10.13.08.37.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Oct 2014 08:37:55 -0700 (PDT) From: dirk.brandewie@gmail.com X-Google-Original-From: dirk.j.brandewie@intel.com To: linux-pm@vger.kernel.org Cc: rjw@rjwysocki.net, dirk.brandewie@gmail.com, Dirk Brandewie , stable@vger.kernel.org Subject: [PATCH 3/5] intel_pstate: Don't lose sysfs settings during cpu offline Date: Mon, 13 Oct 2014 08:37:42 -0700 Message-Id: <1413214664-17687-3-git-send-email-dirk.j.brandewie@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1413214664-17687-1-git-send-email-dirk.j.brandewie@intel.com> References: <1413214664-17687-1-git-send-email-dirk.j.brandewie@intel.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Dirk Brandewie The user may have custom settings don't destroy them during suspend. Reference: https://bugzilla.kernel.org/show_bug.cgi?id=80651 Reported-by: Tobias Jakobi Cc: stable@vger.kernel.org Signed-off-by: Dirk Brandewie --- drivers/cpufreq/intel_pstate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index a85b262..db03cbb 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -702,7 +702,9 @@ static int intel_pstate_init_cpu(unsigned int cpunum) { struct cpudata *cpu; - all_cpu_data[cpunum] = kzalloc(sizeof(struct cpudata), GFP_KERNEL); + if (!all_cpu_data[cpunum]) + all_cpu_data[cpunum] = kzalloc(sizeof(struct cpudata), + GFP_KERNEL); if (!all_cpu_data[cpunum]) return -ENOMEM; @@ -782,8 +784,6 @@ static void intel_pstate_stop_cpu(struct cpufreq_policy *policy) del_timer_sync(&all_cpu_data[cpu_num]->timer); intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate); - kfree(all_cpu_data[cpu_num]); - all_cpu_data[cpu_num] = NULL; } static int intel_pstate_cpu_init(struct cpufreq_policy *policy)