From patchwork Tue Jan 8 09:58:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Jain X-Patchwork-Id: 1021821 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43Ynml4YDpz9sDr for ; Tue, 8 Jan 2019 20:59:51 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 43Ynml3M0nzDqSF for ; Tue, 8 Jan 2019 20:59:51 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=linux.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=vaibhav@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.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 43YnmD6wJZzDqPW for ; Tue, 8 Jan 2019 20:59:24 +1100 (AEDT) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id x089x63R072541 for ; Tue, 8 Jan 2019 04:59:21 -0500 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2pvsjkrfnn-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 08 Jan 2019 04:59:21 -0500 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Jan 2019 09:59:19 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 8 Jan 2019 09:59:18 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x089xG2u44171496 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 8 Jan 2019 09:59:17 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CD34BAE04D; Tue, 8 Jan 2019 09:59:16 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2833DAE045; Tue, 8 Jan 2019 09:59:15 +0000 (GMT) Received: from vajain21.in.ibm.com (unknown [9.109.223.28]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 8 Jan 2019 09:59:14 +0000 (GMT) From: Vaibhav Jain To: Frederic Barrat , Andrew Donnellan , Christophe Lombard , Stewart Smith , Vasant Hegde Date: Tue, 8 Jan 2019 15:28:54 +0530 X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19010809-0016-0000-0000-00000241DE19 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19010809-0017-0000-0000-0000329BF0C8 Message-Id: <20190108095902.24718-1-vaibhav@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-01-08_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=883 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901080082 Subject: [Skiboot] [PATCH v3 0/8] Enable fast-reboot support for CAPI-2 X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: skiboot@lists.ozlabs.org Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Presently enabling CAPP for a CAPI-2 adapter disables fast-reset [1]. This was needed as CAPP uses PHB to interact with the CAPI adapter and we need to explicitly enable special mode on the PHB to allow CAPP traffic to flow. Without gracefully shutting down CAPP, PEC/PHB and CAPP will be forced to go in a fence loop during fast-reboot. This happens as CAPP, when it sees PHB link down raise CAPP FIR(31:PHB Link Down) and goes into recovery. PEC on the other hand when it sees CAPP error raises NFIR(24:cxa_pe_capp_error) and again raises a fence. To break this fence loop, this patch-set issues a CRESET to the PHB attached to the CAPP during fast-reset. During this CRESET we execute a h/w sequence to disable CAPP and reset the PEC/PHB registers. We also leverage the Opal syncers framework to drive Opal creset state machine during fast-reboot. At a very high level following flow is executed to disable CAPP: 1. Issue CRESET on the PHB 2. During CRESET disable CAPP 3. Once CRESET completes let fast-reboot continue. The structure of patch-set is as follows (remains mostly same as previous patchset): First 4 patches are re-factoring/modification patches that implement necessary infrastructure needed for forcing a creset at kernel shutdown. We start with slight modification of opal-syncers framework followed by a patch that introduces a new pci_slot_op named 'completed_sm_run()' that makes it easier to detect when pci reset state machine is completed. We then introduce a new struct named 'capp' as a member of 'struct phb4'. The fourth patch refactors the phb4_set_capi_mode() function to use newly introduced 'struct capp' With above infrastructure in place subsequent 4 patches implements a sequence needed to perform various h/w routines to disable CAPP when pci creset is triggered during kernel shutdown. Credits: This patchset is based earlier work by "Andrew Donnellan" to implemented support for CAPI-1 fast-reboot [2]. References: [1]: 53c4553d('capp: Disable fast-reboot when capp is enabled') [2]: ddb880fe('fast-reboot: remove CAPI check') Vaibhav Jain (8): opal: Update opal_del_host_sync_notifier() to accept 'void *data' core/pci: Introduce a new pci_slot_op named completed_sm_run() capp/phb: Introduce 'struct capp' to hold capp related info in 'struct phb' phb4/capp: Update and re-factor phb4_set_capi_mode() capp/phb4: Force CAPP to PCIe mode during kernel shutdown capp/phb4: Introduce PHB4 flag, PHB4_CAPP_DISABLE to disable CAPP phb4/capp: Implement sequence to disable CAPP and enable fast-reset capp/phb4: Prevent HMI from getting triggered when disabling CAPP core/opal.c | 7 +- core/pci-slot.c | 6 +- hw/capp.c | 12 ++ hw/phb4.c | 331 +++++++++++++++++++++++++++++++++++----- include/capp.h | 12 ++ include/chip.h | 1 - include/opal-internal.h | 2 +- include/pci-slot.h | 1 + include/phb4.h | 4 + 9 files changed, 334 insertions(+), 42 deletions(-) Change-log: v3: * Addressed various review comments from Christophe and Andrew. * Move the new struct named 'capp' as member of 'struct phb4' instead of 'struct phb'. * Moved the hunks around that were breaking bisection. * Introduced new helpers named capp_xscom_read()/write() * Added review sign-offs from previous patchsets to patch descriptions. v2: * Addressed various review comments from Stewart, Fred, Andrew and Vasant. * Introduced a new struct named 'capp' as member of 'struct phb' to hold CAPP related info. * Re-ordered the patches.