* [PATCH] x86, i8259: Only register sysdev for real PIC
@ 2010-06-02 11:31 Adam Lackorzynski
2010-06-03 1:18 ` Andrew Morton
0 siblings, 1 reply; 4+ messages in thread
From: Adam Lackorzynski @ 2010-06-02 11:31 UTC (permalink / raw)
To: Jacob Pan, H. Peter Anvin, linux-kernel
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>
---
arch/x86/kernel/i8259.c | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c
index 7c9f02c..dfadc74 100644
--- a/arch/x86/kernel/i8259.c
+++ b/arch/x86/kernel/i8259.c
@@ -276,16 +276,6 @@ static struct sys_device device_i8259A = {
.cls = &i8259_sysdev_class,
};
-static int __init i8259A_init_sysfs(void)
-{
- int error = sysdev_class_register(&i8259_sysdev_class);
- if (!error)
- error = sysdev_register(&device_i8259A);
- return error;
-}
-
-device_initcall(i8259A_init_sysfs);
-
static void mask_8259A(void)
{
unsigned long flags;
@@ -407,3 +397,19 @@ struct legacy_pic default_legacy_pic = {
};
struct legacy_pic *legacy_pic = &default_legacy_pic;
+
+static int __init i8259A_init_sysfs(void)
+{
+ int error;
+
+ if (legacy_pic != &default_legacy_pic)
+ return 0;
+
+ error = sysdev_class_register(&i8259_sysdev_class);
+ if (!error)
+ error = sysdev_register(&device_i8259A);
+ return error;
+}
+
+device_initcall(i8259A_init_sysfs);
+
--
1.5.6.5
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] x86, i8259: Only register sysdev for real PIC
2010-06-02 11:31 [PATCH] x86, i8259: Only register sysdev for real PIC Adam Lackorzynski
@ 2010-06-03 1:18 ` Andrew Morton
2010-06-03 9:01 ` Adam Lackorzynski
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2010-06-03 1:18 UTC (permalink / raw)
To: Adam Lackorzynski; +Cc: Jacob Pan, H. Peter Anvin, linux-kernel
On Wed, 2 Jun 2010 13:31:50 +0200 Adam Lackorzynski <adam@os.inf.tu-dresden.de> wrote:
> 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.
What are the effects of this change? Does it fix an oops or a hang, or
nothing at all, or...?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86, i8259: Only register sysdev for real PIC
2010-06-03 1:18 ` Andrew Morton
@ 2010-06-03 9:01 ` Adam Lackorzynski
2010-06-03 16:45 ` Andrew Morton
0 siblings, 1 reply; 4+ messages in thread
From: Adam Lackorzynski @ 2010-06-03 9:01 UTC (permalink / raw)
To: Andrew Morton; +Cc: Jacob Pan, H. Peter Anvin, linux-kernel
On Wed Jun 02, 2010 at 18:18:14 -0700, Andrew Morton wrote:
> On Wed, 2 Jun 2010 13:31:50 +0200 Adam Lackorzynski <adam@os.inf.tu-dresden.de> wrote:
>
> > 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.
>
> What are the effects of this change? Does it fix an oops or a hang, or
> nothing at all, or...?
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.
Adam
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86, i8259: Only register sysdev for real PIC
2010-06-03 9:01 ` Adam Lackorzynski
@ 2010-06-03 16:45 ` Andrew Morton
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2010-06-03 16:45 UTC (permalink / raw)
To: Adam Lackorzynski; +Cc: Jacob Pan, H. Peter Anvin, linux-kernel
On Thu, 3 Jun 2010 11:01:41 +0200 Adam Lackorzynski <adam@os.inf.tu-dresden.de> wrote:
>
> On Wed Jun 02, 2010 at 18:18:14 -0700, Andrew Morton wrote:
> > On Wed, 2 Jun 2010 13:31:50 +0200 Adam Lackorzynski <adam@os.inf.tu-dresden.de> wrote:
> >
> > > 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.
> >
> > What are the effects of this change? Does it fix an oops or a hang, or
> > nothing at all, or...?
>
> 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.
OK, thanks. Important info, that. I'd say that makes it something we
should fix in 2.6.34.x and perhaps earlier.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-06-03 16:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-02 11:31 [PATCH] x86, i8259: Only register sysdev for real PIC Adam Lackorzynski
2010-06-03 1:18 ` Andrew Morton
2010-06-03 9:01 ` Adam Lackorzynski
2010-06-03 16:45 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox