From patchwork Thu Mar 12 12:41:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 1253533 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) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48dT6f6Shlz9sNg for ; Thu, 12 Mar 2020 23:44:26 +1100 (AEDT) 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 48dT6f5xHVzDqjY for ; Thu, 12 Mar 2020 23:44:26 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=hegdevasant@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 48dT6X0L6zzDqLb for ; Thu, 12 Mar 2020 23:44:19 +1100 (AEDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02CCfTDu152814 for ; Thu, 12 Mar 2020 08:44:16 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2yqn5nrhsp-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 12 Mar 2020 08:44:14 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 12 Mar 2020 12:41:50 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 12 Mar 2020 12:41:48 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02CCflQe24445074 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Mar 2020 12:41:47 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A1AD6A4040; Thu, 12 Mar 2020 12:41:47 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9B585A4053; Thu, 12 Mar 2020 12:41:46 +0000 (GMT) Received: from hegdevasant.in.ibm.com (unknown [9.193.108.153]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 12 Mar 2020 12:41:46 +0000 (GMT) From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Thu, 12 Mar 2020 18:11:45 +0530 X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 20031212-0008-0000-0000-0000035C1499 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20031212-0009-0000-0000-00004A7D5E45 Message-Id: <20200312124145.21279-1-hegdevasant@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-03-12_04:2020-03-11, 2020-03-12 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 priorityscore=1501 phishscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 lowpriorityscore=0 suspectscore=1 spamscore=0 clxscore=1015 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003120069 Subject: [Skiboot] [PATCH] Revert "FSP: Disable PSI link whenever FSP tells OPAL about impending R/R" 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: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" This reverts commit a4788a49f004a91bb8ca015336abf9ae119fbc52. Above patch was added to handle host power down with FSP in R/R state. But FSP is not liking OPAL giving up PSI link early in R/R process. For FSP initiated R/R OPAL should wait until we get PSI interrupt. Hence reverting above commit. Also partially reverting commit e04a34af to make fsp_dpo_pending as global variable. We have made several improvement in the way we handle FSP communication and also in power down path. Now if host sends powerdown message when FSP in RR, OPAL return OPAL_BUSY_EVENT. Kernel will run poller() and retry power down message after sometime. So I think this patch will not have any side effect on power down path. Cc: Ananth N Mavinakayanahalli Signed-off-by: Vasant Hegde Acked-by: Ananth N Mavinakayanahalli --- Oliver, I have tested this patch with FSP RR followed by host power down scenario. It worked fine. Once FSP booted it detected power down command and moved host to standby state. -Vasant hw/fsp/fsp-dpo.c | 2 +- hw/fsp/fsp.c | 25 +++++++++++++++++-------- include/fsp.h | 1 + 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/hw/fsp/fsp-dpo.c b/hw/fsp/fsp-dpo.c index da83a93d8..8f0861ed4 100644 --- a/hw/fsp/fsp-dpo.c +++ b/hw/fsp/fsp-dpo.c @@ -18,7 +18,7 @@ #define DPO_CMD_SGN_BYTE1 0x20 /* Byte[1] signature */ #define DPO_TIMEOUT 2700 /* 45 minutes in seconds */ -static bool fsp_dpo_pending; +bool fsp_dpo_pending; static unsigned long fsp_dpo_init_tb; /* diff --git a/hw/fsp/fsp.c b/hw/fsp/fsp.c index 392cf5d36..117810bf8 100644 --- a/hw/fsp/fsp.c +++ b/hw/fsp/fsp.c @@ -726,14 +726,23 @@ static void fsp_handle_errors(struct fsp *fsp) if (fsp->state == fsp_mbx_rr) return; - /* - * Its possible that the host has gone down, and OPAL is on - * its way down and hence will not see the subsequent PSI - * interrupt. So, just give up the link here. - */ - psi_disable_link(psi); - prlog(PR_NOTICE, "FSP #%d: FSP in reset." - " Giving up PSI link\n", fsp->index); + if (fsp_dpo_pending) { + /* + * If we are about to process a reset when DPO + * is pending, its possible that the host has + * gone down, and OPAL is on its way down and + * hence will not see the subsequent PSI interrupt. + * So, just give up the link here. + */ + prlog(PR_NOTICE, "FSP #%d: FSP reset with DPO pending." + " Giving up PSI link\n", + fsp->index); + psi_disable_link(psi); + } else { + prlog(PR_NOTICE, "FSP #%d: FSP in Reset." + " Waiting for PSI interrupt\n", + fsp->index); + } fsp_start_rr(fsp); } diff --git a/include/fsp.h b/include/fsp.h index ec079a274..472ce62ff 100644 --- a/include/fsp.h +++ b/include/fsp.h @@ -842,6 +842,7 @@ extern void fsp_epow_init(void); /* DPO */ extern void fsp_dpo_init(void); +extern bool fsp_dpo_pending; /* Chiptod */ extern void fsp_chiptod_init(void);