linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: fixup X86_MRST selects
       [not found] <20100609133443.38f1f957.sfr@canb.auug.org.au>
@ 2010-06-09 22:29 ` Randy Dunlap
  2010-06-09 22:40   ` Dmitry Torokhov
  0 siblings, 1 reply; 13+ messages in thread
From: Randy Dunlap @ 2010-06-09 22:29 UTC (permalink / raw)
  To: Stephen Rothwell, Dmitry Torokhov, Jacob Pan
  Cc: linux-next, LKML, linux-input, akpm

From: Randy Dunlap <randy.dunlap@oracle.com>

Some of the recent X86_MRST additions make some "select"s
conditional on X86_MRST but missed some related kconfig symbols,
causing:

drivers/built-in.o: In function `ps2_end_command':
(.text+0x257ab2): undefined reference to `i8042_check_port_owner'
drivers/built-in.o: In function `ps2_end_command':
(.text+0x257ae1): undefined reference to `i8042_unlock_chip'
drivers/built-in.o: In function `ps2_begin_command':
(.text+0x257b40): undefined reference to `i8042_check_port_owner'
drivers/built-in.o: In function `ps2_begin_command':
(.text+0x257b6f): undefined reference to `i8042_lock_chip'

when SERIO_I8042=m, SERIO_LIBPS2=y, KEYBOARD_ATKBD=y.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc:	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc:	Jacob Pan <jacob.jun.pan@intel.com>
---
[found in linux-next but also applies to mainline]

 drivers/input/keyboard/Kconfig |    3 ++-
 drivers/input/mouse/Kconfig    |    2 +-
 drivers/input/serio/Kconfig    |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

--- linux-next-20100609.orig/drivers/input/keyboard/Kconfig
+++ linux-next-20100609/drivers/input/keyboard/Kconfig
@@ -70,9 +70,10 @@ config KEYBOARD_ATARI
 
 config KEYBOARD_ATKBD
 	tristate "AT keyboard" if EMBEDDED || !X86
+	depends on !X86 || (X86 && !X86_MRST)
 	default y
 	select SERIO
-	select SERIO_LIBPS2
+	select SERIO_LIBPS2 if !X86_MRST
 	select SERIO_I8042 if X86 && !X86_MRST
 	select SERIO_GSCPS2 if GSC
 	help
--- linux-next-20100609.orig/drivers/input/mouse/Kconfig
+++ linux-next-20100609/drivers/input/mouse/Kconfig
@@ -16,7 +16,7 @@ config MOUSE_PS2
 	tristate "PS/2 mouse"
 	default y
 	select SERIO
-	select SERIO_LIBPS2
+	select SERIO_LIBPS2 if !X86_MRST
 	select SERIO_I8042 if X86 && !X86_MRST
 	select SERIO_GSCPS2 if GSC
 	help
--- linux-next-20100609.orig/drivers/input/serio/Kconfig
+++ linux-next-20100609/drivers/input/serio/Kconfig
@@ -168,7 +168,7 @@ config SERIO_MACEPS2
 	  module will be called maceps2.
 
 config SERIO_LIBPS2
-	tristate "PS/2 driver library" if EMBEDDED
+	tristate "PS/2 driver library" if EMBEDDED && !X86_MRST
 	depends on SERIO_I8042 || SERIO_I8042=n
 	help
 	  Say Y here if you are using a driver for device connected

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

