Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757222AbdLQDP3 (ORCPT ); Sat, 16 Dec 2017 22:15:29 -0500 Received: from mail-vk0-f44.google.com ([209.85.213.44]:36097 "EHLO mail-vk0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757098AbdLQDP1 (ORCPT ); Sat, 16 Dec 2017 22:15:27 -0500 X-Google-Smtp-Source: ACJfBovK297sXImYJevixjzOPFS+ETBmcZui1gdFlJfhW4/71pPD7q99X5AsRRKn/26/3lPo23Uiy7NZp9M8WLEuFsc= MIME-Version: 1.0 In-Reply-To: <1513148261-21097-3-git-send-email-ego@linux.vnet.ibm.com> References: <1513148261-21097-1-git-send-email-ego@linux.vnet.ibm.com> <1513148261-21097-3-git-send-email-ego@linux.vnet.ibm.com> From: Balbir Singh Date: Sun, 17 Dec 2017 14:15:25 +1100 Message-ID: Subject: Re: [v3 PATCH 2/3] powernv-cpufreq: Fix pstate_to_idx() to handle non-continguous pstates To: "Gautham R. Shenoy" Cc: Shilpasri G Bhat , Viresh Kumar , "Rafael J. Wysocki" , huntbag@linux.vnet.ibm.com, Akshay Adiga , Michael Ellerman , Vaidyanathan Srinivasan , linux-pm@vger.kernel.org, "linux-kernel@vger.kernel.org" , "open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1006 Lines: 25 On Wed, Dec 13, 2017 at 5:57 PM, Gautham R. Shenoy wrote: > From: "Gautham R. Shenoy" > > The code in powernv-cpufreq, makes the following two assumptions which > are not guaranteed by the device-tree bindings: > > 1) Pstate ids are continguous: This is used in pstate_to_idx() to > obtain the reverse map from a pstate to it's corresponding > entry into the cpufreq frequency table. > > 2) Every Pstate should always lie between the max and the min > pstates that are explicitly reported in the device tree: This > is used to determine whether a pstate reported by the PMSR is > out of bounds. > > Both these assumptions are unwarranted and can change on future > platforms. While this is a good thing, I wonder if it is worth the complexity. Pstates are contiguous because they define transitions in incremental value of change in frequency and I can't see how this can be broken in the future? Balbir Singh.