Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 044e7a41 authored by Yazen Ghannam's avatar Yazen Ghannam Committed by Borislav Petkov
Browse files

EDAC, amd64: Don't force-enable ECC checking on newer systems



It's not recommended for the OS to try and force-enable ECC checking.
This is considered a firmware task since it includes memory training,
etc, so don't change ECC settings on Fam17h or newer systems and inform
the user.

Signed-off-by: default avatarYazen Ghannam <Yazen.Ghannam@amd.com>
Cc: Aravind Gopalakrishnan <aravindksg.lkml@gmail.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/1479850816-1595-1-git-send-email-Yazen.Ghannam@amd.com


[ Put the "forcing" message in an else branch. ]
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
parent d12a969e
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -2629,7 +2629,6 @@ static void restore_ecc_error_reporting(struct ecc_settings *s, u16 nid,
{
{
	u32 value, mask = 0x3;		/* UECC/CECC enable */
	u32 value, mask = 0x3;		/* UECC/CECC enable */



	if (!s->nbctl_valid)
	if (!s->nbctl_valid)
		return;
		return;


@@ -2895,6 +2894,10 @@ static int probe_one_instance(unsigned int nid)
		if (!ecc_enable_override)
		if (!ecc_enable_override)
			goto err_enable;
			goto err_enable;


		if (boot_cpu_data.x86 >= 0x17) {
			amd64_warn("Forcing ECC on is not recommended on newer systems. Please enable ECC in BIOS.");
			goto err_enable;
		} else
			amd64_warn("Forcing ECC on!\n");
			amd64_warn("Forcing ECC on!\n");


		if (!enable_ecc_error_reporting(s, nid, F3))
		if (!enable_ecc_error_reporting(s, nid, F3))
@@ -2904,6 +2907,8 @@ static int probe_one_instance(unsigned int nid)
	ret = init_one_instance(nid);
	ret = init_one_instance(nid);
	if (ret < 0) {
	if (ret < 0) {
		amd64_err("Error probing instance: %d\n", nid);
		amd64_err("Error probing instance: %d\n", nid);

		if (boot_cpu_data.x86 < 0x17)
			restore_ecc_error_reporting(s, nid, F3);
			restore_ecc_error_reporting(s, nid, F3);
	}
	}