mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86, microcode: unregister syscore_ops after microcode unloaded
@ 2011-03-29  8:34 Xiaotian Feng
  2011-03-29  9:17 ` [tip:x86/urgent] x86, microcode: Unregister " tip-bot for Xiaotian Feng
  2011-03-30 21:04 ` [PATCH] x86, microcode: unregister " Rafael J. Wysocki
  0 siblings, 2 replies; 3+ messages in thread
From: Xiaotian Feng @ 2011-03-29  8:34 UTC (permalink / raw)
  To: x86
  Cc: linux-kernel, Xiaotian Feng, Tigran Aivazian, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, Rafael J. Wysocki

Currently, microcode doesn't unregister syscore_ops after it's unloaded.
So if we modprobe then rmmod microcode, the stale microcode syscore_ops info
will stay on syscore_ops_list. Later when we're trying to reboot/halt/shutdown
the machine, kernel will panic on syscore_shutdown(). With the patch
applied, I can reboot/halt/shutdown my machine successfully.

Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk> 
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
---
 arch/x86/kernel/microcode_core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
index 5ed0ab5..f924280 100644
--- a/arch/x86/kernel/microcode_core.c
+++ b/arch/x86/kernel/microcode_core.c
@@ -550,6 +550,7 @@ static void __exit microcode_exit(void)
 	microcode_dev_exit();
 
 	unregister_hotcpu_notifier(&mc_cpu_notifier);
+	unregister_syscore_ops(&mc_syscore_ops);
 
 	get_online_cpus();
 	mutex_lock(&microcode_mutex);
-- 
1.7.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/urgent] x86, microcode: Unregister syscore_ops after microcode unloaded
  2011-03-29  8:34 [PATCH] x86, microcode: unregister syscore_ops after microcode unloaded Xiaotian Feng
@ 2011-03-29  9:17 ` tip-bot for Xiaotian Feng
  2011-03-30 21:04 ` [PATCH] x86, microcode: unregister " Rafael J. Wysocki
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Xiaotian Feng @ 2011-03-29  9:17 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, tigran, tglx, rjw, dfeng, mingo

Commit-ID:  4ac5fc6a3e4d90120f292526bcaa5ee182a7411b
Gitweb:     http://git.kernel.org/tip/4ac5fc6a3e4d90120f292526bcaa5ee182a7411b
Author:     Xiaotian Feng <dfeng@redhat.com>
AuthorDate: Tue, 29 Mar 2011 16:34:32 +0800
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 29 Mar 2011 11:12:04 +0200

x86, microcode: Unregister syscore_ops after microcode unloaded

Currently, microcode doesn't unregister syscore_ops after it's
unloaded. So if we modprobe then rmmod microcode, the stale
microcode syscore_ops info will stay on syscore_ops_list.

Later when we're trying to reboot/halt/shutdown the machine, kernel
will panic on syscore_shutdown().

With the patch applied, I can reboot/halt/shutdown my machine successfully.

Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
LKML-Reference: <1301387672-23661-1-git-send-email-dfeng@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/kernel/microcode_core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
index 5ed0ab5..f924280 100644
--- a/arch/x86/kernel/microcode_core.c
+++ b/arch/x86/kernel/microcode_core.c
@@ -550,6 +550,7 @@ static void __exit microcode_exit(void)
 	microcode_dev_exit();
 
 	unregister_hotcpu_notifier(&mc_cpu_notifier);
+	unregister_syscore_ops(&mc_syscore_ops);
 
 	get_online_cpus();
 	mutex_lock(&microcode_mutex);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86, microcode: unregister syscore_ops after microcode unloaded
  2011-03-29  8:34 [PATCH] x86, microcode: unregister syscore_ops after microcode unloaded Xiaotian Feng
  2011-03-29  9:17 ` [tip:x86/urgent] x86, microcode: Unregister " tip-bot for Xiaotian Feng
@ 2011-03-30 21:04 ` Rafael J. Wysocki
  1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2011-03-30 21:04 UTC (permalink / raw)
  To: Xiaotian Feng
  Cc: x86, linux-kernel, Tigran Aivazian, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin

On Tuesday, March 29, 2011, Xiaotian Feng wrote:
> Currently, microcode doesn't unregister syscore_ops after it's unloaded.
> So if we modprobe then rmmod microcode, the stale microcode syscore_ops info
> will stay on syscore_ops_list. Later when we're trying to reboot/halt/shutdown
> the machine, kernel will panic on syscore_shutdown(). With the patch
> applied, I can reboot/halt/shutdown my machine successfully.
> 
> Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
> Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk> 
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>

Acked-by: Rafael J. Wysocki <rjw@sisk.pl>

> ---
>  arch/x86/kernel/microcode_core.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
> index 5ed0ab5..f924280 100644
> --- a/arch/x86/kernel/microcode_core.c
> +++ b/arch/x86/kernel/microcode_core.c
> @@ -550,6 +550,7 @@ static void __exit microcode_exit(void)
>  	microcode_dev_exit();
>  
>  	unregister_hotcpu_notifier(&mc_cpu_notifier);
> +	unregister_syscore_ops(&mc_syscore_ops);
>  
>  	get_online_cpus();
>  	mutex_lock(&microcode_mutex);
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-30 21:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-29  8:34 [PATCH] x86, microcode: unregister syscore_ops after microcode unloaded Xiaotian Feng
2011-03-29  9:17 ` [tip:x86/urgent] x86, microcode: Unregister " tip-bot for Xiaotian Feng
2011-03-30 21:04 ` [PATCH] x86, microcode: unregister " Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome