public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/ce4100: set pci ops via callback instead of module init
@ 2011-03-11 15:22 Sebastian Andrzej Siewior
  2011-03-11 16:49 ` Thomas Gleixner
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2011-03-11 15:22 UTC (permalink / raw)
  To: linux-kernel; +Cc: x86, sodaville

Setting those on subsys initcall will break any x86 platform except
ce4100 which could lead to complains from users.
To avoid those complains, I move to pci.init like others which use the
same kind of quirk.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 arch/x86/include/asm/ce4100.h     |    6 ++++++
 arch/x86/pci/ce4100.c             |    5 ++---
 arch/x86/platform/ce4100/ce4100.c |    9 +++++++++
 3 files changed, 17 insertions(+), 3 deletions(-)
 create mode 100644 arch/x86/include/asm/ce4100.h

diff --git a/arch/x86/include/asm/ce4100.h b/arch/x86/include/asm/ce4100.h
new file mode 100644
index 0000000..64db052
--- /dev/null
+++ b/arch/x86/include/asm/ce4100.h
@@ -0,0 +1,6 @@
+#ifndef _ASM_CE4100_H_
+#define _ASM_CE4100_H_
+
+void ce4100_init_pci_ops(void);
+
+#endif
diff --git a/arch/x86/pci/ce4100.c b/arch/x86/pci/ce4100.c
index c63c6d3..8117f72 100644
--- a/arch/x86/pci/ce4100.c
+++ b/arch/x86/pci/ce4100.c
@@ -34,6 +34,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 
+#include <asm/ce4100.h>
 #include <asm/pci_x86.h>
 
 struct sim_reg {
@@ -306,10 +307,8 @@ struct pci_raw_ops ce4100_pci_conf = {
 	.write = ce4100_conf_write,
 };
 
-static int __init ce4100_pci_init(void)
+void __init ce4100_init_pci_ops(void)
 {
 	init_sim_regs();
 	raw_pci_ops = &ce4100_pci_conf;
-	return 0;
 }
-subsys_initcall(ce4100_pci_init);
diff --git a/arch/x86/platform/ce4100/ce4100.c b/arch/x86/platform/ce4100/ce4100.c
index 68c0dbc..93b4e3c 100644
--- a/arch/x86/platform/ce4100/ce4100.c
+++ b/arch/x86/platform/ce4100/ce4100.c
@@ -15,6 +15,7 @@
 #include <linux/serial_reg.h>
 #include <linux/serial_8250.h>
 
+#include <asm/ce4100.h>
 #include <asm/prom.h>
 #include <asm/setup.h>
 #include <asm/i8259.h>
@@ -125,6 +126,13 @@ static void __cpuinit sdv_pci_init(void)
 }
 #endif
 
+static int __cpuinit ce4100_pci_init(void)
+{
+	ce4100_init_pci_ops();
+	pci_legacy_init();
+	return 0;
+}
+
 /*
  * CE4100 specific x86_init function overrides and early setup
  * calls.
@@ -136,6 +144,7 @@ void __init x86_ce4100_early_setup(void)
 	x86_init.resources.probe_roms = x86_init_noop;
 	x86_init.mpparse.get_smp_config = x86_init_uint_noop;
 	x86_init.mpparse.find_smp_config = x86_init_noop;
+	x86_init.pci.init = ce4100_pci_init;
 
 #ifdef CONFIG_X86_IO_APIC
 	x86_init.pci.init_irq = sdv_pci_init;
-- 
1.7.4


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

* Re: [PATCH] x86/ce4100: set pci ops via callback instead of module init
  2011-03-11 15:22 [PATCH] x86/ce4100: set pci ops via callback instead of module init Sebastian Andrzej Siewior
@ 2011-03-11 16:49 ` Thomas Gleixner
  2011-03-12 21:08   ` [PATCH v2] " Sebastian Andrzej Siewior
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2011-03-11 16:49 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: linux-kernel, x86, sodaville

On Fri, 11 Mar 2011, Sebastian Andrzej Siewior wrote:
>  
>  struct sim_reg {
> @@ -306,10 +307,8 @@ struct pci_raw_ops ce4100_pci_conf = {
>  	.write = ce4100_conf_write,
>  };
>  
> -static int __init ce4100_pci_init(void)

Why don't you keep the function name and make it non static, add the
call to pci_legacy_init() and just set the init.pci pointer to this?

So all pci is stuff is where it belongs

Thanks,

	tglx

> +void __init ce4100_init_pci_ops(void)
>  {
>  	init_sim_regs();
>  	raw_pci_ops = &ce4100_pci_conf;
> -	return 0;
>  }
> -subsys_initcall(ce4100_pci_init);
> diff --git a/arch/x86/platform/ce4100/ce4100.c b/arch/x86/platform/ce4100/ce4100.c
> index 68c0dbc..93b4e3c 100644
> --- a/arch/x86/platform/ce4100/ce4100.c
> +++ b/arch/x86/platform/ce4100/ce4100.c
> @@ -15,6 +15,7 @@
>  #include <linux/serial_reg.h>
>  #include <linux/serial_8250.h>
>  
> +#include <asm/ce4100.h>
>  #include <asm/prom.h>
>  #include <asm/setup.h>
>  #include <asm/i8259.h>
> @@ -125,6 +126,13 @@ static void __cpuinit sdv_pci_init(void)
>  }
>  #endif
>  
> +static int __cpuinit ce4100_pci_init(void)
> +{
> +	ce4100_init_pci_ops();
> +	pci_legacy_init();
> +	return 0;
> +}
> +
>  /*
>   * CE4100 specific x86_init function overrides and early setup
>   * calls.
> @@ -136,6 +144,7 @@ void __init x86_ce4100_early_setup(void)
>  	x86_init.resources.probe_roms = x86_init_noop;
>  	x86_init.mpparse.get_smp_config = x86_init_uint_noop;
>  	x86_init.mpparse.find_smp_config = x86_init_noop;
> +	x86_init.pci.init = ce4100_pci_init;
>  
>  #ifdef CONFIG_X86_IO_APIC
>  	x86_init.pci.init_irq = sdv_pci_init;
> -- 
> 1.7.4
> 

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

* [PATCH v2] x86/ce4100: set pci ops via callback instead of module init
  2011-03-11 16:49 ` Thomas Gleixner
