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

Commit 8e166991 authored by Michael Ellerman's avatar Michael Ellerman Committed by Benjamin Herrenschmidt
Browse files

powerpc: Remove tlb batching hack for nighthawk



In hpte_init_native() we call tlb_batching_enabled() to decide if we
should setup ppc_md.flush_hash_range.

tlb_batching_enabled() checks the _unflattened_ device tree, to see
if we are running on a nighthawk.

Since commit a2235354 ("dont allow pSeries_probe to succeed without
initialising MMU", Dec 2006), hpte_init_native() has been called from
pSeries_probe() - at which point we have not yet unflattened the
device tree.

This means tlb_batching_enabled() will always return true, so the hack
has effectively been disabled since Dec 2006. Ergo, I think we can
drop it.

Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Acked-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 466921c5
Loading
Loading
Loading
Loading
+1 −25
Original line number Original line Diff line number Diff line
@@ -569,29 +569,6 @@ static void native_flush_hash_range(unsigned long number, int local)
	local_irq_restore(flags);
	local_irq_restore(flags);
}
}


#ifdef CONFIG_PPC_PSERIES
/* Disable TLB batching on nighthawk */
static inline int tlb_batching_enabled(void)
{
	struct device_node *root = of_find_node_by_path("/");
	int enabled = 1;

	if (root) {
		const char *model = of_get_property(root, "model", NULL);
		if (model && !strcmp(model, "IBM,9076-N81"))
			enabled = 0;
		of_node_put(root);
	}

	return enabled;
}
#else
static inline int tlb_batching_enabled(void)
{
	return 1;
}
#endif

void __init hpte_init_native(void)
void __init hpte_init_native(void)
{
{
	ppc_md.hpte_invalidate	= native_hpte_invalidate;
	ppc_md.hpte_invalidate	= native_hpte_invalidate;
@@ -600,6 +577,5 @@ void __init hpte_init_native(void)
	ppc_md.hpte_insert	= native_hpte_insert;
	ppc_md.hpte_insert	= native_hpte_insert;
	ppc_md.hpte_remove	= native_hpte_remove;
	ppc_md.hpte_remove	= native_hpte_remove;
	ppc_md.hpte_clear_all	= native_hpte_clear;
	ppc_md.hpte_clear_all	= native_hpte_clear;
	if (tlb_batching_enabled())
	ppc_md.flush_hash_range = native_flush_hash_range;
	ppc_md.flush_hash_range = native_flush_hash_range;
}
}