From patchwork Tue May 31 11:46:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vipin K Parashar X-Patchwork-Id: 628173 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rJsD34nNYz9t42 for ; Tue, 31 May 2016 21:47:15 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3rJsD33stNzDqcp for ; Tue, 31 May 2016 21:47:15 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 3rJsD03gSQzDqc9 for ; Tue, 31 May 2016 21:47:12 +1000 (AEST) Received: from pps.filterd (m0048827.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u4VBdQ1o009319 for ; Tue, 31 May 2016 07:47:10 -0400 Message-Id: <201605311147.u4VBdQ1o009319@mx0a-001b2d01.pphosted.com> Received: from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141]) by mx0a-001b2d01.pphosted.com with ESMTP id 2395qdyh2x-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 31 May 2016 07:47:09 -0400 Received: from localhost by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 31 May 2016 21:47:07 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 31 May 2016 21:47:06 +1000 X-IBM-Helo: d23dlp03.au.ibm.com X-IBM-MailFrom: vipin@linux.vnet.ibm.com X-IBM-RcptTo: skiboot@lists.ozlabs.org Received: from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 654FE3578061 for ; Tue, 31 May 2016 21:47:00 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u4VBkoMT17236206 for ; Tue, 31 May 2016 21:47:00 +1000 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u4VBkQEN015251 for ; Tue, 31 May 2016 21:46:26 +1000 Received: from Thinkpad420.in.ibm.com ([9.124.210.99]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u4VBkODB014662; Tue, 31 May 2016 21:46:25 +1000 From: Vipin K Parashar To: skiboot@lists.ozlabs.org Date: Tue, 31 May 2016 17:16:08 +0530 X-Mailer: git-send-email 2.1.4 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16053111-0048-0000-0000-0000018C6DD5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16053111-0049-0000-0000-000045D89D8A X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-05-31_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=12 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1605310136 Subject: [Skiboot] [PATCH] hw/xscom: Reset XSCOM engine after querying sleeping core FIR X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" XSCOM engine blocks subsequently after querying FIR of any sleeping core. This causes subsequent XSCOM opertions to hang forever due to XSCOM engine being continuously busy. Reset XSCOM engine after querying FIR of any sleeping core. Cc: stable Signed-off-by: Vipin K Parashar Signed-off-by: Vaidyanathan Srinivasan --- Note: This patch needs below patch: hw/xscom: Reset XSCOM engine after finite number of Link: https://patchwork.ozlabs.org/patch/628160/ Please apply above patch first for trying out this one. hw/xscom.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/hw/xscom.c b/hw/xscom.c index 2649a50..d081c4d 100644 --- a/hw/xscom.c +++ b/hw/xscom.c @@ -126,6 +126,7 @@ static void xscom_reset(uint32_t gcid) static int64_t xscom_handle_error(uint64_t hmer, uint32_t gcid, uint32_t pcb_addr, bool is_write, int64_t retries) { + int64_t ret; struct timespec ts; unsigned int stat = GETFIELD(SPR_HMER_XSCOM_STATUS, hmer); @@ -163,21 +164,23 @@ static int64_t xscom_handle_error(uint64_t hmer, uint32_t gcid, uint32_t pcb_add gcid, pcb_addr, stat); return OPAL_BUSY; - /* CPU is asleep, don't retry */ + /* CPU is asleep, reset and return. */ case 2: - return OPAL_WRONG_STATE; - } + ret = OPAL_WRONG_STATE; + break; - /* XXX: Create error log entry ? */ - log_simple_error(&e_info(OPAL_RC_XSCOM_RW), - "XSCOM: %s error gcid=0x%x pcb_addr=0x%x stat=0x%x\n", - is_write ? "write" : "read", gcid, pcb_addr, stat); + /* Log error, reset and return. */ + default: + ret = OPAL_HARDWARE; + log_simple_error(&e_info(OPAL_RC_XSCOM_RW), + "XSCOM: %s error gcid=0x%x pcb_addr=0x%x stat=0x%x\n", + is_write ? "write" : "read", gcid, pcb_addr, stat); + } - /* We need to reset the XSCOM or we'll hang on the next access */ + /* Reset XSCOM engine before returning else we'll hang on the next access */ xscom_reset(gcid); - /* Non recovered ... just fail */ - return OPAL_HARDWARE; + return ret; } static void xscom_handle_ind_error(uint64_t data, uint32_t gcid,