From patchwork Tue Mar 14 10:25:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ananth N Mavinakayanahalli X-Patchwork-Id: 738623 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 3vj9rc1wt3z9s1y for ; Tue, 14 Mar 2017 21:26:40 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vj9rc0r4qzDqYl for ; Tue, 14 Mar 2017 21:26:40 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org 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 3vj9rT4V8hzDqGb for ; Tue, 14 Mar 2017 21:26:33 +1100 (AEDT) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2EANfRH035501 for ; Tue, 14 Mar 2017 06:26:30 -0400 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0b-001b2d01.pphosted.com with ESMTP id 295yhj75jy-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 14 Mar 2017 06:26:28 -0400 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 14 Mar 2017 20:26:25 +1000 Received: from d23relay08.au.ibm.com (202.81.31.227) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 14 Mar 2017 20:26:23 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2EAQF1O41353424 for ; Tue, 14 Mar 2017 21:26:23 +1100 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v2EAPnc9026565 for ; Tue, 14 Mar 2017 21:25:49 +1100 Received: from thinktux.in.ibm.com (thinktux.in.ibm.com [9.124.35.193]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v2EAPmFs025858; Tue, 14 Mar 2017 21:25:48 +1100 From: Ananth N Mavinakayanahalli To: skiboot@lists.ozlabs.org Date: Tue, 14 Mar 2017 15:55:25 +0530 User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-MML: disable x-cbid: 17031410-0040-0000-0000-000002FBBDCA X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17031410-0041-0000-0000-00000C6DA0F2 Message-Id: <148948712070.24742.9489087900353707753.stgit@thinktux.in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-14_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-1702020001 definitions=main-1703140086 Subject: [Skiboot] [PATCH] hw/fsp: Do not queue SP and SPCN class messages during reset/reload X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 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" During FSP R/R, the FSP is inaccessible and will lose state. Messages to the FSP are generally queued for sending later. It does seem like the FSP fails to process any subseuqent messages of certain classes (SP info -- ipmi) if it receives queued mbox messages it isn't expecting. In certain other cases (sensors), the FSP driver returns a default code (async completion) even though there is no known bound from the time of this error return to the actual data being available. The kernel driver keeps waiting leading to soft-lockup on the host side. Mitigate both these (known) cases by returning OPAL_BUSY so the host driver knows to retry later. With this change, the sensors command works fine when the FSP comes back. IPMI also works: [root@p8... ~]# ipmitool power status Chassis Power is on However, certain IPMI commands still have issues and these are being debugged at the ipmitool/host-driver layer. [root@p8... ~]# ipmitool fru FRU Device Description : Builtin FRU Device (ID 0) Get Device ID command failed: Unspecified error Signed-off-by: Ananth N Mavinakayanahalli Tested-by: Pridhiviraj Paidipeddi --- hw/fsp/fsp-ipmi.c | 3 +++ hw/fsp/fsp-sensor.c | 6 ++++++ hw/fsp/fsp.c | 16 ++++++++++++++++ include/fsp.h | 1 + 4 files changed, 26 insertions(+) diff --git a/hw/fsp/fsp-ipmi.c b/hw/fsp/fsp-ipmi.c index f803f17..7d7b52c 100644 --- a/hw/fsp/fsp-ipmi.c +++ b/hw/fsp/fsp-ipmi.c @@ -126,6 +126,9 @@ static int fsp_ipmi_send_request(void) struct fsp_msg *msg; int rc; + if (fsp_in_rr()) + return OPAL_BUSY; + lock(&fsp_ipmi.lock); /* An outstanding request is still pending */ if (fsp_ipmi.cur_msg) { diff --git a/hw/fsp/fsp-sensor.c b/hw/fsp/fsp-sensor.c index 0fa3115..6363530 100644 --- a/hw/fsp/fsp-sensor.c +++ b/hw/fsp/fsp-sensor.c @@ -376,6 +376,9 @@ static int64_t fsp_sensor_send_read_request(struct opal_sensor_data *attr) uint32_t align; uint32_t cmd_header; + if (fsp_in_rr()) + return OPAL_BUSY; + prlog(PR_INSANE, "Get the data for modifier [%x]\n", spcn_mod_data[attr->mod_index].mod); @@ -516,6 +519,9 @@ int64_t fsp_opal_read_sensor(uint32_t sensor_hndl, int token, prlog(PR_INSANE, "fsp_opal_read_sensor [%08x]\n", sensor_hndl); + if (fsp_in_rr()) + return OPAL_BUSY; + if (sensor_state == SENSOR_PERMANENT_ERROR) { rc = OPAL_HARDWARE; goto out; diff --git a/hw/fsp/fsp.c b/hw/fsp/fsp.c index c25e42c..a0c5a78 100644 --- a/hw/fsp/fsp.c +++ b/hw/fsp/fsp.c @@ -409,6 +409,22 @@ static bool fsp_in_reset(struct fsp *fsp) } } +bool fsp_in_rr(void) +{ + struct fsp *fsp = fsp_get_active(); + struct fsp_iopath *iop; + + if (fsp->active_iopath < 0) + return true; + + iop = &fsp->iopath[fsp->active_iopath]; + + if (fsp_in_reset(fsp) || fsp_in_hir(fsp) || !(psi_check_link_active(iop->psi))) + return true; + + return false; +} + static bool fsp_hir_state_timeout(void) { u64 now = mftb(); diff --git a/include/fsp.h b/include/fsp.h index 6142ca3..f75b6ad 100644 --- a/include/fsp.h +++ b/include/fsp.h @@ -810,6 +810,7 @@ extern void fsp_ipmi_init(void); extern void fsp_reinit_fsp(void); extern void fsp_trigger_reset(void); extern void fsp_reset_links(void); +extern bool fsp_in_rr(void); /* FSP memory errors */ extern void fsp_memory_err_init(void);