* Re: [PATCH] input: fixup X86_MRST selects
  2010-06-09 22:29 ` [PATCH] input: fixup X86_MRST selects Randy Dunlap
@ 2010-06-09 22:40   ` Dmitry Torokhov
  2010-06-09 22:42     ` Randy Dunlap
  0 siblings, 1 reply; 13+ messages in thread
From: Dmitry Torokhov @ 2010-06-09 22:40 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Stephen Rothwell, Jacob Pan, linux-next, LKML, linux-input, akpm

On Wednesday, June 09, 2010 03:29:21 pm Randy Dunlap wrote:
> +++ linux-next-20100609/drivers/input/keyboard/Kconfig
> @@ -70,9 +70,10 @@ config KEYBOARD_ATARI
>  
>  config KEYBOARD_ATKBD
>         tristate "AT keyboard" if EMBEDDED || !X86
> +       depends on !X86 || (X86 && !X86_MRST)

Should it be simply 'depends on !X86_MRST' and then we could kill
'!X86_MRST' conditionals in selects?

>         default y
>         select SERIO
> -       select SERIO_LIBPS2
> +       select SERIO_LIBPS2 if !X86_MRST
>         select SERIO_I8042 if X86 && !X86_MRST
>         select SERIO_GSCPS2 if GSC
>         help

Thanks.

-- 
Dmitry

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

* Re: [PATCH] input: fixup X86_MRST selects
  2010-06-09 22:40   ` Dmitry Torokhov
@ 2010-06-09 22:42     ` Randy Dunlap
  2010-06-10 19:04       ` Dmitry Torokhov
  0 siblings, 1 reply; 13+ messages in thread
From: Randy Dunlap @ 2010-06-09 22:42 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Stephen Rothwell, Jacob Pan, linux-next, LKML, linux-input, akpm

On 06/09/10 15:40, Dmitry Torokhov wrote:
> On Wednesday, June 09, 2010 03:29:21 pm Randy Dunlap wrote:
>> +++ linux-next-20100609/drivers/input/keyboard/Kconfig
>> @@ -70,9 +70,10 @@ config KEYBOARD_ATARI
>>  
>>  config KEYBOARD_ATKBD
>>         tristate "AT keyboard" if EMBEDDED || !X86
>> +       depends on !X86 || (X86 && !X86_MRST)
> 
> Should it be simply 'depends on !X86_MRST' and then we could kill
> '!X86_MRST' conditionals in selects?

Duh, that sounds good, yes.

> 
>>         default y
>>         select SERIO
>> -       select SERIO_LIBPS2
>> +       select SERIO_LIBPS2 if !X86_MRST
>>         select SERIO_I8042 if X86 && !X86_MRST
>>         select SERIO_GSCPS2 if GSC
>>         help
> 
> Thanks.
> 


-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* Re: [PATCH] input: fixup X86_MRST selects
  2010-06-09 22:42     ` Randy Dunlap
@ 2010-06-10 19:04       ` Dmitry Torokhov
  2010-06-15 15:17         ` Randy Dunlap
  2010-06-28 19:03         ` problem: " Randy Dunlap
  0 siblings, 2 replies; 13+ messages in thread
From: Dmitry Torokhov @ 2010-06-10 19:04 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Stephen Rothwell, Jacob Pan, linux-next, LKML, linux-input, akpm

On Wednesday, June 09, 2010 03:42:08 pm Randy Dunlap wrote:
> On 06/09/10 15:40, Dmitry Torokhov wrote:
> > On Wednesday, June 09, 2010 03:29:21 pm Randy Dunlap wrote:
> >> +++ linux-next-20100609/drivers/input/keyboard/Kconfig
> >> @@ -70,9 +70,10 @@ config KEYBOARD_ATARI
> >>  
> >>  config KEYBOARD_ATKBD
> >>         tristate "AT keyboard" if EMBEDDED || !X86
> >> +       depends on !X86 || (X86 && !X86_MRST)
> > 
> > Should it be simply 'depends on !X86_MRST' and then we could kill
> > '!X86_MRST' conditionals in selects?
> 
> Duh, that sounds good, yes.

Actually, I do not think this is a correct approach. While Moorestown does
not have i8042 theoretically it is possible to add AT-style keyboard by
other means (however unlikely it is) so we should not be disabling it.

We should, however, disallow i8042 from being selected. Could you please
tell me if the patch below works for you?

Thanks!

-- 
Dmitry

