From patchwork Mon Aug 28 07:17:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 806407 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 3xgjmT2tGzz9sNq for ; Mon, 28 Aug 2017 17:18:33 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xgjmS7554zDqBc for ; Mon, 28 Aug 2017 17:18:32 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 3xgjmL0QBZzDq7N for ; Mon, 28 Aug 2017 17:18:25 +1000 (AEST) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v7S7FcVP074015 for ; Mon, 28 Aug 2017 03:18:23 -0400 Received: from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141]) by mx0b-001b2d01.pphosted.com with ESMTP id 2cm9ubb0wb-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 28 Aug 2017 03:18:22 -0400 Received: from localhost by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 28 Aug 2017 17:18:19 +1000 Received: from d23relay07.au.ibm.com (202.81.31.226) by e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 28 Aug 2017 17:18:17 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v7S7IGxV33620184 for ; Mon, 28 Aug 2017 17:18:16 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v7S7I8wn000604 for ; Mon, 28 Aug 2017 17:18:08 +1000 Received: from hegdevasant.in.ibm.com ([9.109.222.253]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v7S7I6NN000565; Mon, 28 Aug 2017 17:18:07 +1000 From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Mon, 28 Aug 2017 12:47:59 +0530 X-Mailer: git-send-email 2.9.3 X-TM-AS-MML: disable x-cbid: 17082807-0048-0000-0000-0000025A263D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17082807-0049-0000-0000-0000480E65CE Message-Id: <20170828071803.9406-1-hegdevasant@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-08-28_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1708280117 Subject: [Skiboot] [PATCH v2 1/5] hdata: Fix vpd parse X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 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" We detect vpd data format in vpd_parse() and set "op_platform" variable. dt_add_vpd_node() depends on op_platform to select parser type. There are places where we call dt_add_vpd_node() even before calling vpd_parse(). And in such cases it will not parse vpd data properly. This patch fixes above issue. Fixes: 694546c1 (hdata/vpd: Parse the OpenPOWER OPFR record) CC: Ananth N Mavinakayanahalli Signed-off-by: Vasant Hegde Acked-by: Ananth N Mavinakayanahalli --- hdata/vpd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hdata/vpd.c b/hdata/vpd.c index d7d57cd..0e23e29 100644 --- a/hdata/vpd.c +++ b/hdata/vpd.c @@ -23,8 +23,6 @@ #include "hdata.h" #include -static bool op_platform; - struct card_info { const char *ccin; /* Customer card identification number */ const char *description; @@ -492,7 +490,7 @@ struct dt_node *dt_add_vpd_node(const struct HDIF_common_hdr *hdr, && !dt_find_property(node, "ibm,vpd")) { dt_add_property(node, "ibm,vpd", fruvpd, fruvpd_sz); - if (op_platform) + if (vpd_find_record(fruvpd, fruvpd_sz, "OPFR", NULL)) vpd_opfr_parse(node, fruvpd, fruvpd_sz); else vpd_vini_parse(node, fruvpd, fruvpd_sz); @@ -607,10 +605,9 @@ static void sysvpd_parse(void) } /* Look for the new OpenPower "OSYS" first */ - if (vpd_find_record(sysvpd, sysvpd_sz, "OSYS", NULL)) { - op_platform = true; + if (vpd_find_record(sysvpd, sysvpd_sz, "OSYS", NULL)) sysvpd_parse_opp(sysvpd, sysvpd_sz); - } else + else sysvpd_parse_legacy(sysvpd, sysvpd_sz); dt_add_model_name();