From patchwork Fri May 4 09:43:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Jain X-Patchwork-Id: 908633 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40cnD12Dqcz9s1d for ; Fri, 4 May 2018 19:44:33 +1000 (AEST) 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 40cnD10yNZzDqnn for ; Fri, 4 May 2018 19:44:33 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com 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.156.1; 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 (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 40cnCs3S6MzDqhm for ; Fri, 4 May 2018 19:44:24 +1000 (AEST) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w449hisq078155 for ; Fri, 4 May 2018 05:44:21 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hrmvrrvsu-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 04 May 2018 05:44:21 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 4 May 2018 10:44:19 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 4 May 2018 10:44:17 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w449iGDt3277268; Fri, 4 May 2018 09:44:16 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5F43511C1A6; Fri, 4 May 2018 10:35:49 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 05CEB11C1A5; Fri, 4 May 2018 10:35:48 +0100 (BST) Received: from vajain21.in.ibm.com (unknown [9.109.223.43]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 4 May 2018 10:35:47 +0100 (BST) From: Vaibhav Jain To: Stewart Smith , Nicholas Piggin Date: Fri, 4 May 2018 15:13:41 +0530 X-Mailer: git-send-email 2.14.3 X-TM-AS-GCONF: 00 x-cbid: 18050409-0040-0000-0000-00000454EB46 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18050409-0041-0000-0000-000020F91710 Message-Id: <20180504094341.24907-1-vaibhav@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-04_03:, , 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 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805040091 Subject: [Skiboot] [RESEND-PATCH] core/opal: Fix recursion check in opal_run_pollers() X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Frederic Barrat , skiboot@lists.ozlabs.org MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" An earlier commit introduced a counter variable poller_recursion to limit to the number number of error messages shown when opal_pollers are run recursively. However the check for the counter value was placed in a way that the poller recursion was only detected first 16 times and then allowed afterwards. This patch fixes this by moving the check for the counter value inside the conditional branch with some re-factoring so that opal_poller recursion is not erroneously allowed after poll_recursion is detected first 16 times. Fixes: b6a729e118f4 ("Limit number of Poller recursion detected errors to display") Signed-off-by: Vaibhav Jain --- Changelog: Resend -> Previous patch didn't make to the skiboot mailing list due to a list membership glitch. --- core/opal.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core/opal.c b/core/opal.c index 3642fb04..e3a3bbde 100644 --- a/core/opal.c +++ b/core/opal.c @@ -552,20 +552,25 @@ void opal_run_pollers(void) bool was_in_poller; /* Don't re-enter on this CPU, unless it was an OPAL re-entry */ - if (this_cpu()->in_opal_call == 1 && - this_cpu()->in_poller && poller_recursion < 16) { + if (this_cpu()->in_opal_call == 1 && this_cpu()->in_poller) { + /** * @fwts-label OPALPollerRecursion * @fwts-advice Recursion detected in opal_run_pollers(). This * indicates a bug in OPAL where a poller ended up running * pollers, which doesn't lead anywhere good. */ - disable_fast_reboot("Poller recursion detected."); - prlog(PR_ERR, "OPAL: Poller recursion detected.\n"); - backtrace(); poller_recursion++; + if (poller_recursion <= 16) { + disable_fast_reboot("Poller recursion detected."); + prlog(PR_ERR, "OPAL: Poller recursion detected.\n"); + backtrace(); + + } + if (poller_recursion == 16) prlog(PR_ERR, "OPAL: Squashing future poller recursion warnings (>16).\n"); + return; } was_in_poller = this_cpu()->in_poller;