Input: fixup X86_MRST selects

From: Randy Dunlap <randy.dunlap@oracle.com>

Some of the recent X86_MRST additions make some "select"s
conditional on X86_MRST but missed some related kconfig symbols,
causing:

drivers/built-in.o: In function `ps2_end_command':
(.text+0x257ab2): undefined reference to `i8042_check_port_owner'
drivers/built-in.o: In function `ps2_end_command':
(.text+0x257ae1): undefined reference to `i8042_unlock_chip'
drivers/built-in.o: In function `ps2_begin_command':
(.text+0x257b40): undefined reference to `i8042_check_port_owner'
drivers/built-in.o: In function `ps2_begin_command':
(.text+0x257b6f): undefined reference to `i8042_lock_chip'

when SERIO_I8042=m, SERIO_LIBPS2=y, KEYBOARD_ATKBD=y.

We need to make i8042 dependant upon !X86_MRST and allow deselecting
atkbd on Moorestown even when !CONFIG_EMBEDDED.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Jacob Pan <jacob.jun.pan@intel.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 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 9522b89..d3a99de 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
+	tristate "AT keyboard" if EMBEDDED || !X86 || X86_MRST
 	default y
 	select SERIO
 	select SERIO_LIBPS2
diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
index 3bfe8fa..256b9e9 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
+		   (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN && !X86_MRST
 	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] 13+ messages in thread

* Re: [PATCH] input: fixup X86_MRST selects
  2010-06-10 19:04       ` Dmitry Torokhov
@ 2010-06-15 15:17         ` Randy Dunlap
  2010-06-28 19:03         ` problem: " Randy Dunlap
  1 sibling, 0 replies; 13+ messages in thread
From: Randy Dunlap @ 2010-06-15 15:17 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Stephen Rothwell, Jacob Pan, linux-next, LKML, linux-input, akpm

On 06/10/10 12:04, Dmitry Torokhov wrote:
> On Wednesday, June 09, 2010 03:42:08 pm Randy Dunlap wrote:
>> On 06/09/10 15:40, Dmitry Torokhov wrote:
>>> On Wednesday, June 09, 2010 03:29:21 pm Randy Dunlap wrote:
>>>> +++ linux-next-20100609/drivers/input/keyboard/Kconfig
>>>> @@ -70,9 +70,10 @@ config KEYBOARD_ATARI
>>>>  
>>>>  config KEYBOARD_ATKBD
>>>>         tristate "AT keyboard" if EMBEDDED || !X86
>>>> +       depends on !X86 || (X86 && !X86_MRST)
>>>
>>> Should it be simply 'depends on !X86_MRST' and then we could kill
>>> '!X86_MRST' conditionals in selects?
>>
>> Duh, that sounds good, yes.
> 
> Actually, I do not think this is a correct approach. While Moorestown does
> not have i8042 theoretically it is possible to add AT-style keyboard by
> other means (however unlikely it is) so we should not be disabling it.
> 
> We should, however, disallow i8042 from being selected. Could you please
> tell me if the patch below works for you?

Yes, that's good.  Thanks.

-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* problem: Re: [PATCH] input: fixup X86_MRST selects
  2010-06-10 19:04       ` Dmitry Torokhov
  2010-06-15 15:17         ` Randy Dunlap
@ 2010-06-28 19:03         ` Randy Dunlap
  2010-06-28 20:18           ` Dmitry Torokhov
  1 sibling, 1 reply; 13+ messages in thread
From: Randy Dunlap @ 2010-06-28 19:03 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Stephen Rothwell, Jacob Pan, linux-next, LKML, linux-input, akpm,
	chuck.lever

On 06/10/10 12:04, Dmitry Torokhov wrote:
> On Wednesday, June 09, 2010 03:42:08 pm Randy Dunlap wrote:
>> On 06/09/10 15:40, Dmitry Torokhov wrote:
>>> On Wednesday, June 09, 2010 03:29:21 pm Randy Dunlap wrote:
>>>> +++ linux-next-20100609/drivers/input/keyboard/Kconfig
>>>> @@ -70,9 +70,10 @@ config KEYBOARD_ATARI
>>>>  
>>>>  config KEYBOARD_ATKBD
>>>>         tristate "AT keyboard" if EMBEDDED || !X86
>>>> +       depends on !X86 || (X86 && !X86_MRST)
>>>
>>> Should it be simply 'depends on !X86_MRST' and then we could kill
>>> '!X86_MRST' conditionals in selects?
>>
>> Duh, that sounds good, yes.
> 
> Actually, I do not think this is a correct approach. While Moorestown does
> not have i8042 theoretically it is possible to add AT-style keyboard by
> other means (however unlikely it is) so we should not be disabling it.
> 
> We should, however, disallow i8042 from being selected. Could you please
> tell me if the patch below works for you?

Dmitry,

This patch (in current mainline git) causes a problem when X86_MRST is enabled.
CONFIG_SERIO_I8042 is no longer enabled when X86_MRST is enabled,
and X86_MRST could be enabled when someone is trying to build a generic kernel.

-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* Re: problem: Re: [PATCH] input: fixup X86_MRST selects
  2010-06-28 19:03         ` problem: " Randy Dunlap
