From patchwork Wed May 3 03:06:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rabara, Niravkumar L" X-Patchwork-Id: 13229460 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D074C77B78 for ; Wed, 3 May 2023 03:06:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229642AbjECDGv (ORCPT ); Tue, 2 May 2023 23:06:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjECDGs (ORCPT ); Tue, 2 May 2023 23:06:48 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3601C2682; Tue, 2 May 2023 20:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683083205; x=1714619205; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=7Ighfp5E/Al9/svQfOrOI4+bSPRt3bo1pMOcWF2LXzY=; b=DZV63wtMLR186izXzEPdxw2DxMqMkxGyTAp7bb8ExzsSUMnqF8vDofHI m0X+8NxDcZDyuhJblJKbP4vKPAp/mCQy8QXlWupMF8H/L3AbILocwkdHJ ovxRJNou18q0baKidJNK+JctVRFwuFVL9e4/cxV/Jgp6Ge9ESpzqHEC5u cSt+XxQIh6w6fkUQBcjTGoPUzh0T1r0F5E0MEh/x7bGAbTOu04/sVxU4v B+qUmFaY5kx7hWZjGJoQ1Ho1CTYa5veCPI5xOSx7utIEK4prlGZJ0MxnY ylXVTWeGyHjFaxWXOAzFwpPxPGvEf/ZPuvsNGfpAwF9NDuiT0bT3LicZ9 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10698"; a="347370808" X-IronPort-AV: E=Sophos;i="5.99,246,1677571200"; d="scan'208";a="347370808" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2023 20:06:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10698"; a="765983747" X-IronPort-AV: E=Sophos;i="5.99,246,1677571200"; d="scan'208";a="765983747" Received: from unknown (HELO localhost.localdomain) ([10.226.216.116]) by fmsmga004.fm.intel.com with ESMTP; 02 May 2023 20:06:42 -0700 From: niravkumar.l.rabara@intel.com To: Dinh Nguyen , Borislav Petkov , Tony Luck , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Niravkumar L Rabara Subject: [PATCH 1/2] firmware: stratix10-svc: Add command to get SEU error info Date: Wed, 3 May 2023 11:06:39 +0800 Message-Id: <20230503030639.3269266-1-niravkumar.l.rabara@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org From: Niravkumar L Rabara Introduce a new command to get Single Event Upset Error information. Signed-off-by: Niravkumar L Rabara --- include/linux/firmware/intel/stratix10-smc.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/linux/firmware/intel/stratix10-smc.h b/include/linux/firmware/intel/stratix10-smc.h index a718f853d457..7eb1799e8d8a 100644 --- a/include/linux/firmware/intel/stratix10-smc.h +++ b/include/linux/firmware/intel/stratix10-smc.h @@ -595,4 +595,24 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE) #define INTEL_SIP_SMC_FCS_GET_PROVISION_DATA \ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FCS_GET_PROVISION_DATA) +/** + * Request INTEL_SIP_SMC_READ_SEU_ERR + * Sync call to get Single Event Upsate Error information + * SEU detects both corrected and uncorrected error + * + * Call register usage: + * a0 INTEL_SIP_SMC_READ_SEU_ERR + * a1-7 not used + * + * Return status: + * a0 INTEL_SIP_SMC_STATUS_OK, INTEL_SIP_SMC_STATUS_NOT_SUPPORTED or + * INTEL_SIP_SMC_STATUS_ERROR + * a1 error count of response data + * a2 sector address of response data + * a3 error data + */ +#define INTEL_SIP_SMC_FUNCID_SEU_ERR_STATUS 143 +#define INTEL_SIP_SMC_READ_SEU_ERR \ + INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_SEU_ERR_STATUS) + #endif From patchwork Wed May 3 03:06:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rabara, Niravkumar L" X-Patchwork-Id: 13229461 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52759C77B78 for ; Wed, 3 May 2023 03:07:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229601AbjECDH2 (ORCPT ); Tue, 2 May 2023 23:07:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229707AbjECDHK (ORCPT ); Tue, 2 May 2023 23:07:10 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 778B03C31; Tue, 2 May 2023 20:07:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683083224; x=1714619224; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Rt+NiPHzZk0ufSm8/klt7oGsdG1fjJ5fZs7aIMtC/FE=; b=nMG8PNPN5V54JtguOPgZjez9lNHC6AALWkpOBQz2ZE5gctGFh6uPNSAA FwlsXtoYwI2seNF2QNcC84YdUivDsem7OCfWUYvSLOkenQT8SVeBnD5hk xJ/HGYB6wYoRgAj+qPcEC7W9HG1feqh6unFBq3NgDciIsWksqTS4tzCUh QAwxj/vJvxAHfYQtAsKEY4WO8tjvZrE0+flyumEVxggvegWwd1h2gEZLW +qkvNsG7+q1B9l+xn+V1nc8NmUq6rZqTxuVgxg2wOUGyo6RCDe7lyZUQp nqx/A4ot1mb2UOwr+yj+4q2xAVGeLKdJhh75+SYfAwI5h2IVdlJxLoJub g==; X-IronPort-AV: E=McAfee;i="6600,9927,10698"; a="347370857" X-IronPort-AV: E=Sophos;i="5.99,246,1677571200"; d="scan'208";a="347370857" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2023 20:07:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10698"; a="765983763" X-IronPort-AV: E=Sophos;i="5.99,246,1677571200"; d="scan'208";a="765983763" Received: from unknown (HELO localhost.localdomain) ([10.226.216.116]) by fmsmga004.fm.intel.com with ESMTP; 02 May 2023 20:07:01 -0700 From: niravkumar.l.rabara@intel.com To: Dinh Nguyen , Borislav Petkov , Tony Luck , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Niravkumar L Rabara Subject: [PATCH 2/2] EDAC/altera: Check previous DDR DBE during driver probe Date: Wed, 3 May 2023 11:06:56 +0800 Message-Id: <20230503030656.3269321-1-niravkumar.l.rabara@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org From: Niravkumar L Rabara Add DDR DBE check during driver probe to notify user if previous reboot cause by DDR DBE and print DBE error related information. Signed-off-by: Niravkumar L Rabara --- drivers/edac/altera_edac.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c index 8b31cd54bdb6..398a49a3eb89 100644 --- a/drivers/edac/altera_edac.c +++ b/drivers/edac/altera_edac.c @@ -2159,6 +2159,7 @@ static int altr_edac_a10_probe(struct platform_device *pdev) #ifdef CONFIG_64BIT { int dberror, err_addr; + struct arm_smccc_res result; edac->panic_notifier.notifier_call = s10_edac_dberr_handler; atomic_notifier_chain_register(&panic_notifier_list, @@ -2168,11 +2169,28 @@ static int altr_edac_a10_probe(struct platform_device *pdev) regmap_read(edac->ecc_mgr_map, S10_SYSMGR_UE_VAL_OFST, &dberror); if (dberror) { - regmap_read(edac->ecc_mgr_map, S10_SYSMGR_UE_ADDR_OFST, - &err_addr); - edac_printk(KERN_ERR, EDAC_DEVICE, - "Previous Boot UE detected[0x%X] @ 0x%X\n", - dberror, err_addr); + /* Bit-31 is set if previous DDR UE happened */ + if (dberror & (1 << 31)) { + /* Read previous DDR UE info */ + arm_smccc_smc(INTEL_SIP_SMC_READ_SEU_ERR, 0, + 0, 0, 0, 0, 0, 0, &result); + + if (!(int)result.a0) { + edac_printk(KERN_ERR, EDAC_DEVICE, + "Previous DDR UE:Count=0x%X,Address=0x%X,ErrorData=0x%X\n" + , (unsigned int)result.a1, (unsigned int)result.a2 + , (unsigned int)result.a3); + } else { + edac_printk(KERN_ERR, EDAC_DEVICE, + "INTEL_SIP_SMC_SEU_ERR_STATUS failed\n"); + } + } else { + regmap_read(edac->ecc_mgr_map, S10_SYSMGR_UE_ADDR_OFST, + &err_addr); + edac_printk(KERN_ERR, EDAC_DEVICE, + "Previous Boot UE detected[0x%X] @ 0x%X\n", + dberror, err_addr); + } /* Reset the sticky registers */ regmap_write(edac->ecc_mgr_map, S10_SYSMGR_UE_VAL_OFST, 0); @@ -2180,6 +2198,7 @@ static int altr_edac_a10_probe(struct platform_device *pdev) S10_SYSMGR_UE_ADDR_OFST, 0); } } + #else edac->db_irq = platform_get_irq(pdev, 1); if (edac->db_irq < 0)