From 4a34ed5c767e9ed2f47977f8e1719bb2f1c013a5 Mon Sep 17 00:00:00 2001 From: Yang Yingliang Date: Mon, 14 Jan 2019 16:35:57 +0800 Subject: [PATCH] Revert "kexec: add kexec_device_shutdown()" This reverts commit 3f5824d84929e058b82a0dcd28a6a8b13339cc00. Signed-off-by: Yang Yingliang --- include/linux/kexec.h | 2 -- kernel/kexec_core.c | 35 ----------------------------------- kernel/panic.c | 1 - 3 files changed, 38 deletions(-) diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 2c238921aa60..9e4e638fb505 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -275,7 +275,6 @@ int kexec_should_crash(struct task_struct *); int kexec_crash_loaded(void); void crash_save_cpu(struct pt_regs *regs, int cpu); extern int kimage_crash_copy_vmcoreinfo(struct kimage *image); -extern void kexec_device_shutdown(void); extern struct kimage *kexec_image; extern struct kimage *kexec_crash_image; @@ -365,7 +364,6 @@ static inline void __crash_kexec(struct pt_regs *regs) { } static inline void crash_kexec(struct pt_regs *regs) { } static inline int kexec_should_crash(struct task_struct *p) { return 0; } static inline int kexec_crash_loaded(void) { return 0; } -static inline void kexec_device_shutdown(void) { }; #define kexec_in_progress false #endif /* CONFIG_KEXEC_CORE */ diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index dff789639544..23a83a4da38a 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -923,39 +923,6 @@ struct kimage *kexec_image; struct kimage *kexec_crash_image; int kexec_load_disabled; -void kexec_device_shutdown(void) -{ - int len; - char *p = saved_command_line; - - p = strstr(p, "kexec_shutdown_device="); - if (p) { - int i; - char c; - char drv_name[128]; - - memset(drv_name, 0, 128); - p += strlen("kexec_shutdown_device="); - c = *p; - i = 0; - while (c != '\0' && c != ' ') { - if (c != '\\' && i < 127) { - drv_name[i] = c; - i++; - } else if (drv_name[0] != '\0') { - pr_info("drv name:%s\n", drv_name); - device_shutdown_by_driver(drv_name); - memset(drv_name, 0, 128); - i = 0; - } - p++; - c = *p; - } - if (drv_name[0] != '\0') - device_shutdown_by_driver(drv_name); - } -} - /* * No panic_cpu check version of crash_kexec(). This function is called * only when panic_cpu holds the current CPU number; this is the only CPU @@ -977,8 +944,6 @@ void __noclone __crash_kexec(struct pt_regs *regs) crash_setup_regs(&fixed_regs, regs); crash_save_vmcoreinfo(); - if (!crash_kexec_post_notifiers) - kexec_device_shutdown(); machine_crash_shutdown(&fixed_regs); machine_kexec(kexec_crash_image); } diff --git a/kernel/panic.c b/kernel/panic.c index 767f004045b2..6a6df23acd1a 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -209,7 +209,6 @@ void panic(const char *fmt, ...) * kmsg_dump, we will need architecture dependent extra * works in addition to stopping other CPUs. */ - kexec_device_shutdown(); crash_smp_send_stop(); } -- GitLab