@ 2010-06-28 20:18           ` Dmitry Torokhov
  2010-06-28 20:23             ` Randy Dunlap
  0 siblings, 1 reply; 13+ messages in thread
From: Dmitry Torokhov @ 2010-06-28 20:18 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Stephen Rothwell, Jacob Pan, linux-next, LKML, linux-input, akpm,
	chuck.lever

On Monday, June 28, 2010 12:03:44 pm Randy Dunlap wrote:
> On 06/10/10 12:04, Dmitry Torokhov wrote:
> > On Wednesday, June 09, 2010 03:42:08 pm Randy Dunlap wrote:
> >> On 06/09/10 15:40, Dmitry Torokhov wrote:
> >>> On Wednesday, June 09, 2010 03:29:21 pm Randy Dunlap wrote:
> >>>> +++ linux-next-20100609/drivers/input/keyboard/Kconfig
> >>>> @@ -70,9 +70,10 @@ config KEYBOARD_ATARI
> >>>> 
> >>>>  config KEYBOARD_ATKBD
> >>>>  
> >>>>         tristate "AT keyboard" if EMBEDDED || !X86
> >>>> 
> >>>> +       depends on !X86 || (X86 && !X86_MRST)
> >>> 
> >>> Should it be simply 'depends on !X86_MRST' and then we could kill
> >>> '!X86_MRST' conditionals in selects?
> >> 
> >> Duh, that sounds good, yes.
> > 
> > Actually, I do not think this is a correct approach. While Moorestown
> > does not have i8042 theoretically it is possible to add AT-style
> > keyboard by other means (however unlikely it is) so we should not be
> > disabling it.
> > 
> > We should, however, disallow i8042 from being selected. Could you please
> > tell me if the patch below works for you?
> 
> Dmitry,
> 
> This patch (in current mainline git) causes a problem when X86_MRST is
> enabled. CONFIG_SERIO_I8042 is no longer enabled when X86_MRST is enabled,
> and X86_MRST could be enabled when someone is trying to build a generic
> kernel.

Randy,

Looking at arch/x86/kernel/mrst.c I am not sure if generic kernel will
work well witbh X86_MRST set. However if we supposed to support Moorestown
on generic images then, instead of playing with Kconfig, we need to adjust
i8042_platform_init() to abort on Moorestown.

Thanks.

-- 
Dmitry

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

* Re: problem: Re: [PATCH] input: fixup X86_MRST selects
  2010-06-28 20:18           ` Dmitry Torokhov
@ 2010-06-28 20:23             ` Randy Dunlap
  2010-06-28 21:12               ` Pan, Jacob jun
  0 siblings, 1 reply; 13+ messages in thread
From: Randy Dunlap @ 2010-06-28 20:23 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Stephen Rothwell, Jacob Pan, linux-next, LKML, linux-input, akpm,
	chuck.lever

On 06/28/10 13:18, Dmitry Torokhov wrote:
> On Monday, June 28, 2010 12:03:44 pm Randy Dunlap wrote:
>> On 06/10/10 12:04, Dmitry Torokhov wrote:
>>> On Wednesday, June 09, 2010 03:42:08 pm Randy Dunlap wrote:
>>>> On 06/09/10 15:40, Dmitry Torokhov wrote:
>>>>> On Wednesday, June 09, 2010 03:29:21 pm Randy Dunlap wrote:
>>>>>> +++ linux-next-20100609/drivers/input/keyboard/Kconfig
>>>>>> @@ -70,9 +70,10 @@ config KEYBOARD_ATARI
>>>>>>
>>>>>>  config KEYBOARD_ATKBD
>>>>>>  
>>>>>>         tristate "AT keyboard" if EMBEDDED || !X86
>>>>>>
>>>>>> +       depends on !X86 || (X86 && !X86_MRST)
>>>>>
>>>>> Should it be simply 'depends on !X86_MRST' and then we could kill
>>>>> '!X86_MRST' conditionals in selects?
>>>>
>>>> Duh, that sounds good, yes.
>>>
>>> Actually, I do not think this is a correct approach. While Moorestown
>>> does not have i8042 theoretically it is possible to add AT-style
>>> keyboard by other means (however unlikely it is) so we should not be
>>> disabling it.
>>>
>>> We should, however, disallow i8042 from being selected. Could you please
>>> tell me if the patch below works for you?
>>
>> Dmitry,
>>
>> This patch (in current mainline git) causes a problem when X86_MRST is
>> enabled. CONFIG_SERIO_I8042 is no longer enabled when X86_MRST is enabled,
>> and X86_MRST could be enabled when someone is trying to build a generic
>> kernel.
> 
> Randy,
> 
> Looking at arch/x86/kernel/mrst.c I am not sure if generic kernel will
> work well witbh X86_MRST set. However if we supposed to support Moorestown
> on generic images then, instead of playing with Kconfig, we need to adjust
> i8042_platform_init() to abort on Moorestown.

OK.  Until something else is done, you might want to revert this patch
and just live with the build errors (that caused me to send the original
patch).

-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* RE: problem: Re: [PATCH] input: fixup X86_MRST selects
  2010-06-28 20:23             ` Randy Dunlap
@ 2010-06-28 21:12               ` Pan, Jacob jun
  2010-06-28 22:44                 ` Dmitry Torokhov
  0 siblings, 1 reply; 13+ messages in thread
From: Pan, Jacob jun @ 2010-06-28 21:12 UTC (permalink / raw)
  To: Randy Dunlap, Dmitry Torokhov
  Cc: Stephen Rothwell, linux-next@vger.kernel.org, LKML,
	linux-input@vger.kernel.org, akpm, chuck.lever@oracle.com,
	H. Peter Anvin



