From patchwork Thu May 10 20:26:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ppaidipe X-Patchwork-Id: 911545 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 40hlBr6QX1z9s0w for ; Fri, 11 May 2018 06:27:16 +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 40hlBr4mlqzF28N for ; Fri, 11 May 2018 06:27:16 +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.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=ppaidipe@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 (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 40hl9n6W5nzF29L for ; Fri, 11 May 2018 06:26:21 +1000 (AEST) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4AKOCo6050540 for ; Thu, 10 May 2018 16:26:18 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hvvauj27t-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 10 May 2018 16:26:18 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 10 May 2018 21:26:16 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 10 May 2018 21:26:15 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4AKQEVm15008136; Thu, 10 May 2018 20:26:14 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5D0214C040; Thu, 10 May 2018 21:18:12 +0100 (BST) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6D95E4C044; Thu, 10 May 2018 21:18:11 +0100 (BST) Received: from localhost.localdomain.in.ibm.com (unknown [9.84.216.5]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 10 May 2018 21:18:11 +0100 (BST) From: Pridhiviraj Paidipeddi To: skiboot@lists.ozlabs.org Date: Fri, 11 May 2018 01:56:10 +0530 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 18051020-0020-0000-0000-0000041C045C X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18051020-0021-0000-0000-000042B1045D Message-Id: <1525983970-14139-1-git-send-email-ppaidipe@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-10_06:, , 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=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805100188 Subject: [Skiboot] [PATCH] p9dsu: detect variant in init only if probe fails to found. 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" Currently the slot table init happens twice in both probe and init functions due to the variant detection logic called with in-correct condition check. Fixes: d32ddea9 ("p9dsu: detect p9dsu variant even when hostboot doesn't tell us") Signed-off-by: Pridhiviraj Paidipeddi --- platforms/astbmc/p9dsu.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/platforms/astbmc/p9dsu.c b/platforms/astbmc/p9dsu.c index e4fef5e..ead693f 100644 --- a/platforms/astbmc/p9dsu.c +++ b/platforms/astbmc/p9dsu.c @@ -28,6 +28,8 @@ #include "astbmc.h" +static bool variant_found = false; + static const struct slot_table_entry p9dsu1u_phb0_0_slot[] = { { .etype = st_pluggable_slot, @@ -590,6 +592,8 @@ static bool p9dsu_probe(void) dt_node_is_compatible(dt_root, "supermicro,p9dsu2uess"))) return false; + variant_found = true; + /* Lot of common early inits here */ astbmc_early_init(); @@ -607,7 +611,7 @@ static bool p9dsu_probe(void) } else if (dt_node_is_compatible(dt_root, "supermicro,p9dsu2uess")) { prlog(PR_INFO, "Detected p9dsu2uess variant\n"); slot_table_init(p9dsu2uess_phb_table); - } + } else { /* * else we need to ask the BMC what subtype we are, but we need IPMI * which we don't get until astbmc_init(), so we delay setting up the @@ -616,6 +620,8 @@ static bool p9dsu_probe(void) * This only applies if you're using a Hostboot that doesn't do this * for us. */ + variant_found = false; + } return true; } @@ -642,7 +648,7 @@ static void p9dsu_init(void) * variant we are if Hostboot isn't the patched one that does this * for us. */ - if (dt_node_is_compatible(dt_root, "supermicro,p9dsu")) { + if (!variant_found) { ipmi_msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE, IPMI_CODE(IPMI_NETFN_APP, 0x52), p9dsu_riser_query_complete,