From patchwork Wed Dec 5 23:50:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 1008541 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 439FqW1mDfz9s47 for ; Thu, 6 Dec 2018 10:51:03 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.ru Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 439FqW0DCszDr3Z for ; Thu, 6 Dec 2018 10:51:03 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.ru X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=ozlabs.ru (client-ip=107.173.13.209; helo=ozlabs.ru; envelope-from=aik@ozlabs.ru; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.ru Received: from ozlabs.ru (unknown [107.173.13.209]) by lists.ozlabs.org (Postfix) with ESMTP id 439FqL2DkNzDr1c for ; Thu, 6 Dec 2018 10:50:52 +1100 (AEDT) Received: from fstn1-p1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id 8F550AE80014; Wed, 5 Dec 2018 18:50:18 -0500 (EST) From: Alexey Kardashevskiy To: skiboot@lists.ozlabs.org Date: Thu, 6 Dec 2018 10:50:13 +1100 Message-Id: <20181205235013.68364-1-aik@ozlabs.ru> X-Mailer: git-send-email 2.17.1 Subject: [Skiboot] [PATCH skiboot] npu2: Return sensible PCI error when not frozen 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: Reza Arbab MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The current kernel calls OPAL_PCI_EEH_FREEZE_STATUS with an uninitialized @pci_error_type parameter and then analyzes it even if the OPAL call returned OPAL_SUCCESS. This is results in unexpected EEH events and NPU freezes. This initializes @pci_error_type and @severity to known safe values. Signed-off-by: Alexey Kardashevskiy Reviewed-by: Andrew Donnellan --- The corresponding kernel patch is under review: https://patchwork.ozlabs.org/patch/999630/ --- hw/npu2.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/npu2.c b/hw/npu2.c index 767306f..674ffee 100644 --- a/hw/npu2.c +++ b/hw/npu2.c @@ -1313,8 +1313,8 @@ static struct pci_slot *npu2_slot_create(struct phb *phb) int64_t npu2_freeze_status(struct phb *phb __unused, uint64_t pe_number __unused, uint8_t *freeze_state, - uint16_t *pci_error_type __unused, - uint16_t *severity __unused, + uint16_t *pci_error_type, + uint16_t *severity, uint64_t *phb_status __unused) { /* @@ -1324,6 +1324,10 @@ int64_t npu2_freeze_status(struct phb *phb __unused, * it keeps the skiboot PCI enumeration going. */ *freeze_state = OPAL_EEH_STOPPED_NOT_FROZEN; + *pci_error_type = OPAL_EEH_NO_ERROR; + if (severity) + *severity = OPAL_EEH_SEV_NO_ERROR; + return OPAL_SUCCESS; }