>-----Original Message-----
>From: Randy Dunlap [mailto:randy.dunlap@oracle.com]
>Sent: Monday, June 28, 2010 1:24 PM
>To: Dmitry Torokhov
>Cc: Stephen Rothwell; Pan, Jacob jun; linux-next@vger.kernel.org; LKML;
>linux-input@vger.kernel.org; akpm; chuck.lever@oracle.com
>Subject: Re: problem: Re: [PATCH] input: fixup X86_MRST selects
>
>On 06/28/10 13:18, Dmitry Torokhov wrote:
>> On Monday, June 28, 2010 12:03:44 pm Randy Dunlap wrote:
>>> On 06/10/10 12:04, Dmitry Torokhov wrote:
>>>> On Wednesday, June 09, 2010 03:42:08 pm Randy Dunlap wrote:
>>>>> On 06/09/10 15:40, Dmitry Torokhov wrote:
>>>>>> On Wednesday, June 09, 2010 03:29:21 pm Randy Dunlap wrote:
>>>>>>> +++ linux-next-20100609/drivers/input/keyboard/Kconfig
>>>>>>> @@ -70,9 +70,10 @@ config KEYBOARD_ATARI
>>>>>>>
>>>>>>>  config KEYBOARD_ATKBD
>>>>>>>
>>>>>>>         tristate "AT keyboard" if EMBEDDED || !X86
>>>>>>>
>>>>>>> +       depends on !X86 || (X86 && !X86_MRST)
>>>>>>
>>>>>> Should it be simply 'depends on !X86_MRST' and then we could kill
>>>>>> '!X86_MRST' conditionals in selects?
>>>>>
>>>>> Duh, that sounds good, yes.
>>>>
>>>> Actually, I do not think this is a correct approach. While
>Moorestown
>>>> does not have i8042 theoretically it is possible to add AT-style
>>>> keyboard by other means (however unlikely it is) so we should not be
>>>> disabling it.
>>>>
>>>> We should, however, disallow i8042 from being selected. Could you
>please
>>>> tell me if the patch below works for you?
>>>
>>> Dmitry,
>>>
>>> This patch (in current mainline git) causes a problem when X86_MRST
>is
>>> enabled. CONFIG_SERIO_I8042 is no longer enabled when X86_MRST is
>enabled,
>>> and X86_MRST could be enabled when someone is trying to build a
>generic
>>> kernel.
>>
>> Randy,
>>
>> Looking at arch/x86/kernel/mrst.c I am not sure if generic kernel will
>> work well witbh X86_MRST set. However if we supposed to support
>Moorestown
>> on generic images then, instead of playing with Kconfig, we need to
>adjust
>> i8042_platform_init() to abort on Moorestown.
>
>OK.  Until something else is done, you might want to revert this patch
>and just live with the build errors (that caused me to send the original
>patch).
>
We do intend to maintain binary compatibility between generic kernel and Moorestown.
I guess the challenge is not having enumeration of i8042 pass to the driver. Do you
prefer abort i8042_platform_init() based on #define CONFIG_X86_MRST? It is no safe
to probe HW on Moorestown, unfortunately.

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

* Re: problem: Re: [PATCH] input: fixup X86_MRST selects
  2010-06-28 21:12               ` Pan, Jacob jun
@ 2010-06-28 22:44                 ` Dmitry Torokhov
  2010-06-28 23:22                   ` Pan, Jacob jun
  0 siblings, 1 reply; 13+ messages in thread
From: Dmitry Torokhov @ 2010-06-28 22:44 UTC (permalink / raw)
  To: Pan, Jacob jun
  Cc: Randy Dunlap, Stephen Rothwell, linux-next@vger.kernel.org, LKML,
	linux-input@vger.kernel.org, akpm, chuck.lever@oracle.com,
	H. Peter Anvin

On Mon, Jun 28, 2010 at 02:12:03PM -0700, Pan, Jacob jun wrote:
> >
> We do intend to maintain binary compatibility between generic kernel and Moorestown.
> I guess the challenge is not having enumeration of i8042 pass to the driver. Do you
> prefer abort i8042_platform_init() based on #define CONFIG_X86_MRST? It is no safe
> to probe HW on Moorestown, unfortunately.

Any check based on CONFIG_X86_MRST means that kernel is not generic.
We'd need a runtime check (but not necessarily one that bangs ports). Is
there something in processor flags, or DMI, or similar that woudl allow
i8042 to see that it runs on Moorestown?

-- 
Dmitry

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

* RE: problem: Re: [PATCH] input: fixup X86_MRST selects
  2010-06-28 22:44                 ` Dmitry Torokhov
