diff options
author | Adam Lackorzynski <adam@os.inf.tu-dresden.de> | 2010-07-20 18:18:19 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2010-07-20 18:27:33 -0400 |
commit | 087b255a2b43f417af83cb44e0bb02507f36b7fe (patch) | |
tree | 418edc69d7899911df1965ba5404a43cc19cffc0 /arch/x86/kernel/i8259.c | |
parent | f82c3d71d6fd2e6a3e3416f09099e29087e39abf (diff) |
x86, i8259: Only register sysdev if we have a real 8259 PIC
My platform makes use of the null_legacy_pic choice and oopses when doing
a shutdown as the shutdown code goes through all the registered sysdevs
and calls their shutdown method which in my case poke on a non-existing
i8259. Imho the i8259 specific sysdev should only be registered if the
i8259 is actually there.
Do not register the sysdev function when the null_legacy_pic is used so
that the i8259 resume, suspend and shutdown functions are not called.
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
LKML-Reference: <201007202218.o6KMIJ3m020955@imap1.linux-foundation.org>
Cc: Jacob Pan <jacob.jun.pan@intel.com>
Cc: <stable@kernel.org> 2.6.34
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/kernel/i8259.c')
-rw-r--r-- | arch/x86/kernel/i8259.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c index 7c9f02c130f3..cafa7c80ac95 100644 --- a/arch/x86/kernel/i8259.c +++ b/arch/x86/kernel/i8259.c | |||
@@ -276,16 +276,6 @@ static struct sys_device device_i8259A = { | |||
276 | .cls = &i8259_sysdev_class, | 276 | .cls = &i8259_sysdev_class, |
277 | }; | 277 | }; |
278 | 278 | ||
279 | static int __init i8259A_init_sysfs(void) | ||
280 | { | ||
281 | int error = sysdev_class_register(&i8259_sysdev_class); | ||
282 | if (!error) | ||
283 | error = sysdev_register(&device_i8259A); | ||
284 | return error; | ||
285 | } | ||
286 | |||
287 | device_initcall(i8259A_init_sysfs); | ||
288 | |||
289 | static void mask_8259A(void) | 279 | static void mask_8259A(void) |
290 | { | 280 | { |
291 | unsigned long flags; | 281 | unsigned long flags; |
@@ -407,3 +397,18 @@ struct legacy_pic default_legacy_pic = { | |||
407 | }; | 397 | }; |
408 | 398 | ||
409 | struct legacy_pic *legacy_pic = &default_legacy_pic; | 399 | struct legacy_pic *legacy_pic = &default_legacy_pic; |
400 | |||
401 | static int __init i8259A_init_sysfs(void) | ||
402 | { | ||
403 | int error; | ||
404 | |||
405 | if (legacy_pic != &default_legacy_pic) | ||
406 | return 0; | ||
407 | |||
408 | error = sysdev_class_register(&i8259_sysdev_class); | ||
409 | if (!error) | ||
410 | error = sysdev_register(&device_i8259A); | ||
411 | return error; | ||
412 | } | ||
413 | |||
414 | device_initcall(i8259A_init_sysfs); | ||