@ 2011-03-12 21:08   ` Sebastian Andrzej Siewior
  2011-03-14  9:33     ` [PATCH v2 current] " Sebastian Andrzej Siewior
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2011-03-12 21:08 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Sebastian Andrzej Siewior, linux-kernel, x86, sodaville

Setting those on subsys initcall will break any x86 platform except
ce4100 which could lead to complains from users.
To avoid I move to pci.init like others which use the same kind of
quirk.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 arch/x86/include/asm/ce4100.h     |    6 ++++++
 arch/x86/pci/ce4100.c             |    6 +++---
 arch/x86/platform/ce4100/ce4100.c |    2 ++
 3 files changed, 11 insertions(+), 3 deletions(-)
 create mode 100644 arch/x86/include/asm/ce4100.h

diff --git a/arch/x86/include/asm/ce4100.h b/arch/x86/include/asm/ce4100.h
new file mode 100644
index 0000000..e656ad8
--- /dev/null
+++ b/arch/x86/include/asm/ce4100.h
@@ -0,0 +1,6 @@
+#ifndef _ASM_CE4100_H_
+#define _ASM_CE4100_H_
+
+int ce4100_pci_init(void);
+
+#endif
diff --git a/arch/x86/pci/ce4100.c b/arch/x86/pci/ce4100.c
index c63c6d3..ed6060c 100644
--- a/arch/x86/pci/ce4100.c
+++ b/arch/x86/pci/ce4100.c
@@ -34,6 +34,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 
+#include <asm/ce4100.h>
 #include <asm/pci_x86.h>
 
 struct sim_reg {
@@ -306,10 +307,9 @@ struct pci_raw_ops ce4100_pci_conf = {
 	.write = ce4100_conf_write,
 };
 
-static int __init ce4100_pci_init(void)
+int __init ce4100_pci_init(void)
 {
 	init_sim_regs();
 	raw_pci_ops = &ce4100_pci_conf;
-	return 0;
+	return pci_legacy_init();
 }
-subsys_initcall(ce4100_pci_init);
diff --git a/arch/x86/platform/ce4100/ce4100.c b/arch/x86/platform/ce4100/ce4100.c
index 68c0dbc..28071bb 100644
--- a/arch/x86/platform/ce4100/ce4100.c
+++ b/arch/x86/platform/ce4100/ce4100.c
@@ -15,6 +15,7 @@
 #include <linux/serial_reg.h>
 #include <linux/serial_8250.h>
 
+#include <asm/ce4100.h>
 #include <asm/prom.h>
 #include <asm/setup.h>
 #include <asm/i8259.h>
@@ -136,6 +137,7 @@ void __init x86_ce4100_early_setup(void)
 	x86_init.resources.probe_roms = x86_init_noop;
 	x86_init.mpparse.get_smp_config = x86_init_uint_noop;
 	x86_init.mpparse.find_smp_config = x86_init_noop;
+	x86_init.pci.init = ce4100_pci_init;
 
 #ifdef CONFIG_X86_IO_APIC
 	x86_init.pci.init_irq = sdv_pci_init;
-- 
1.7.4


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

* [PATCH v2 current] x86/ce4100: set pci ops via callback instead of module init
  2011-03-12 21:08   ` [PATCH v2] " Sebastian Andrzej Siewior
@ 2011-03-14  9:33     ` Sebastian Andrzej Siewior
  2011-03-14 14:16       ` [tip:x86/urgent] x86: ce4100: Set " tip-bot for Sebastian Andrzej Siewior
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2011-03-14  9:33 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: Thomas Gleixner, linux-kernel, x86, sodaville

Setting those on subsys initcall will break any x86 platform except
ce4100 which could lead to complains from users.
To avoid I move to pci.init like others which use the same kind of
quirk.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---

This is against v2.6.38-rc8. The PCI file joined the kernel in
v2.6.38-rc1.

 arch/x86/include/asm/ce4100.h     |    6 ++++++
 arch/x86/pci/ce4100.c             |    6 +++---
 arch/x86/platform/ce4100/ce4100.c |    2 ++
 3 files changed, 11 insertions(+), 3 deletions(-)
 create mode 100644 arch/x86/include/asm/ce4100.h

diff --git a/arch/x86/include/asm/ce4100.h b/arch/x86/include/asm/ce4100.h
new file mode 100644
index 0000000..e656ad8
--- /dev/null
+++ b/arch/x86/include/asm/ce4100.h
@@ -0,0 +1,6 @@
+#ifndef _ASM_CE4100_H_
+#define _ASM_CE4100_H_
+
+int ce4100_pci_init(void);
+
+#endif
diff --git a/arch/x86/pci/ce4100.c b/arch/x86/pci/ce4100.c
index 85b68ef..1ec2841 100644
--- a/arch/x86/pci/ce4100.c
+++ b/arch/x86/pci/ce4100.c
@@ -34,6 +34,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 
+#include <asm/ce4100.h>
 #include <asm/pci_x86.h>
 
 struct sim_reg {
@@ -306,10 +307,9 @@ struct pci_raw_ops ce4100_pci_conf = {
 	.write = ce4100_conf_write,
 };
 
-static int __init ce4100_pci_init(void)
+int __init ce4100_pci_init(void)
 {
 	init_sim_regs();
 	raw_pci_ops = &ce4100_pci_conf;
-	return 0;
+	return pci_legacy_init();
 }
-subsys_initcall(ce4100_pci_init);
diff --git a/arch/x86/platform/ce4100/ce4100.c b/arch/x86/platform/ce4100/ce4100.c
index d2c0d51..cd6f184 100644
--- a/arch/x86/platform/ce4100/ce4100.c
+++ b/arch/x86/platform/ce4100/ce4100.c
@@ -15,6 +15,7 @@
 #include <linux/serial_reg.h>
 #include <linux/serial_8250.h>
 
+#include <asm/ce4100.h>
 #include <asm/setup.h>
 #include <asm/io.h>
 
@@ -129,4 +130,5 @@ void __init x86_ce4100_early_setup(void)
 	x86_init.resources.probe_roms = x86_init_noop;
 	x86_init.mpparse.get_smp_config = x86_init_uint_noop;
 	x86_init.mpparse.find_smp_config = sdv_find_smp_config;
+	x86_init.pci.init = ce4100_pci_init;
 }
-- 
1.7.4


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

* [tip:x86/urgent] x86: ce4100: Set pci ops via callback instead of module init
  2011-03-14  9:33     ` [PATCH v2 current] " Sebastian Andrzej Siewior
@ 2011-03-14 14:16       ` tip-bot for Sebastian Andrzej Siewior
  0 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Sebastian Andrzej Siewior @ 2011-03-14 14:16 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, bigeasy, tglx

Commit-ID:  03150171dcf9492a96f57cbb2aef088bafcfcd2e
Gitweb:     http://git.kernel.org/tip/03150171dcf9492a96f57cbb2aef088bafcfcd2e
Author:     Sebastian Andrzej Siewior <bigeasy@linutronix.de>
AuthorDate: Mon, 14 Mar 2011 10:33:40 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 14 Mar 2011 15:13:23 +0100

x86: ce4100: Set pci ops via callback instead of module init

Setting the pci ops on subsys initcall unconditionally will break
multi platform kernels on anything except ce4100.

Use x86_init.pci.init ops to call this only on real ce4100 platforms.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: sodaville@linutronix.de
LKML-Reference: <20110314093340.GA21026@www.tglx.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/include/asm/ce4100.h     |    6 ++++++
 arch/x86/pci/ce4100.c             |    7 ++++---
 arch/x86/platform/ce4100/ce4100.c |    2 ++
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/ce4100.h b/arch/x86/include/asm/ce4100.h
new file mode 100644
index 0000000..e656ad8
--- /dev/null
+++ b/arch/x86/include/asm/ce4100.h
@@ -0,0 +1,6 @@
+#ifndef _ASM_CE4100_H_
+#define _ASM_CE4100_H_
+
+int ce4100_pci_init(void);
+
+#endif
diff --git a/arch/x86/pci/ce4100.c b/arch/x86/pci/ce4100.c
index 85b68ef..9260b3e 100644
--- a/arch/x86/pci/ce4100.c
+++ b/arch/x86/pci/ce4100.c
@@ -34,6 +34,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 
+#include <asm/ce4100.h>
 #include <asm/pci_x86.h>
 
 struct sim_reg {
@@ -306,10 +307,10 @@ struct pci_raw_ops ce4100_pci_conf = {
 	.write = ce4100_conf_write,
 };
 
-static int __init ce4100_pci_init(void)
+int __init ce4100_pci_init(void)
 {
 	init_sim_regs();
 	raw_pci_ops = &ce4100_pci_conf;
-	return 0;
+	/* Indicate caller that it should invoke pci_legacy_init() */
+	return 1;
 }
-subsys_initcall(ce4100_pci_init);
diff --git a/arch/x86/platform/ce4100/ce4100.c b/arch/x86/platform/ce4100/ce4100.c
index d2c0d51..cd6f184 100644
--- a/arch/x86/platform/ce4100/ce4100.c
+++ b/arch/x86/platform/ce4100/ce4100.c
@@ -15,6 +15,7 @@
 #include <linux/serial_reg.h>
 #include <linux/serial_8250.h>
 
+#include <asm/ce4100.h>
 #include <asm/setup.h>
 #include <asm/io.h>
 
@@ -129,4 +130,5 @@ void __init x86_ce4100_early_setup(void)
 	x86_init.resources.probe_roms = x86_init_noop;
 	x86_init.mpparse.get_smp_config = x86_init_uint_noop;
 	x86_init.mpparse.find_smp_config = sdv_find_smp_config;
+	x86_init.pci.init = ce4100_pci_init;
 }

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

end of thread, other threads:[~2011-03-14 14:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-11 15:22 [PATCH] x86/ce4100: set pci ops via callback instead of module init Sebastian Andrzej Siewior
2011-03-11 16:49 ` Thomas Gleixner
2011-03-12 21:08   ` [PATCH v2] " Sebastian Andrzej Siewior
2011-03-14  9:33     ` [PATCH v2 current] " Sebastian Andrzej Siewior
2011-03-14 14:16       ` [tip:x86/urgent] x86: ce4100: Set " tip-bot for Sebastian Andrzej Siewior

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