@ 2010-06-28 23:22                   ` Pan, Jacob jun
  2010-07-02  4:46                     ` Dmitry Torokhov
  0 siblings, 1 reply; 13+ messages in thread
From: Pan, Jacob jun @ 2010-06-28 23:22 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Randy Dunlap, Stephen Rothwell, linux-next@vger.kernel.org, LKML,
	linux-input@vger.kernel.org, akpm, chuck.lever@oracle.com,
	H. Peter Anvin, Arjan van de Ven, Thomas Gleixner

There is no DMI support yet in MRST FW.
We have a new x86 HW subarch ID in boot_param, then we use it to select x86_init abstractions. Both boot_param and x86_init are x86 arch specific so I guess we can use them in 8042 driver under CONFIG_X86. Not sure if it is possible to move x86 i8042_platform_init under x86_init (the x86 part).

>-----Original Message-----
>From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
>Sent: Monday, June 28, 2010 3:45 PM
>To: Pan, Jacob jun
>Cc: Randy Dunlap; Stephen Rothwell; linux-next@vger.kernel.org; LKML;
>linux-input@vger.kernel.org; akpm; chuck.lever@oracle.com; H. Peter
>Anvin
>Subject: Re: problem: Re: [PATCH] input: fixup X86_MRST selects
>
>On Mon, Jun 28, 2010 at 02:12:03PM -0700, Pan, Jacob jun wrote:
>> >
>> We do intend to maintain binary compatibility between generic kernel
>and Moorestown.
>> I guess the challenge is not having enumeration of i8042 pass to the
>driver. Do you
>> prefer abort i8042_platform_init() based on #define CONFIG_X86_MRST?
>It is no safe
>> to probe HW on Moorestown, unfortunately.
>
>Any check based on CONFIG_X86_MRST means that kernel is not generic.
>We'd need a runtime check (but not necessarily one that bangs ports). Is
>there something in processor flags, or DMI, or similar that woudl allow
>i8042 to see that it runs on Moorestown?
>
>--
>Dmitry

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

* Re: problem: Re: [PATCH] input: fixup X86_MRST selects
  2010-06-28 23:22                   ` Pan, Jacob jun
@ 2010-07-02  4:46                     ` Dmitry Torokhov
  2010-07-02  6:27                       ` H. Peter Anvin
  0 siblings, 1 reply; 13+ messages in thread
From: Dmitry Torokhov @ 2010-07-02  4:46 UTC (permalink / raw)
  To: Pan, Jacob jun
  Cc: Randy Dunlap, Stephen Rothwell, linux-next@vger.kernel.org, LKML,
	linux-input@vger.kernel.org, akpm, chuck.lever@oracle.com,
	H. Peter Anvin, Arjan van de Ven, Thomas Gleixner, kphillisjr

On Mon, Jun 28, 2010 at 04:22:03PM -0700, Pan, Jacob jun wrote:
> There is no DMI support yet in MRST FW.  We have a new x86 HW subarch
> ID in boot_param, then we use it to select x86_init abstractions. Both
> boot_param and x86_init are x86 arch specific so I guess we can use
> them in 8042 driver under CONFIG_X86. Not sure if it is possible to
> move x86 i8042_platform_init under x86_init (the x86 part).
> 

Moving i8042_platform_init() into platform code is quite invasive,
how about we to the following?

Thanks.

-- 
Dmitry


Input: i8042 - detect legacy-free platforms (Moorestown)

Moorestown does not have legacy hardware (i8042, i8259) and does not
like legacy ports being poked by drivers. Instead of playing with
Kconfig selections let's check if we set up dummy (null) legacy PIC
during startup and abort i8042 initialization as well. This should
fix the following bug:

	https://bugzilla.kernel.org/show_bug.cgi?id=16326

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/input/keyboard/Kconfig        |    4 ++--
 drivers/input/mouse/Kconfig           |    2 +-
 drivers/input/serio/Kconfig           |    2 +-
 drivers/input/serio/i8042-x86ia64io.h |   18 ++++++++++++++++++
 4 files changed, 22 insertions(+), 4 deletions(-)


diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index d3a99de..b25917b 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -69,11 +69,11 @@ 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
-	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
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,
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 723106c..a6a4a2f 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -844,10 +844,28 @@ static inline int i8042_pnp_init(void) { return 0; }
 static inline void i8042_pnp_exit(void) { }
 #endif
 
+#if CONFIG_X86
+#include <asm/i8259.h>
+static bool i8042_legacy_free_platform(void)
+{
+	/*
+	 * Moorestown platform does not have i8042 nor does it
+	 * have other legacy devices, such as i8259. Use ths fact
+	 * to detect that we are running on a legacy-free platform.
+	 */
+	return legacy_pic == &null_legacy_pic;
+}
+#else
+static bool i8042_legacy_free_platform(void) { }
+#endif
+
 static int __init i8042_platform_init(void)
 {
 	int retval;
 
+	if (i8042_legacy_free_platform())
+		return -ENXIO;
+
 /*
  * 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] 13+ messages in thread

* Re: problem: Re: [PATCH] input: fixup X86_MRST selects
  2010-07-02  4:46                     ` Dmitry Torokhov
