Commit d89c19d8 authored by Anton Blanchard's avatar Anton Blanchard Committed by Linus Torvalds

[PATCH] ppc64: cleanups hpte_init_native, kill warning for !PSERIES builds

From: Christoph Hellwig <hch@lst.de>

This splits out a small helper that checks whether tlb batching should be
enabled from hpte_init_native, thus cleaning up the ifdef hell and killing
a warning for pmac builds.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6b198ade
...@@ -387,33 +387,37 @@ static void native_flush_hash_range(unsigned long context, ...@@ -387,33 +387,37 @@ static void native_flush_hash_range(unsigned long context,
local_irq_restore(flags); local_irq_restore(flags);
} }
void hpte_init_native(void)
{
#ifdef CONFIG_PPC_PSERIES #ifdef CONFIG_PPC_PSERIES
struct device_node *root; /* Disable TLB batching on nighthawk */
const char *model; static inline int tlb_batching_enabled(void)
#endif /* CONFIG_PPC_PSERIES */ {
struct device_node *root = of_find_node_by_path("/");
int enabled = 1;
if (root) {
const char *model = 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 hpte_init_native(void)
{
ppc_md.hpte_invalidate = native_hpte_invalidate; ppc_md.hpte_invalidate = native_hpte_invalidate;
ppc_md.hpte_updatepp = native_hpte_updatepp; ppc_md.hpte_updatepp = native_hpte_updatepp;
ppc_md.hpte_updateboltedpp = native_hpte_updateboltedpp; ppc_md.hpte_updateboltedpp = native_hpte_updateboltedpp;
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;
if (tlb_batching_enabled())
#ifdef CONFIG_PPC_PSERIES ppc_md.flush_hash_range = native_flush_hash_range;
/* Disable TLB batching on nighthawk */
root = of_find_node_by_path("/");
if (root) {
model = get_property(root, "model", NULL);
if (model && !strcmp(model, "IBM,9076-N81")) {
of_node_put(root);
goto bail;
}
of_node_put(root);
}
#endif /* CONFIG_PPC_PSERIES */
ppc_md.flush_hash_range = native_flush_hash_range;
bail:
htab_finish_init(); htab_finish_init();
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment