Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754046AbdLHOIc (ORCPT ); Fri, 8 Dec 2017 09:08:32 -0500 Received: from mail-oi0-f68.google.com ([209.85.218.68]:42858 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754000AbdLHOIS (ORCPT ); Fri, 8 Dec 2017 09:08:18 -0500 X-Google-Smtp-Source: AGs4zMbnCTxthLUk/YAltfoFFel9Z3SM7950WQHqjXJ+HstYz/mOYHmIHibfrwJ85dLZP0m9ax8lCL1/Ywp+PX4igAI= MIME-Version: 1.0 In-Reply-To: <87indhh25h.fsf@concordia.ellerman.id.au> References: <1512626365-22845-1-git-send-email-ego@linux.vnet.ibm.com> <87indhh25h.fsf@concordia.ellerman.id.au> From: "Rafael J. Wysocki" Date: Fri, 8 Dec 2017 15:08:17 +0100 X-Google-Sender-Auth: E68Ojf4LixLf7IMN8CGrQ_9W90c Message-ID: Subject: Re: [v2 PATCH] cpufreq: powernv: Correctly parse the sign of pstates on POWER8 vs POWER9 To: Michael Ellerman Cc: "Rafael J. Wysocki" , "Gautham R. Shenoy" , Shilpasri G Bhat , Viresh Kumar , "Rafael J. Wysocki" , huntbag@linux.vnet.ibm.com, akshay.adiga@linux.vnet.ibm.com, Vaidyanathan Srinivasan , Linux PM , Linux Kernel Mailing List , linuxppc-dev , Stable 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: 1651 Lines: 37 On Fri, Dec 8, 2017 at 12:47 PM, Michael Ellerman wrote: > "Rafael J. Wysocki" writes: > >> On Thu, Dec 7, 2017 at 6:59 AM, Gautham R. Shenoy >> wrote: >>> From: "Gautham R. Shenoy" >>> >>> On POWERNV platform, Pstates are 8-bit values. On POWER8 they are >>> negatively numbered while on POWER9 they are positively >>> numbered. Thus, on POWER9, the maximum number of pstates could be as >>> high as 256. >>> >>> The current code interprets pstates as a signed 8-bit value. This >>> causes a problem on POWER9 platforms which have more than 128 pstates. >>> On such systems, on a CPU that is in a lower pstate whose number is >>> greater than 128, querying the current pstate returns a "pstate X is >>> out of bound" error message and the current pstate is reported as the >>> nominal pstate. >>> >>> This patch fixes the aforementioned issue by correctly differentiating >>> the sign whenever a pstate value read, depending on whether the >>> pstates are positively numbered or negatively numbered. >>> >>> Fixes: commit 09ca4c9b5958 ("cpufreq: powernv: Replacing pstate_id with frequency table index") >>> Cc: #v4.8 >>> Signed-off-by: Gautham R. Shenoy >>> Tested-and-reviewed-by: Shilpasri G Bhat >>> Acked-by: Viresh Kumar >> >> I'm going to apply this, or please let me know if you want to route it >> differently. > > Do you mind waiting for now, we're still debating how to fix it. No problem. :-) Just please let me know when you're ready.