All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms
@ 2010-07-05 15:03 feng.tang
  2010-07-05 15:03 ` [PATCH v2 1/5] x86: add i8042 pre-detection hook to x86_platform_ops feng.tang
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: feng.tang @ 2010-07-05 15:03 UTC (permalink / raw)
  To: linux-kernel, tglx, mingo, hpa, jacob.jun.pan, dtor, randy.dunlap
  Cc: Feng Tang

From: Feng Tang <feng.tang@intel.com>

Hi All,

Some x86 platforms like intel MID platforms don't have i8042 controllers,
and i8042 driver's probe to some non-exist legacy IO ports may hang
the MID processor. 

Current solution for this is add dependency of SERIO_I8042 over
!X86_MRST, then if we build a x86 kernel image with X86_MRST=y,
it won't have i8042 driver support over common x86 platforms.

So we add a i8042 pre-detect hook into x86_platforms ops, so that
i8042 driver can use it to run-time judge whether to go on with
probe process.

Please review these patches.

Thanks,
Feng

Changelog:
	v2:
	   * only call x86_platforms.i8042_detect() for x86 platforms

----------------
Feng Tang (5):
  x86: add i8042 pre-detection hook to x86_platform_ops
  x86, mrst: add i8042_detect API for Moorestwon platform
  Revert "Input: do not force selecting i8042 on Moorestown"
  Revert "Input: fixup X86_MRST selects"
  input: i8042 - add runtime check in x86's i8042_platform_init

 arch/x86/include/asm/x86_init.h       |    2 ++
 arch/x86/kernel/mrst.c                |    7 +++++++
 arch/x86/kernel/x86_init.c            |    4 +++-
 drivers/input/keyboard/Kconfig        |    4 ++--
 drivers/input/mouse/Kconfig           |    2 +-
 drivers/input/serio/Kconfig           |    2 +-
 drivers/input/serio/i8042-x86ia64io.h |    6 ++++++
 7 files changed, 22 insertions(+), 5 deletions(-)


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

* [PATCH v2 1/5] x86: add i8042 pre-detection hook to x86_platform_ops
  2010-07-05 15:03 [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms feng.tang
@ 2010-07-05 15:03 ` feng.tang
  2010-07-08  7:16   ` [tip:x86/urgent] x86: Add " tip-bot for Feng Tang
  2010-07-05 15:03 ` [PATCH v2 2/5] x86, mrst: add i8042_detect API for Moorestwon platform feng.tang
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: feng.tang @ 2010-07-05 15:03 UTC (permalink / raw)
  To: linux-kernel, tglx, mingo, hpa, jacob.jun.pan, dtor, randy.dunlap
  Cc: Feng Tang

From: Feng Tang <feng.tang@intel.com>

Some x86 platforms like intel MID platforms don't have i8042 controllers,
and i8042 driver's probe to some legacy IO ports may hang the MID
processor. With this hook, i8042 driver can runtime check and skip the
probe when the pretection fail which also saves some probe time