@ 2010-07-02  6:27                       ` H. Peter Anvin
  0 siblings, 0 replies; 13+ messages in thread
From: H. Peter Anvin @ 2010-07-02  6:27 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Pan, Jacob jun, Randy Dunlap, Stephen Rothwell,
	linux-next@vger.kernel.org, LKML, linux-input@vger.kernel.org,
	akpm, chuck.lever@oracle.com, Arjan van de Ven, Thomas Gleixner,
	kphillisjr

On 07/01/2010 09:46 PM, Dmitry Torokhov wrote:
> On Mon, Jun 28, 2010 at 04:22:03PM -0700, Pan, Jacob jun wrote:
>> There is no DMI support yet in MRST FW.  We have a new x86 HW subarch
>> ID in boot_param, then we use it to select x86_init abstractions. Both
>> boot_param and x86_init are x86 arch specific so I guess we can use
>> them in 8042 driver under CONFIG_X86. Not sure if it is possible to
>> move x86 i8042_platform_init under x86_init (the x86 part).
>>
> 
> Moving i8042_platform_init() into platform code is quite invasive,
> how about we to the following?
> 
> Thanks.
> 

Uck, no!

	----
Moorestown does not have legacy hardware (i8042, i8259) and does not
like legacy ports being poked by drivers. Instead of playing with
Kconfig selections let's check if we set up dummy (null) legacy PIC
during startup and abort i8042 initialization as well. This should
fix the following bug:
	----

The presence of 8042 and 8259 are orthogonal.  In fact, there are quite
a few systems on the market which have 8259 but not 8042, and at least
having the ability to handle that correctly instead of just assuming
that those I/O ports are safe is pretty key.

So please don't commingle these completely unrelated platform attributes.

	-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] 13+ messages in thread

end of thread, other threads:[~2010-07-02  6:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20100609133443.38f1f957.sfr@canb.auug.org.au>
2010-06-09 22:29 ` [PATCH] input: fixup X86_MRST selects Randy Dunlap
2010-06-09 22:40   ` Dmitry Torokhov
2010-06-09 22:42     ` Randy Dunlap
2010-06-10 19:04       ` Dmitry Torokhov
2010-06-15 15:17         ` Randy Dunlap
2010-06-28 19:03         ` problem: " Randy Dunlap
2010-06-28 20:18           ` Dmitry Torokhov
2010-06-28 20:23             ` Randy Dunlap
2010-06-28 21:12               ` Pan, Jacob jun
2010-06-28 22:44                 ` Dmitry Torokhov
2010-06-28 23:22                   ` Pan, Jacob jun
2010-07-02  4:46                     ` Dmitry Torokhov
2010-07-02  6:27                       ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).