Received: by 10.192.165.148 with SMTP id m20csp316252imm; Tue, 24 Apr 2018 23:16:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx49V1HkV5/yOWEgsIHd8UMavgRalPUSJLv/6YTRoTzwa21hcsD/dvg6Qji/Xn6xDtrisihuC X-Received: by 10.99.149.10 with SMTP id p10mr22503895pgd.217.1524637014862; Tue, 24 Apr 2018 23:16:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524637014; cv=none; d=google.com; s=arc-20160816; b=ew64sM7UxOcJ2Y0+a3xi8yCSwIekJdmASwmRWlnEbkvUyk6BcLRHsWItGsk4npD3z4 KnjIaDfKRuffo+jLDVtZLDDy1mUfU9U1Xva8q5B/aRoIFIdKfBmdDys2rtNico0o3v0D mmI5cQwhXUX/d4G7HJ2lkOqdLq/+qcCzWUU21IYkCydjV+20gD6UiXVHt22RV/iXn8zo EL9x/A+yiahNG+Uy9RQ9l4hc7tKwa3GT50N4iPXgPtE7OS+560NLTP2aWasOCLLeMaAg 2mJXb07bC1Pd5Y57yCLN4uSuXRDaqUVV96Q05/ttZ7ZjLj3hTwL4RllBnRiiNbLq1eJC CwVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=DQ+2PCDU2c5YqFGqWKJqFlZbT003SqL4lFC9HSD0IkE=; b=QIGkbtyCe6ODts/Uh/WTvpL+JVbuXI1SXh1rPUL6lpROmjxuJ2mPUysfJZWcBK4UZt Wn8ZxVnRe9MuM1LbFFdYBtxyAXmuBmW2mSrrgODMt4m2q/LHl99Rrs2JnynnBjf8X2ub ifN6ONxkAG3TcmBHLgSNkF5BcvvZsFgWTn5kslrsUM2bbbNq6VEQYnRa7wsAZbeM3b6f LfMqQb+YlEnLeN7WfLyzsIToRQzoVlJPz9yK90t6FwJbXmvG9QOCe4uVon0JPxfsbQlU YdTJIK0J8QSiGvQGCeeQd3vI6UN7K2/WVMi13IGnXjXlTaeWx7rc0bHUomGUuw1ypXza syFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b19si11559424pfh.358.2018.04.24.23.16.40; Tue, 24 Apr 2018 23:16:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751310AbeDYGPJ (ORCPT + 99 others); Wed, 25 Apr 2018 02:15:09 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:34418 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751027AbeDYGPG (ORCPT ); Wed, 25 Apr 2018 02:15:06 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3P6DwiI004084 for ; Wed, 25 Apr 2018 02:15:06 -0400 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hjm508977-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 25 Apr 2018 02:15:05 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 25 Apr 2018 07:15:03 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 25 Apr 2018 07:15:01 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3P6F0IG64094260; Wed, 25 Apr 2018 06:15:01 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8DCAAA404D; Wed, 25 Apr 2018 07:06:59 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F1999A4040; Wed, 25 Apr 2018 07:06:57 +0100 (BST) Received: from oc4502181600.in.ibm.com (unknown [9.124.35.147]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 25 Apr 2018 07:06:57 +0100 (BST) From: Shilpasri G Bhat To: rjw@rjwysocki.net, viresh.kumar@linaro.org Cc: benh@kernel.crashing.org, mpe@ellerman.id.au, linux-pm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, svaidy@linux.vnet.ibm.com, Shilpasri G Bhat Subject: [PATCH] cpufreq: powernv: Remove global pstate ramp-down timer in POWER9 Date: Wed, 25 Apr 2018 11:44:55 +0530 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 18042506-0012-0000-0000-000005CE7044 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18042506-0013-0000-0000-0000194AE71F Message-Id: <1524636895-27185-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-25_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804250055 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org POWER9 doesnot support global pstate requests for the chip. So remove the timer logic which slowly ramps down the global pstate in P9 platforms. Signed-off-by: Shilpasri G Bhat --- drivers/cpufreq/powernv-cpufreq.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c index 0591874..71f8682 100644 --- a/drivers/cpufreq/powernv-cpufreq.c +++ b/drivers/cpufreq/powernv-cpufreq.c @@ -750,8 +750,13 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy, cur_msec = jiffies_to_msecs(get_jiffies_64()); - spin_lock(&gpstates->gpstate_lock); freq_data.pstate_id = idx_to_pstate(new_index); + if (!gpstates) { + freq_data.gpstate_id = freq_data.pstate_id; + goto no_gpstate; + } + + spin_lock(&gpstates->gpstate_lock); if (!gpstates->last_sampled_time) { gpstate_idx = new_index; @@ -801,6 +806,7 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy, spin_unlock(&gpstates->gpstate_lock); +no_gpstate: /* * Use smp_call_function to send IPI and execute the * mtspr on target CPU. We could do that without IPI @@ -835,6 +841,13 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy) kernfs_put(kn); } + policy->freq_table = powernv_freqs; + policy->fast_switch_possible = true; + + if (pvr_version_is(PVR_POWER9)) + return 0; + + /* Initialise Gpstate ramp-down timer only on POWER8 */ gpstates = kzalloc(sizeof(*gpstates), GFP_KERNEL); if (!gpstates) return -ENOMEM; @@ -849,15 +862,14 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy) msecs_to_jiffies(GPSTATE_TIMER_INTERVAL); spin_lock_init(&gpstates->gpstate_lock); - policy->freq_table = powernv_freqs; - policy->fast_switch_possible = true; return 0; } static int powernv_cpufreq_cpu_exit(struct cpufreq_policy *policy) { /* timer is deleted in cpufreq_cpu_stop() */ - kfree(policy->driver_data); + if (policy->driver_data) + kfree(policy->driver_data); return 0; } @@ -990,7 +1002,8 @@ static void powernv_cpufreq_stop_cpu(struct cpufreq_policy *policy) freq_data.pstate_id = idx_to_pstate(powernv_pstate_info.min); freq_data.gpstate_id = idx_to_pstate(powernv_pstate_info.min); smp_call_function_single(policy->cpu, set_pstate, &freq_data, 1); - del_timer_sync(&gpstates->timer); + if (gpstates) + del_timer_sync(&gpstates->timer); } static unsigned int powernv_fast_switch(struct cpufreq_policy *policy, -- 1.8.3.1