From patchwork Wed Dec 4 13:26:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gautham R Shenoy X-Patchwork-Id: 1204183 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.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 47SfmK5Bdpz9sR7 for ; Thu, 5 Dec 2019 00:27:45 +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 47SfmK49CHzDqXT for ; Thu, 5 Dec 2019 00:27:45 +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=ego@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 47SflB5LcszDqSq for ; Thu, 5 Dec 2019 00:26:45 +1100 (AEDT) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xB4DMw72078247 for ; Wed, 4 Dec 2019 08:26:42 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2wnsvj3ahy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 04 Dec 2019 08:26:41 -0500 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id xB4DN48B078933 for ; Wed, 4 Dec 2019 08:26:41 -0500 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com with ESMTP id 2wnsvj3ahp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Dec 2019 08:26:41 -0500 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id xB4DKGbT009134; Wed, 4 Dec 2019 13:26:41 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma03wdc.us.ibm.com with ESMTP id 2wkg26wftp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Dec 2019 13:26:41 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xB4DQd6v9568700 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Dec 2019 13:26:39 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D03CC124055; Wed, 4 Dec 2019 13:26:39 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 92A51124054; Wed, 4 Dec 2019 13:26:39 +0000 (GMT) Received: from sofia.ibm.com (unknown [9.124.31.190]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 4 Dec 2019 13:26:39 +0000 (GMT) Received: by sofia.ibm.com (Postfix, from userid 1000) id CD60B2E2F73; Wed, 4 Dec 2019 18:56:37 +0530 (IST) From: "Gautham R. Shenoy" To: Vasant Hegde , Vaidyanathan Srinivasan , "Oliver O'Halloran" Date: Wed, 4 Dec 2019 18:56:28 +0530 Message-Id: <1575465990-25353-2-git-send-email-ego@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1575465990-25353-1-git-send-email-ego@linux.vnet.ibm.com> References: <1575465990-25353-1-git-send-email-ego@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95, 18.0.572 definitions=2019-12-04_03:2019-12-04, 2019-12-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 impostorscore=0 priorityscore=1501 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 adultscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912040109 Subject: [Skiboot] [PATCH 1/3] xscom: Conditionally create elogs for read/write addr failures 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: Skiboot mailing list , "Gautham R. Shenoy" MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" From: "Gautham R. Shenoy" Currently we unconditionally create elogs for all xscom read/write failures. However some of the xscom read/write failures related to invalid address are not severe enough to cause a checkstop and it is sufficient to log these errors in opal msglog but not in elogs. This patch defines a new variable to indicate whether xscom read/write errors pertaining to invalid address should be logged in elogs. Signed-off-by: Gautham R. Shenoy --- hw/xscom.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/hw/xscom.c b/hw/xscom.c index f3f4e10..0cbc23b 100644 --- a/hw/xscom.c +++ b/hw/xscom.c @@ -54,6 +54,32 @@ static struct { */ static struct lock xscom_lock = LOCK_UNLOCKED; +static bool create_xscom_rw_addr_elog = true; + +static inline void log_xscom_rw_error(uint32_t gcid, uint32_t pcb_addr, + unsigned int stat, + bool is_write) +{ + /* + * If the failure is due to incorrect address, and we the + * caller doesn't want elog to be created, log the error in + * msglog and return. + */ + if (stat == 4 && !create_xscom_rw_addr_elog) { + prlog(PR_WARNING, + "XSCOM: %s error gcid=0x%x pcb_addr=0x%x stat=0x%x\n", + is_write ? "write" : "read", + gcid, pcb_addr, stat); + + return; + } + + 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); +} + static inline void *xscom_addr(uint32_t gcid, uint32_t pcb_addr) { struct proc_chip *chip = get_chip(gcid); @@ -272,10 +298,7 @@ static int64_t xscom_handle_error(uint64_t hmer, uint32_t gcid, uint32_t pcb_add 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_xscom_rw_error(gcid, pcb_addr, stat, is_write); /* We need to reset the XSCOM or we'll hang on the next access */ xscom_reset(gcid, false); From patchwork Wed Dec 4 13:26:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gautham R Shenoy X-Patchwork-Id: 1204182 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.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 47Sfm14dBrz9sPn for ; Thu, 5 Dec 2019 00:27:29 +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 47Sfm12q5GzDqVx for ; Thu, 5 Dec 2019 00:27:29 +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=ego@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 47SflB2yDGzDqSn for ; Thu, 5 Dec 2019 00:26:45 +1100 (AEDT) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xB4DO1Ma032436 for ; Wed, 4 Dec 2019 08:26:42 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 2wntc867d7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 04 Dec 2019 08:26:41 -0500 Received: from m0098413.ppops.net (m0098413.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id xB4DO9Yl033496 for ; Wed, 4 Dec 2019 08:26:41 -0500 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com with ESMTP id 2wntc867cm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Dec 2019 08:26:41 -0500 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id xB4DPv57011371; Wed, 4 Dec 2019 13:26:40 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma02dal.us.ibm.com with ESMTP id 2wkg26xuu0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Dec 2019 13:26:40 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xB4DQeCa57540922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Dec 2019 13:26:40 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 26D8B6E053; Wed, 4 Dec 2019 13:26:40 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D2A626E04E; Wed, 4 Dec 2019 13:26:39 +0000 (GMT) Received: from sofia.ibm.com (unknown [9.124.31.190]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 4 Dec 2019 13:26:39 +0000 (GMT) Received: by sofia.ibm.com (Postfix, from userid 1000) id E14312E2F7E; Wed, 4 Dec 2019 18:56:37 +0530 (IST) From: "Gautham R. Shenoy" To: Vasant Hegde , Vaidyanathan Srinivasan , "Oliver O'Halloran" Date: Wed, 4 Dec 2019 18:56:29 +0530 Message-Id: <1575465990-25353-3-git-send-email-ego@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1575465990-25353-1-git-send-email-ego@linux.vnet.ibm.com> References: <1575465990-25353-1-git-send-email-ego@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95, 18.0.572 definitions=2019-12-04_03:2019-12-04, 2019-12-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 phishscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 mlxscore=0 adultscore=0 clxscore=1011 priorityscore=1501 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912040109 Subject: [Skiboot] [PATCH 2/3] xscom: Add a create_addr_elog parameter to _xscom_read/write() calls 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: Skiboot mailing list , "Gautham R. Shenoy" MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" From: "Gautham R. Shenoy" Introduce an additional boolean parameter named create_addr_elog to the _xscom_read() and _xscom_write() calls to indicate whether PEL records should be created on xscom read/write failures pertaining to invalid address. Currently all the callers of these calls set the parameter to true. This will be used in the next patch where the failures of xscom read/write requests from the kernel will only be logged in the opal msglog but not in PEL. Signed-off-by: Gautham R. Shenoy --- hw/sbe-p8.c | 7 ++++--- hw/xscom.c | 22 ++++++++++++++++------ include/xscom.h | 10 ++++++---- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/hw/sbe-p8.c b/hw/sbe-p8.c index a26883c..9972594 100644 --- a/hw/sbe-p8.c +++ b/hw/sbe-p8.c @@ -89,7 +89,8 @@ void p8_sbe_update_timer_expiry(uint64_t new_target) do { /* Grab generation and spin if odd */ for (;;) { - rc = _xscom_read(sbe_timer_chip, 0xE0006, &gen, false); + rc = _xscom_read(sbe_timer_chip, 0xE0006, &gen, false, + true); if (rc) { prerror("SLW: Error %lld reading tmr gen " " count\n", rc); @@ -125,7 +126,7 @@ void p8_sbe_update_timer_expiry(uint64_t new_target) } } - rc = _xscom_write(sbe_timer_chip, 0x5003A, req, false); + rc = _xscom_write(sbe_timer_chip, 0x5003A, req, false, true); if (rc) { prerror("SLW: Error %lld writing tmr request\n", rc); _xscom_unlock(); @@ -133,7 +134,7 @@ void p8_sbe_update_timer_expiry(uint64_t new_target) } /* Re-check gen count */ - rc = _xscom_read(sbe_timer_chip, 0xE0006, &gen2, false); + rc = _xscom_read(sbe_timer_chip, 0xE0006, &gen2, false, true); if (rc) { prerror("SLW: Error %lld re-reading tmr gen " " count\n", rc); diff --git a/hw/xscom.c b/hw/xscom.c index 0cbc23b..e8cdabc 100644 --- a/hw/xscom.c +++ b/hw/xscom.c @@ -599,7 +599,8 @@ void _xscom_unlock(void) /* * External API */ -int _xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val, bool take_lock) +int _xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val, bool take_lock, + bool create_addr_elog) { uint32_t gcid; int rc; @@ -639,8 +640,10 @@ int _xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val, bool take_loc } /* HW822317 requires us to do global locking */ - if (take_lock) + if (take_lock) { lock(&xscom_lock); + create_xscom_rw_addr_elog = create_addr_elog; + } /* Direct vs indirect access */ if (pcb_addr & XSCOM_ADDR_IND_FLAG) @@ -649,14 +652,17 @@ int _xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val, bool take_loc rc = __xscom_read(gcid, pcb_addr & 0x7fffffff, val); /* Unlock it */ - if (take_lock) + if (take_lock) { + create_xscom_rw_addr_elog = true; unlock(&xscom_lock); + } return rc; } opal_call(OPAL_XSCOM_READ, xscom_read, 3); -int _xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val, bool take_lock) +int _xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val, bool take_lock, + bool create_addr_elog) { uint32_t gcid; int rc; @@ -684,8 +690,10 @@ int _xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val, bool take_loc } /* HW822317 requires us to do global locking */ - if (take_lock) + if (take_lock) { lock(&xscom_lock); + create_xscom_rw_addr_elog = create_addr_elog; + } /* Direct vs indirect access */ if (pcb_addr & XSCOM_ADDR_IND_FLAG) @@ -694,8 +702,10 @@ int _xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val, bool take_loc rc = __xscom_write(gcid, pcb_addr & 0x7fffffff, val); /* Unlock it */ - if (take_lock) + if (take_lock) { + create_xscom_rw_addr_elog = true; unlock(&xscom_lock); + } return rc; } opal_call(OPAL_XSCOM_WRITE, xscom_write, 3); diff --git a/include/xscom.h b/include/xscom.h index 8a466d5..7325a16 100644 --- a/include/xscom.h +++ b/include/xscom.h @@ -166,18 +166,20 @@ /* Use only in select places where multiple SCOMs are time/latency sensitive */ extern void _xscom_lock(void); -extern int _xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val, bool take_lock); -extern int _xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val, bool take_lock); +extern int _xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val, bool take_lock, + bool create_addr_elog); +extern int _xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val, bool take_lock, + bool create_addr_elog); extern void _xscom_unlock(void); /* Targeted SCOM access */ static inline int xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val) { - return _xscom_read(partid, pcb_addr, val, true); + return _xscom_read(partid, pcb_addr, val, true, true); } static inline int xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val) { - return _xscom_write(partid, pcb_addr, val, true); + return _xscom_write(partid, pcb_addr, val, true, true); } extern int xscom_write_mask(uint32_t partid, uint64_t pcb_addr, uint64_t val, uint64_t mask); From patchwork Wed Dec 4 13:26:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gautham R Shenoy X-Patchwork-Id: 1204181 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47SflT2NW6z9sPn for ; Thu, 5 Dec 2019 00:27:01 +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 47SflS46t2zDqTC for ; Thu, 5 Dec 2019 00:27:00 +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=ego@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 47SflB1NbtzDqSj for ; Thu, 5 Dec 2019 00:26:45 +1100 (AEDT) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xB4DMuoq135798 for ; Wed, 4 Dec 2019 08:26:42 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 2wnsqv3et2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 04 Dec 2019 08:26:42 -0500 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id xB4DNBul137834 for ; Wed, 4 Dec 2019 08:26:41 -0500 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0b-001b2d01.pphosted.com with ESMTP id 2wnsqv3ess-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Dec 2019 08:26:41 -0500 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id xB4DKFaK028508; Wed, 4 Dec 2019 13:26:41 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma03dal.us.ibm.com with ESMTP id 2wkg276xqc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Dec 2019 13:26:40 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xB4DQeA540763856 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Dec 2019 13:26:40 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 14F9C136055; Wed, 4 Dec 2019 13:26:40 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C133413604F; Wed, 4 Dec 2019 13:26:39 +0000 (GMT) Received: from sofia.ibm.com (unknown [9.124.31.190]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 4 Dec 2019 13:26:39 +0000 (GMT) Received: by sofia.ibm.com (Postfix, from userid 1000) id F14DC2E2F81; Wed, 4 Dec 2019 18:56:37 +0530 (IST) From: "Gautham R. Shenoy" To: Vasant Hegde , Vaidyanathan Srinivasan , "Oliver O'Halloran" Date: Wed, 4 Dec 2019 18:56:30 +0530 Message-Id: <1575465990-25353-4-git-send-email-ego@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1575465990-25353-1-git-send-email-ego@linux.vnet.ibm.com> References: <1575465990-25353-1-git-send-email-ego@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95, 18.0.572 definitions=2019-12-04_03:2019-12-04, 2019-12-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 priorityscore=1501 phishscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 mlxlogscore=990 suspectscore=0 bulkscore=0 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912040109 Subject: [Skiboot] [PATCH 3/3] xscom: Don't create PELs for non-severe read/write failures 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: Skiboot mailing list , "Gautham R. Shenoy" MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" From: "Gautham R. Shenoy" Certain xscom read/write calls initiated by the userspace (either via HBRT or xscom-utils) can fail with an incorrect-address error code due to known hardware errors. These failures are not severe, in that they do not cause the machine to checkstop and hence, elogs need not be created for them. This patch defines new function calls named opal_xscom_read() and opal_xscom_write() to map to OPAL_XSCOM_READ and OPAL_XSCOM_WRITE calls respectively, so that we can distinguish these calls from the calls to perform xscom-read/writes initiated within OPAL. Further, the patch ensures that we do not create PELs for opal_xscom_read()/write() failures due to incorrect address. Signed-off-by: Gautham R. Shenoy --- hw/xscom.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/xscom.c b/hw/xscom.c index e8cdabc..6da0d8c 100644 --- a/hw/xscom.c +++ b/hw/xscom.c @@ -659,7 +659,11 @@ int _xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val, bool take_loc return rc; } -opal_call(OPAL_XSCOM_READ, xscom_read, 3); +static int opal_xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val) +{ + return _xscom_read(partid, pcb_addr, val, true, false); +} +opal_call(OPAL_XSCOM_READ, opal_xscom_read, 3); int _xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val, bool take_lock, bool create_addr_elog) @@ -708,7 +712,12 @@ int _xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val, bool take_loc } return rc; } -opal_call(OPAL_XSCOM_WRITE, xscom_write, 3); + +static int opal_xscom_write(uint32_t partid, uint64_t pcb_addr, uint64_t val) +{ + return _xscom_write(partid, pcb_addr, val, true, false); +} +opal_call(OPAL_XSCOM_WRITE, opal_xscom_write, 3); /* * Perform a xscom read-modify-write.