From patchwork Thu May 3 07:08:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shilpasri G Bhat X-Patchwork-Id: 907869 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40c5pl6DCGz9s27 for ; Thu, 3 May 2018 17:08:47 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40c5pl45nNzF2Vk for ; Thu, 3 May 2018 17:08:47 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=shilpa.bhat@linux.vnet.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40c5pN575kzF2TJ for ; Thu, 3 May 2018 17:08:27 +1000 (AEST) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4375nlv069501 for ; Thu, 3 May 2018 03:08:25 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hqu66da96-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 03 May 2018 03:08:25 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 3 May 2018 08:08:22 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 3 May 2018 08:08:21 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4378LG37733584; Thu, 3 May 2018 07:08:21 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 13CE24203F; Thu, 3 May 2018 07:59:32 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9204742045; Thu, 3 May 2018 07:59:31 +0100 (BST) Received: from oc4502181600.in.ibm.com (unknown [9.124.35.26]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 3 May 2018 07:59:31 +0100 (BST) From: Shilpasri G Bhat To: skiboot@lists.ozlabs.org Date: Thu, 3 May 2018 12:38:14 +0530 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 18050307-0040-0000-0000-000004356D0E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18050307-0041-0000-0000-000026398E72 Message-Id: <1525331294-495-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-03_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805030067 Subject: [Skiboot] [PATCH] occ: Use major version number while checking the pstate table format X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The minor version increments of the pstate table are backward compatible. The minor version is changed when the pstate table remains same and the existing reserved bytes are used for pointing new data. So use only major version number while parsing the pstate table. This will allow old skiboot to parse the pstate table and handle minor version updates. Signed-off-by: Shilpasri G Bhat --- hw/occ.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/occ.c b/hw/occ.c index c89d4d7..c4b61c7 100644 --- a/hw/occ.c +++ b/hw/occ.c @@ -66,7 +66,7 @@ * * struct occ_pstate_table - Pstate table layout * @valid: Indicates if data is valid - * @version: Layout version + * @version: Layout version [Major/Minor] * @v2.throttle: Reason for limiting the max pstate * @v9.occ_role: OCC role (Master/Slave) * @v#.pstate_min: Minimum pstate ever allowed @@ -527,11 +527,8 @@ static bool add_cpu_pstate_properties(int *pstate_nom) ultra_turbo_supported = true; /* Parse Pmax, Pmin and Pnominal */ - switch (occ_data->version) { - case 0x01: - ultra_turbo_supported = false; - /* fallthrough */ - case 0x02: + switch (occ_data->version >> 4) { /* Check major version */ + case 0: if (proc_gen == proc_gen_p9) { /** * @fwts-label OCCInvalidVersion02 @@ -544,6 +541,8 @@ static bool add_cpu_pstate_properties(int *pstate_nom) occ_data->version); return false; } + if ((occ_data->version & 0xF) == 0x1) + ultra_turbo_supported = false; pmin = occ_data->v2.pstate_min; pnom = occ_data->v2.pstate_nom; if (ultra_turbo_supported) @@ -551,7 +550,7 @@ static bool add_cpu_pstate_properties(int *pstate_nom) else pmax = occ_data->v2.pstate_turbo; break; - case 0x90: + case 9: if (proc_gen == proc_gen_p8) { /** * @fwts-label OCCInvalidVersion90