Signed-off-by: Feng Tang <feng.tang@intel.com>
---
 arch/x86/include/asm/x86_init.h |    2 ++
 arch/x86/kernel/x86_init.c      |    4 +++-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index 519b543..baa579c 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -142,6 +142,7 @@ struct x86_cpuinit_ops {
  * @set_wallclock:		set time back to HW clock
  * @is_untracked_pat_range	exclude from PAT logic
  * @nmi_init			enable NMI on cpus
+ * @i8042_detect		pre-detect if i8042 controller exists
  */
 struct x86_platform_ops {
 	unsigned long (*calibrate_tsc)(void);
@@ -150,6 +151,7 @@ struct x86_platform_ops {
 	void (*iommu_shutdown)(void);
 	bool (*is_untracked_pat_range)(u64 start, u64 end);
 	void (*nmi_init)(void);
+	int (*i8042_detect)(void);
 };
 
 extern struct x86_init_ops x86_init;
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 61a1e8c..1e0c863 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -85,6 +85,7 @@ struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = {
 };
 
 static void default_nmi_init(void) { };
+static int default_i8042_detect(void) { return 1; };
 
 struct x86_platform_ops x86_platform = {
 	.calibrate_tsc			= native_calibrate_tsc,
@@ -92,5 +93,6 @@ struct x86_platform_ops x86_platform = {
 	.set_wallclock			= mach_set_rtc_mmss,
 	.iommu_shutdown			= iommu_shutdown_noop,
 	.is_untracked_pat_range		= is_ISA_range,
-	.nmi_init			= default_nmi_init
+	.nmi_init			= default_nmi_init,
+	.i8042_detect			= default_i8042_detect
 };
-- 
1.7.0.4


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

* [PATCH v2 2/5] x86, mrst: add i8042_detect API for Moorestwon platform
  2010-07-05 15:03 [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms feng.tang
  2010-07-05 15:03 ` [PATCH v2 1/5] x86: add i8042 pre-detection hook to x86_platform_ops feng.tang
@ 2010-07-05 15:03 ` feng.tang
  2010-07-08  7:16   ` [tip:x86/urgent] x86, mrst: Add " tip-bot for Feng Tang
  2010-07-05 15:03 ` [PATCH v2 3/5] Revert "Input: do not force selecting i8042 on Moorestown" feng.tang
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: feng.tang @ 2010-07-05 15:03 UTC (permalink / raw)
  To: linux-kernel, tglx, mingo, hpa, jacob.jun.pan, dtor, randy.dunlap
  Cc: Feng Tang

From: Feng Tang <feng.tang@intel.com>

It will just return 0 as there is no i8042 controller

Signed-off-by: Feng Tang <feng.tang@intel.com>
---
 arch/x86/kernel/mrst.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/mrst.c b/arch/x86/kernel/mrst.c
index e796448..5915e0b 100644
--- a/arch/x86/kernel/mrst.c
+++ b/arch/x86/kernel/mrst.c
@@ -216,6 +216,12 @@ static void __init mrst_setup_boot_clock(void)
 		setup_boot_APIC_clock();
 };
 
+/* MID systems don't have i8042 controller */
+static int mrst_i8042_detect(void)
+{
+	return 0;
+}
+
 /*
  * Moorestown specific x86_init function overrides and early setup
  * calls.
@@ -233,6 +239,7 @@ void __init x86_mrst_early_setup(void)
 	x86_cpuinit.setup_percpu_clockev = mrst_setup_secondary_clock;
 
 	x86_platform.calibrate_tsc = mrst_calibrate_tsc;
+	x86_platform.i8042_detect = mrst_i8042_detect;
 	x86_init.pci.init = pci_mrst_init;
 	x86_init.pci.fixup_irqs = x86_init_noop;
 
-- 
1.7.0.4


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

* [PATCH v2 3/5] Revert "Input: do not force selecting i8042 on Moorestown"
  2010-07-05 15:03 [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms feng.tang
  2010-07-05 15:03 ` [PATCH v2 1/5] x86: add i8042 pre-detection hook to x86_platform_ops feng.tang
  2010-07-05 15:03 ` [PATCH v2 2/5] x86, mrst: add i8042_detect API for Moorestwon platform feng.tang
@ 2010-07-05 15:03 ` feng.tang
  2010-07-08  7:16   ` [tip:x86/urgent] " tip-bot for Feng Tang
  2010-07-05 15:03 ` [PATCH v2 4/5] Revert "Input: fixup X86_MRST selects" feng.tang
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: feng.tang @ 2010-07-05 15:03 UTC (permalink / raw)
  To: linux-kernel, tglx, mingo, hpa, jacob.jun.pan, dtor, randy.dunlap
  Cc: Feng Tang, Jacob Pan

From: Feng Tang <feng.tang@intel.com>

This reverts commit 685afae02557a178185a4be36f58332976e79f63.

After adding x86_platform's detection for i8042 controller, we
don't need the force dependency on !X86_MRST any more

Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Feng Tang <feng.tang@intel.com>
---
 drivers/input/keyboard/Kconfig |    2 +-
 drivers/input/mouse/Kconfig    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 0f9a478..917eec3 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -73,7 +73,7 @@ config KEYBOARD_ATKBD
 	default y
 	select SERIO
 	select SERIO_LIBPS2
-	select SERIO_I8042 if X86 && !X86_MRST
+	select SERIO_I8042 if X86
 	select SERIO_GSCPS2 if GSC
 	help
 	  Say Y here if you want to use a standard AT or PS/2 keyboard. Usually
diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig
index eeb58c1..c714ca2 100644
--- a/drivers/input/mouse/Kconfig
+++ b/drivers/input/mouse/Kconfig
@@ -17,7 +17,7 @@ config MOUSE_PS2
 	default y
 	select SERIO
 	select SERIO_LIBPS2
-	select SERIO_I8042 if X86 && !X86_MRST
+	select SERIO_I8042 if X86
 	select SERIO_GSCPS2 if GSC
 	help
 	  Say Y here if you have a PS/2 mouse connected to your system. This
-- 
1.7.0.4


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

* [PATCH v2 4/5] Revert "Input: fixup X86_MRST selects"
  2010-07-05 15:03 [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms feng.tang
                   ` (2 preceding siblings ...)
  2010-07-05 15:03 ` [PATCH v2 3/5] Revert "Input: do not force selecting i8042 on Moorestown" feng.tang
@ 2010-07-05 15:03 ` feng.tang
  2010-07-08  7:16   ` [tip:x86/urgent] " tip-bot for Feng Tang
  2010-07-05 15:03 ` [PATCH v2 5/5] input: i8042 - add runtime check in x86's i8042_platform_init feng.tang
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: feng.tang @ 2010-07-05 15:03 UTC (permalink / raw)
  To: linux-kernel, tglx, mingo, hpa, jacob.jun.pan, dtor, randy.dunlap
  Cc: Feng Tang

From: Feng Tang <feng.tang@intel.com>

This reverts commit 0b28bac5aef7bd1ab213723df031e61db9ff151a.

After adding x86_platform's detection for i8042 controller, we
don't need the force dependency on !X86_MRST any more

Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Feng Tang <feng.tang@intel.com>
---
 drivers/input/keyboard/Kconfig |    2 +-
 drivers/input/serio/Kconfig    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 917eec3..3525f53 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -69,7 +69,7 @@ config KEYBOARD_ATARI
 	  module will be called atakbd.
 
 config KEYBOARD_ATKBD
-	tristate "AT keyboard" if EMBEDDED || !X86 || X86_MRST
+	tristate "AT keyboard" if EMBEDDED || !X86
 	default y
 	select SERIO
 	select SERIO_LIBPS2
diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
index 256b9e9..3bfe8fa 100644
--- a/drivers/input/serio/Kconfig
+++ b/drivers/input/serio/Kconfig
@@ -22,7 +22,7 @@ config SERIO_I8042
 	tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86
 	default y
 	depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && \
-		   (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN && !X86_MRST
+		   (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN
 	help
 	  i8042 is the chip over which the standard AT keyboard and PS/2
 	  mouse are connected to the computer. If you use these devices,
-- 
1.7.0.4


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

* [PATCH v2 5/5] input: i8042 - add runtime check in x86's i8042_platform_init
  2010-07-05 15:03 [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms feng.tang
                   ` (3 preceding siblings ...)
  2010-07-05 15:03 ` [PATCH v2 4/5] Revert "Input: fixup X86_MRST selects" feng.tang
@ 2010-07-05 15:03 ` feng.tang
  2010-07-07 20:02   ` Luck, Tony
  2010-07-05 19:45 ` [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms H. Peter Anvin
  2010-07-08  7:15 ` [tip:x86/urgent] x86, platform: Export x86_platform to modules tip-bot for H. Peter Anvin
  6 siblings, 1 reply; 18+ messages in thread
From: feng.tang @ 2010-07-05 15:03 UTC (permalink / raw)
  To: linux-kernel, tglx, mingo, hpa, jacob.jun.pan, dtor, randy.dunlap
  Cc: Feng Tang

From: Feng Tang <feng.tang@intel.com>

Then it will first check x86_platforms's i8042 detection result,
then go on with normal probe.

Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Feng Tang <feng.tang@intel.com>
---
 drivers/input/serio/i8042-x86ia64io.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 6168469..6228526 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -7,6 +7,8 @@
  * the Free Software Foundation.
  */
 
+#include <asm/x86_init.h>
+
 /*
  * Names.
  */
@@ -840,6 +842,12 @@ static int __init i8042_platform_init(void)
 {
 	int retval;
 
+#ifdef CONFIG_X86
+	/* Just return if pre-detection shows no i8042 controller exist */
+	if (!x86_platform.i8042_detect())
+		return -ENODEV;
+#endif
+
 /*
  * On ix86 platforms touching the i8042 data register region can do really
  * bad things. Because of this the region is always reserved on ix86 boxes.
-- 
1.7.0.4


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

* Re: [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms
  2010-07-05 15:03 [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms feng.tang
                   ` (4 preceding siblings ...)
  2010-07-05 15:03 ` [PATCH v2 5/5] input: i8042 - add runtime check in x86's i8042_platform_init feng.tang
@ 2010-07-05 19:45 ` H. Peter Anvin
  2010-07-05 20:22   ` Dmitry Torokhov
  2010-07-08  7:15 ` [tip:x86/urgent] x86, platform: Export x86_platform to modules tip-bot for H. Peter Anvin
  6 siblings, 1 reply; 18+ messages in thread
From: H. Peter Anvin @ 2010-07-05 19:45 UTC (permalink / raw)
  To: feng.tang; +Cc: linux-kernel, tglx, mingo, jacob.jun.pan, dtor, randy.dunlap

On 07/05/2010 08:03 AM, feng.tang@intel.com wrote:
> From: Feng Tang <feng.tang@intel.com>
> 
> Hi All,
> 
> Some x86 platforms like intel MID platforms don't have i8042 controllers,
> and i8042 driver's probe to some non-exist legacy IO ports may hang
> the MID processor. 
> 
> Current solution for this is add dependency of SERIO_I8042 over
> !X86_MRST, then if we build a x86 kernel image with X86_MRST=y,
> it won't have i8042 driver support over common x86 platforms.
> 
> So we add a i8042 pre-detect hook into x86_platforms ops, so that
> i8042 driver can use it to run-time judge whether to go on with
> probe process.
> 
> Please review these patches.
> 

Looks good to me.  Dmitry, what do you think?

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


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

* Re: [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms
  2010-07-05 19:45 ` [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms H. Peter Anvin
@ 2010-07-05 20:22   ` Dmitry Torokhov
  2010-07-05 20:24     ` H. Peter Anvin
  2010-07-07 23:12     ` H. Peter Anvin
  0 siblings, 2 replies; 18+ messages in thread
From: Dmitry Torokhov @ 2010-07-05 20:22 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: feng.tang, linux-kernel, tglx, mingo, jacob.jun.pan, randy.dunlap

On Mon, Jul 05, 2010 at 12:45:17PM -0700, H. Peter Anvin wrote:
> On 07/05/2010 08:03 AM, feng.tang@intel.com wrote:
> > From: Feng Tang <feng.tang@intel.com>
> > 
> > Hi All,
> > 
> > Some x86 platforms like intel MID platforms don't have i8042 controllers,
> > and i8042 driver's probe to some non-exist legacy IO ports may hang
> > the MID processor. 
> > 
> > Current solution for this is add dependency of SERIO_I8042 over
> > !X86_MRST, then if we build a x86 kernel image with X86_MRST=y,
> > it won't have i8042 driver support over common x86 platforms.
> > 
> > So we add a i8042 pre-detect hook into x86_platforms ops, so that
> > i8042 driver can use it to run-time judge whether to go on with
> > probe process.
> > 
> > Please review these patches.
> > 
> 
> Looks good to me.  Dmitry, what do you think?
> 

Looks hood to me as well. We can either merge it through my tree or x86
tree, I don't have a preference.

-- 
Dmitry

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

* Re: [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms
  2010-07-05 20:22   ` Dmitry Torokhov
@ 2010-07-05 20:24     ` H. Peter Anvin
  2010-07-05 20:29       ` Dmitry Torokhov
  2010-07-07 23:12     ` H. Peter Anvin
  1 sibling, 1 reply; 18+ messages in thread
From: H. Peter Anvin @ 2010-07-05 20:24 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: feng.tang, linux-kernel, tglx, mingo, jacob.jun.pan, randy.dunlap

On 07/05/2010 01:22 PM, Dmitry Torokhov wrote:
> 
> Looks hood to me as well. We can either merge it through my tree or x86
> tree, I don't have a preference.
> 

OK if I merge it then with your Acked-by:?

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


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

* Re: [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms
  2010-07-05 20:24     ` H. Peter Anvin
@ 2010-07-05 20:29       ` Dmitry Torokhov
  0 siblings, 0 replies; 18+ messages in thread
From: Dmitry Torokhov @ 2010-07-05 20:29 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: feng.tang, linux-kernel, tglx, mingo, jacob.jun.pan, randy.dunlap

On Mon, Jul 05, 2010 at 01:24:10PM -0700, H. Peter Anvin wrote:
> On 07/05/2010 01:22 PM, Dmitry Torokhov wrote:
> > 
> > Looks hood to me as well. We can either merge it through my tree or x86
> > tree, I don't have a preference.
> > 
> 
> OK if I merge it then with your Acked-by:?
> 

Certainly.

-- 
Dmitry

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

* Re: [PATCH v2 5/5] input: i8042 - add runtime check in x86's i8042_platform_init
  2010-07-05 15:03 ` [PATCH v2 5/5] input: i8042 - add runtime check in x86's i8042_platform_init feng.tang
@ 2010-07-07 20:02   ` Luck, Tony
  2010-07-08  7:17     ` [tip:x86/urgent] " tip-bot for Feng Tang
  0 siblings, 1 reply; 18+ messages in thread
From: Luck, Tony @ 2010-07-07 20:02 UTC (permalink / raw)
  To: feng.tang, linux-kernel, tglx, mingo, hpa, jacob.jun.pan, dtor,
	randy.dunlap
  Cc: Feng Tang

From: Feng Tang <feng.tang@intel.com>

Then it will first check x86_platforms's i8042 detection result,
then go on with normal probe.

Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
---

Added #ifdef around #include <asm/x86_init.h> -- Tony

diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 6168469..81003c4 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -7,6 +7,10 @@
  * the Free Software Foundation.
  */
 
+#ifdef CONFIG_X86
+#include <asm/x86_init.h>
+#endif
+
 /*
  * Names.
  */
@@ -840,6 +844,12 @@ static int __init i8042_platform_init(void)
 {
 	int retval;
 
+#ifdef CONFIG_X86
+	/* Just return if pre-detection shows no i8042 controller exist */
+	if (!x86_platform.i8042_detect())
+		return -ENODEV;
+#endif
+
 /*
  * On ix86 platforms touching the i8042 data register region can do really
  * bad things. Because of this the region is always reserved on ix86 boxes.

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

* Re: [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms
  2010-07-05 20:22   ` Dmitry Torokhov
  2010-07-05 20:24     ` H. Peter Anvin
@ 2010-07-07 23:12     ` H. Peter Anvin
  1 sibling, 0 replies; 18+ messages in thread
From: H. Peter Anvin @ 2010-07-07 23:12 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: feng.tang, linux-kernel, tglx, mingo, jacob.jun.pan, randy.dunlap

On 07/05/2010 01:22 PM, Dmitry Torokhov wrote:
> 
> Looks hood to me as well. We can either merge it through my tree or x86
> tree, I don't have a preference.
> 

OK, I found that this series breaks allmodconfig, because i8042 can be a
module.  The obvious solution is to export x86_platform to modules, I
presume that is okay with everyone (especially tglx)?  If so I'll push
this tree out tomorrow morning.

	-hpa

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

* [tip:x86/urgent] x86, platform: Export x86_platform to modules
  2010-07-05 15:03 [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms feng.tang
                   ` (5 preceding siblings ...)
  2010-07-05 19:45 ` [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms H. Peter Anvin
@ 2010-07-08  7:15 ` tip-bot for H. Peter Anvin
  6 siblings, 0 replies; 18+ messages in thread
From: tip-bot for H. Peter Anvin @ 2010-07-08  7:15 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, dtor, tglx, feng.tang, hpa

Commit-ID:  72550b3ae545c75897c769d43d62d4be3f3d48fe
Gitweb:     http://git.kernel.org/tip/72550b3ae545c75897c769d43d62d4be3f3d48fe
Author:     H. Peter Anvin <hpa@linux.intel.com>
AuthorDate: Wed, 7 Jul 2010 16:57:46 -0700
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Wed, 7 Jul 2010 17:05:05 -0700

x86, platform: Export x86_platform to modules

Export x86_platform to modules in preparation of using it for i8042
discovery control.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
LKML-Reference: <1278342202-10973-1-git-send-email-feng.tang@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Feng Tang <feng.tang@intel.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
---
 arch/x86/kernel/x86_init.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 61a1e8c..ebfb8e4 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -5,6 +5,7 @@
  */
 #include <linux/init.h>
 #include <linux/ioport.h>
+#include <linux/module.h>
 
 #include <asm/bios_ebda.h>
 #include <asm/paravirt.h>
@@ -94,3 +95,5 @@ struct x86_platform_ops x86_platform = {
 	.is_untracked_pat_range		= is_ISA_range,
 	.nmi_init			= default_nmi_init
 };
+
+EXPORT_SYMBOL_GPL(x86_platform);

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

* [tip:x86/urgent] x86: Add i8042 pre-detection hook to x86_platform_ops
  2010-07-05 15:03 ` [PATCH v2 1/5] x86: add i8042 pre-detection hook to x86_platform_ops feng.tang
@ 2010-07-08  7:16   ` tip-bot for Feng Tang
  0 siblings, 0 replies; 18+ messages in thread
From: tip-bot for Feng Tang @ 2010-07-08  7:16 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, dtor, tglx, hpa, feng.tang

Commit-ID:  c516ac583973196162b1ba7e4d597d6f6892dac0
Gitweb:     http://git.kernel.org/tip/c516ac583973196162b1ba7e4d597d6f6892dac0
Author:     Feng Tang <feng.tang@intel.com>
AuthorDate: Mon, 5 Jul 2010 23:03:18 +0800
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Wed, 7 Jul 2010 17:05:06 -0700

x86: Add i8042 pre-detection hook to x86_platform_ops

Some x86 platforms like Intel MID platforms don't have i8042 controllers,
and i8042 driver's probe to some legacy IO ports may hang the MID
processor. With this hook, i8042 driver can runtime check and skip the
probe when the pretection fail which also saves some probe time

[ hpa note: this is currently a compile-time check, which breaks the
  i386 allyesconfig build.  This patch series thus does fix a regression. ]

Signed-off-by: Feng Tang <feng.tang@intel.com>
LKML-Reference: <1278342202-10973-2-git-send-email-feng.tang@intel.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/include/asm/x86_init.h |    2 ++
 arch/x86/kernel/x86_init.c      |    4 +++-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index 519b543..baa579c 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -142,6 +142,7 @@ struct x86_cpuinit_ops {
  * @set_wallclock:		set time back to HW clock
  * @is_untracked_pat_range	exclude from PAT logic
  * @nmi_init			enable NMI on cpus
+ * @i8042_detect		pre-detect if i8042 controller exists
  */
 struct x86_platform_ops {
 	unsigned long (*calibrate_tsc)(void);
@@ -150,6 +151,7 @@ struct x86_platform_ops {
 	void (*iommu_shutdown)(void);
 	bool (*is_untracked_pat_range)(u64 start, u64 end);
 	void (*nmi_init)(void);
+	int (*i8042_detect)(void);
 };
 
 extern struct x86_init_ops x86_init;
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index ebfb8e4..cd6da6b 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -86,6 +86,7 @@ struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = {
 };
 
 static void default_nmi_init(void) { };
+static int default_i8042_detect(void) { return 1; };
 
 struct x86_platform_ops x86_platform = {
 	.calibrate_tsc			= native_calibrate_tsc,
@@ -93,7 +94,8 @@ struct x86_platform_ops x86_platform = {
 	.set_wallclock			= mach_set_rtc_mmss,
 	.iommu_shutdown			= iommu_shutdown_noop,
 	.is_untracked_pat_range		= is_ISA_range,
-	.nmi_init			= default_nmi_init
+	.nmi_init			= default_nmi_init,
+	.i8042_detect			= default_i8042_detect
 };
 
 EXPORT_SYMBOL_GPL(x86_platform);

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

* [tip:x86/urgent] x86, mrst: Add i8042_detect API for Moorestwon platform
  2010-07-05 15:03 ` [PATCH v2 2/5] x86, mrst: add i8042_detect API for Moorestwon platform feng.tang
@ 2010-07-08  7:16   ` tip-bot for Feng Tang
  0 siblings, 0 replies; 18+ messages in thread
From: tip-bot for Feng Tang @ 2010-07-08  7:16 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, dtor, tglx, hpa, feng.tang

Commit-ID:  6d2cce62017efe957e34cfcbba23861b7671980b
Gitweb:     http://git.kernel.org/tip/6d2cce62017efe957e34cfcbba23861b7671980b
Author:     Feng Tang <feng.tang@intel.com>
AuthorDate: Mon, 5 Jul 2010 23:03:19 +0800
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Wed, 7 Jul 2010 17:05:06 -0700

x86, mrst: Add i8042_detect API for Moorestwon platform

It will just return 0 as there is no i8042 controller

Signed-off-by: Feng Tang <feng.tang@intel.com>
LKML-Reference: <1278342202-10973-3-git-send-email-feng.tang@intel.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/kernel/mrst.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/mrst.c b/arch/x86/kernel/mrst.c
index e796448..5915e0b 100644
--- a/arch/x86/kernel/mrst.c
+++ b/arch/x86/kernel/mrst.c
@@ -216,6 +216,12 @@ static void __init mrst_setup_boot_clock(void)
 		setup_boot_APIC_clock();
 };
 
+/* MID systems don't have i8042 controller */
+static int mrst_i8042_detect(void)
+{
+	return 0;
+}
+
 /*
  * Moorestown specific x86_init function overrides and early setup
  * calls.
@@ -233,6 +239,7 @@ void __init x86_mrst_early_setup(void)
 	x86_cpuinit.setup_percpu_clockev = mrst_setup_secondary_clock;
 
 	x86_platform.calibrate_tsc = mrst_calibrate_tsc;
+	x86_platform.i8042_detect = mrst_i8042_detect;
 	x86_init.pci.init = pci_mrst_init;
 	x86_init.pci.fixup_irqs = x86_init_noop;
 

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

* [tip:x86/urgent] Revert "Input: do not force selecting i8042 on Moorestown"
  2010-07-05 15:03 ` [PATCH v2 3/5] Revert "Input: do not force selecting i8042 on Moorestown" feng.tang
@ 2010-07-08  7:16   ` tip-bot for Feng Tang
  0 siblings, 0 replies; 18+ messages in thread
From: tip-bot for Feng Tang @ 2010-07-08  7:16 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, dtor, tglx, feng.tang, jacob.jun.pan, hpa

Commit-ID:  44631ac64d06d2f7ce006c2a6f2c8e003a9c6ace
Gitweb:     http://git.kernel.org/tip/44631ac64d06d2f7ce006c2a6f2c8e003a9c6ace
Author:     Feng Tang <feng.tang@intel.com>
AuthorDate: Mon, 5 Jul 2010 23:03:20 +0800
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Wed, 7 Jul 2010 17:05:06 -0700

Revert "Input: do not force selecting i8042 on Moorestown"

This reverts commit 685afae02557a178185a4be36f58332976e79f63.

After adding x86_platform's detection for i8042 controller, we
don't need the force dependency on !X86_MRST any more

Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Feng Tang <feng.tang@intel.com>
LKML-Reference: <1278342202-10973-4-git-send-email-feng.tang@intel.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 drivers/input/keyboard/Kconfig |    2 +-
 drivers/input/mouse/Kconfig    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 0f9a478..917eec3 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -73,7 +73,7 @@ config KEYBOARD_ATKBD
 	default y
 	select SERIO
 	select SERIO_LIBPS2
-	select SERIO_I8042 if X86 && !X86_MRST
+	select SERIO_I8042 if X86
 	select SERIO_GSCPS2 if GSC
 	help
 	  Say Y here if you want to use a standard AT or PS/2 keyboard. Usually
diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig
index eeb58c1..c714ca2 100644
--- a/drivers/input/mouse/Kconfig
+++ b/drivers/input/mouse/Kconfig
@@ -17,7 +17,7 @@ config MOUSE_PS2
 	default y
 	select SERIO
 	select SERIO_LIBPS2
-	select SERIO_I8042 if X86 && !X86_MRST
+	select SERIO_I8042 if X86
 	select SERIO_GSCPS2 if GSC
 	help
 	  Say Y here if you have a PS/2 mouse connected to your system. This

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

* [tip:x86/urgent] Revert "Input: fixup X86_MRST selects"
  2010-07-05 15:03 ` [PATCH v2 4/5] Revert "Input: fixup X86_MRST selects" feng.tang
@ 2010-07-08  7:16   ` tip-bot for Feng Tang
  0 siblings, 0 replies; 18+ messages in thread
From: tip-bot for Feng Tang @ 2010-07-08  7:16 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, randy.dunlap, dtor, tglx, feng.tang, hpa

Commit-ID:  c9d46f63f8e89fd70f97b83fdc4e5d2e37d92aeb
Gitweb:     http://git.kernel.org/tip/c9d46f63f8e89fd70f97b83fdc4e5d2e37d92aeb
Author:     Feng Tang <feng.tang@intel.com>
AuthorDate: Mon, 5 Jul 2010 23:03:21 +0800
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Wed, 7 Jul 2010 17:05:07 -0700

Revert "Input: fixup X86_MRST selects"

This reverts commit 0b28bac5aef7bd1ab213723df031e61db9ff151a.

After adding x86_platform's detection for i8042 controller, we
don't need the force dependency on !X86_MRST any more

Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Feng Tang <feng.tang@intel.com>
LKML-Reference: <1278342202-10973-5-git-send-email-feng.tang@intel.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 drivers/input/keyboard/Kconfig |    2 +-
 drivers/input/serio/Kconfig    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 917eec3..3525f53 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -69,7 +69,7 @@ config KEYBOARD_ATARI
 	  module will be called atakbd.
 
 config KEYBOARD_ATKBD
-	tristate "AT keyboard" if EMBEDDED || !X86 || X86_MRST
+	tristate "AT keyboard" if EMBEDDED || !X86
 	default y
 	select SERIO
 	select SERIO_LIBPS2
diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
index 256b9e9..3bfe8fa 100644
--- a/drivers/input/serio/Kconfig
+++ b/drivers/input/serio/Kconfig
@@ -22,7 +22,7 @@ config SERIO_I8042
 	tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86
 	default y
 	depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && \
-		   (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN && !X86_MRST
+		   (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN
 	help
 	  i8042 is the chip over which the standard AT keyboard and PS/2
 	  mouse are connected to the computer. If you use these devices,

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

* [tip:x86/urgent] input: i8042 - add runtime check in x86's i8042_platform_init
  2010-07-07 20:02   ` Luck, Tony
@ 2010-07-08  7:17     ` tip-bot for Feng Tang
  0 siblings, 0 replies; 18+ messages in thread
From: tip-bot for Feng Tang @ 2010-07-08  7:17 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, tony.luck, dtor, tglx, feng.tang, hpa

Commit-ID:  5cdfa1c3bbabb809ef3134f741a63e13373a8cad
Gitweb:     http://git.kernel.org/tip/5cdfa1c3bbabb809ef3134f741a63e13373a8cad
Author:     Feng Tang <feng.tang@intel.com>
AuthorDate: Wed, 7 Jul 2010 13:02:16 -0700
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Wed, 7 Jul 2010 17:05:07 -0700

input: i8042 - add runtime check in x86's i8042_platform_init

Then it will first check x86_platforms's i8042 detection result,
then go on with normal probe.

Signed-off-by: Feng Tang <feng.tang@intel.com>
LKML-Reference: <4c34dd482753bb8f1@agluck-desktop.sc.intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 drivers/input/serio/i8042-x86ia64io.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 6168469..81003c4 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -7,6 +7,10 @@
  * the Free Software Foundation.
  */
 
+#ifdef CONFIG_X86
+#include <asm/x86_init.h>
+#endif
+
 /*
  * Names.
  */
@@ -840,6 +844,12 @@ static int __init i8042_platform_init(void)
 {
 	int retval;
 
+#ifdef CONFIG_X86
+	/* Just return if pre-detection shows no i8042 controller exist */
+	if (!x86_platform.i8042_detect())
+		return -ENODEV;
+#endif
+
 /*
  * On ix86 platforms touching the i8042 data register region can do really
  * bad things. Because of this the region is always reserved on ix86 boxes.

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

end of thread, other threads:[~2010-07-08  7:17 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-05 15:03 [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms feng.tang
2010-07-05 15:03 ` [PATCH v2 1/5] x86: add i8042 pre-detection hook to x86_platform_ops feng.tang
2010-07-08  7:16   ` [tip:x86/urgent] x86: Add " tip-bot for Feng Tang
2010-07-05 15:03 ` [PATCH v2 2/5] x86, mrst: add i8042_detect API for Moorestwon platform feng.tang
2010-07-08  7:16   ` [tip:x86/urgent] x86, mrst: Add " tip-bot for Feng Tang
2010-07-05 15:03 ` [PATCH v2 3/5] Revert "Input: do not force selecting i8042 on Moorestown" feng.tang
2010-07-08  7:16   ` [tip:x86/urgent] " tip-bot for Feng Tang
2010-07-05 15:03 ` [PATCH v2 4/5] Revert "Input: fixup X86_MRST selects" feng.tang
2010-07-08  7:16   ` [tip:x86/urgent] " tip-bot for Feng Tang
2010-07-05 15:03 ` [PATCH v2 5/5] input: i8042 - add runtime check in x86's i8042_platform_init feng.tang
2010-07-07 20:02   ` Luck, Tony
2010-07-08  7:17     ` [tip:x86/urgent] " tip-bot for Feng Tang
2010-07-05 19:45 ` [PATCH v2 0/5] patches to settle i8042 with Intel MID platforms H. Peter Anvin
2010-07-05 20:22   ` Dmitry Torokhov
2010-07-05 20:24     ` H. Peter Anvin
2010-07-05 20:29       ` Dmitry Torokhov
2010-07-07 23:12     ` H. Peter Anvin
2010-07-08  7:15 ` [tip:x86/urgent] x86, platform: Export x86_platform to modules tip-bot for H. Peter Anvin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.