From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA9E3351FBD; Fri, 21 Nov 2025 13:58:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763733488; cv=none; b=pZt+gYhbTGKJp+zGd28zFNDWIsiYBbox7x64uQk7rxmo4gs6xYX6xptwxOgua1uuEQitHRyHFlTWrjXQKoKSTajH62DfXpx1M5Aa/cUNAl4m4Ucvq2aC+w+fM6y95cU8zmI7wz6V84UuhrphMeHjMBlq8P6IhylvwAbmLQu5dAU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763733488; c=relaxed/simple; bh=eApUGkwmwQvYnBRCzhlM8IxSQ5S1ZUk6P5tvzIjci0s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rC/6vzCV+4NQ5qIqOm3s4dRdtHzboo/qNIg8RpSV48ROCpqKI3Vvq3C7xK224VSKzg1kdtGj+p1MgDRLHzzZkI8MbmiXb3HHo//127FiLZUGQz6CH2EGXhBwegxHu0tESHIaO2XyoagdGbQFqgE7M8FuYGL5qhVhPH42t5Y91hw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=D7iflR+o; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="D7iflR+o" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C85DAC4CEF1; Fri, 21 Nov 2025 13:58:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1763733486; bh=eApUGkwmwQvYnBRCzhlM8IxSQ5S1ZUk6P5tvzIjci0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D7iflR+op4YczrMRRNzafyWD+l6kluZqmaV9s6K/r1eXCLrtII6NsFw4172eDwjw/ Do8uuZznGJqQXUyZLzW4lVdnz6tKlztw4V4W2OxG3CWKObYxYTuiYY6b0ANN8Kx41s yRFpZOhx6GXdEGHLXwE0jWf4U5ORWTno7v0a465o= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Niravkumar L Rabara , "Borislav Petkov (AMD)" , Dinh Nguyen Subject: [PATCH 6.6 484/529] EDAC/altera: Handle OCRAM ECC enable after warm reset Date: Fri, 21 Nov 2025 14:13:03 +0100 Message-ID: <20251121130248.228969823@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121130230.985163914@linuxfoundation.org> References: <20251121130230.985163914@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Niravkumar L Rabara commit fd3ecda38fe0cb713d167b5477d25f6b350f0514 upstream. The OCRAM ECC is always enabled either by the BootROM or by the Secure Device Manager (SDM) during a power-on reset on SoCFPGA. However, during a warm reset, the OCRAM content is retained to preserve data, while the control and status registers are reset to their default values. As a result, ECC must be explicitly re-enabled after a warm reset. Fixes: 17e47dc6db4f ("EDAC/altera: Add Stratix10 OCRAM ECC support") Signed-off-by: Niravkumar L Rabara Signed-off-by: Borislav Petkov (AMD) Acked-by: Dinh Nguyen Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20251111080801.1279401-1-niravkumarlaxmidas.rabara@altera.com Signed-off-by: Greg Kroah-Hartman --- drivers/edac/altera_edac.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) --- a/drivers/edac/altera_edac.c +++ b/drivers/edac/altera_edac.c @@ -1194,10 +1194,22 @@ altr_check_ocram_deps_init(struct altr_e if (ret) return ret; - /* Verify OCRAM has been initialized */ + /* + * Verify that OCRAM has been initialized. + * During a warm reset, OCRAM contents are retained, but the control + * and status registers are reset to their default values. Therefore, + * ECC must be explicitly re-enabled in the control register. + * Error condition: if INITCOMPLETEA is clear and ECC_EN is already set. + */ if (!ecc_test_bits(ALTR_A10_ECC_INITCOMPLETEA, - (base + ALTR_A10_ECC_INITSTAT_OFST))) - return -ENODEV; + (base + ALTR_A10_ECC_INITSTAT_OFST))) { + if (!ecc_test_bits(ALTR_A10_ECC_EN, + (base + ALTR_A10_ECC_CTRL_OFST))) + ecc_set_bits(ALTR_A10_ECC_EN, + (base + ALTR_A10_ECC_CTRL_OFST)); + else + return -ENODEV; + } /* Enable IRQ on Single Bit Error */ writel(ALTR_A10_ECC_SERRINTEN, (base + ALTR_A10_ECC_ERRINTENS_OFST));