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

Commit c6cb3b5f authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Paul Mackerras
Browse files

[PATCH] powerpc: enable NAP only on cpus who support it to avoid memory corruption



This patch fixes incorrect setting of powersave_nap to 1 on all
PowerMacs, potentially causing memory corruption on some models. This
bug was introuced by me during the 32/64 bits merge.

Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent cd9c99d7
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -2491,9 +2491,7 @@ static int __init probe_motherboard(void)
			pmac_mb.model_id = PMAC_TYPE_COMET;
			pmac_mb.model_id = PMAC_TYPE_COMET;
		iounmap(mach_id_ptr);
		iounmap(mach_id_ptr);
	}
	}
#endif /* CONFIG_POWER4 */


#ifdef CONFIG_6xx
	/* Set default value of powersave_nap on machines that support it.
	/* Set default value of powersave_nap on machines that support it.
	 * It appears that uninorth rev 3 has a problem with it, we don't
	 * It appears that uninorth rev 3 has a problem with it, we don't
	 * enable it on those. In theory, the flush-on-lock property is
	 * enable it on those. In theory, the flush-on-lock property is
@@ -2522,10 +2520,11 @@ static int __init probe_motherboard(void)
	 * NAP mode
	 * NAP mode
	 */
	 */
	powersave_lowspeed = 1;
	powersave_lowspeed = 1;
#endif /* CONFIG_6xx */

#ifdef CONFIG_POWER4
#else /* CONFIG_POWER4 */
	powersave_nap = 1;
	powersave_nap = 1;
#endif
#endif  /* CONFIG_POWER4 */

	/* Check for "mobile" machine */
	/* Check for "mobile" machine */
	if (model && (strncmp(model, "PowerBook", 9) == 0
	if (model && (strncmp(model, "PowerBook", 9) == 0
		   || strncmp(model, "iBook", 5) == 0))
		   || strncmp(model, "iBook", 5) == 0))
+0 −4
Original line number Original line Diff line number Diff line
@@ -621,10 +621,6 @@ static void __init pmac_init_early(void)
	/* Probe motherboard chipset */
	/* Probe motherboard chipset */
	pmac_feature_init();
	pmac_feature_init();


	/* We can NAP */
	powersave_nap = 1;
	printk(KERN_INFO "Using native/NAP idle loop\n");

	/* Initialize debug stuff */
	/* Initialize debug stuff */
	udbg_scc_init(!!strstr(cmd_line, "sccdbg"));
	udbg_scc_init(!!strstr(cmd_line, "sccdbg"));
	udbg_adb_init(!!strstr(cmd_line, "btextdbg"));
	udbg_adb_init(!!strstr(cmd_line, "btextdbg"));