From 1b7f3b6c43675ef2cfb9d8f48bde057794820f7c Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Fri, 13 Sep 2019 23:32:13 +1000 Subject: [PATCH] powerpc/eeh: Fix build with STACKTRACE=n The build breaks when STACKTRACE=n, eg. skiroot_defconfig: arch/powerpc/kernel/eeh_event.c:124:23: error: implicit declaration of function 'stack_trace_save' Fix it with some ifdefs for now. Fixes: 25baf3d81614 ("powerpc/eeh: Defer printing stack trace") Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/eeh.h | 2 ++ arch/powerpc/kernel/eeh_driver.c | 3 ++- arch/powerpc/kernel/eeh_event.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h index 9d0e1694a94d..6f9b2a12540a 100644 --- a/arch/powerpc/include/asm/eeh.h +++ b/arch/powerpc/include/asm/eeh.h @@ -89,6 +89,7 @@ struct eeh_pe { struct list_head child; /* Memb. child_list/eeh_phb_pe */ struct list_head edevs; /* List of eeh_dev in this PE */ +#ifdef CONFIG_STACKTRACE /* * Saved stack trace. When we find a PE freeze in eeh_dev_check_failure * the stack trace is saved here so we can print it in the recovery @@ -99,6 +100,7 @@ struct eeh_pe { */ unsigned long stack_trace[64]; int trace_entries; +#endif /* CONFIG_STACKTRACE */ }; #define eeh_pe_for_each_dev(pe, edev, tmp) \ diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c index 80bd157fcb45..d9279d0ee9f5 100644 --- a/arch/powerpc/kernel/eeh_driver.c +++ b/arch/powerpc/kernel/eeh_driver.c @@ -908,6 +908,7 @@ void eeh_handle_normal_event(struct eeh_pe *pe) eeh_pe_loc_get(pe), eeh_pe_loc_get(phb_pe)); } +#ifdef CONFIG_STACKTRACE /* * Print the saved stack trace now that we've verified there's * something to recover. @@ -926,7 +927,7 @@ void eeh_handle_normal_event(struct eeh_pe *pe) pe->trace_entries = 0; } - +#endif /* CONFIG_STACKTRACE */ eeh_pe_update_time_stamp(pe); pe->freeze_count++; diff --git a/arch/powerpc/kernel/eeh_event.c b/arch/powerpc/kernel/eeh_event.c index 1d55486adb0f..a7a8dc182efb 100644 --- a/arch/powerpc/kernel/eeh_event.c +++ b/arch/powerpc/kernel/eeh_event.c @@ -117,12 +117,14 @@ int __eeh_send_failure_event(struct eeh_pe *pe) * while the PE is sitting in the event queue. */ if (pe) { +#ifdef CONFIG_STACKTRACE /* * Save the current stack trace so we can dump it from the * event handler thread. */ pe->trace_entries = stack_trace_save(pe->stack_trace, ARRAY_SIZE(pe->stack_trace), 0); +#endif /* CONFIG_STACKTRACE */ eeh_pe_state_mark(pe, EEH_PE_RECOVERING); }