From patchwork Mon Oct 2 22:23:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guilherme G. Piccoli" X-Patchwork-Id: 820684 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y5cBm4d1Mz9s7v for ; Tue, 3 Oct 2017 09:23:44 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3y5cBm3kfVzDqmb for ; Tue, 3 Oct 2017 09:23:44 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=gpiccoli@linux.vnet.ibm.com; receiver=) 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 3y5cBK6mV2zDqkh for ; Tue, 3 Oct 2017 09:23:21 +1100 (AEDT) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v92MJH8E039345 for ; Mon, 2 Oct 2017 18:23:18 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0b-001b2d01.pphosted.com with ESMTP id 2dbsymtyn4-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 02 Oct 2017 18:23:18 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 2 Oct 2017 16:23:17 -0600 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 2 Oct 2017 16:23:14 -0600 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v92MNDtX3146038; Mon, 2 Oct 2017 15:23:13 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9B46978037; Mon, 2 Oct 2017 16:23:13 -0600 (MDT) Received: from localhost (unknown [9.80.200.13]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP id 136E378038; Mon, 2 Oct 2017 16:23:12 -0600 (MDT) From: "Guilherme G. Piccoli" To: skiboot@lists.ozlabs.org Date: Mon, 2 Oct 2017 19:23:01 -0300 X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171002222301.22832-1-gpiccoli@linux.vnet.ibm.com> References: <20171002222301.22832-1-gpiccoli@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17100222-0016-0000-0000-0000079995F2 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007831; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000233; SDB=6.00925605; UDB=6.00465535; IPR=6.00705804; BA=6.00005616; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017368; XFM=3.00000015; UTC=2017-10-02 22:23:16 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17100222-0017-0000-0000-00003BB3A4D0 Message-Id: <20171002222301.22832-3-gpiccoli@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-10-02_07:, , 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-1710020323 Subject: [Skiboot] [PATCH RFC 2/2] phb4: Use ASB for read/writes to PHB registers on resets X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mikey@neuling.org MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" If we are performing a PHB reset and coming for a bad situation, (and PHB is fenced), we fail because we don't use ASB by default in the phb4_init_hw(). This patch makes use of this trick when we are resetting PHBs to workaround possible problems in PHB (aka it might be fenced) and at least try to perform the complete initialization. This proved useful in kdump kernel boot on POWER9 (wspoon). Signed-off-by: Guilherme G. Piccoli --- Tested on wspoon DD 2.01, worked fine. But...after kdump is complete, system does not reboot automatically. I'll investigate too, could be another problem or (probably) something due to this change. I thought in sending it anyway, as-is, in order to get feedback and stop my investigation in this direction if it does not worth. Thanks in advance! hw/phb4.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/phb4.c b/hw/phb4.c index 99902d3a..12312a5c 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -4312,6 +4312,10 @@ static void phb4_init_hw(struct phb4 *p, bool first_init) PHBDBG(p, "Initializing PHB4...\n"); + /* Use ASB to try initialize even if the PHB is fenced. */ + if (!first_init) + p->flags |= PHB4_CFG_USE_ASB; + /* Init_1 - Sync reset * * At this point we assume the PHB has already been reset. @@ -4387,6 +4391,9 @@ static void phb4_init_hw(struct phb4 *p, bool first_init) phb4_write_reg(p, PHB_CTRLR, val); + if (!first_init) + p->flags &= ~PHB4_CFG_USE_ASB; + /* Init_18..41 - Architected IODA3 inits */ phb4_init_ioda3(p);