Skip to contentSkip to conversation

Kconfig: cleanup SERIO_I8042 dependencies

PATCH Superseded Mark Salter 8 participants 23 messages Dec 14, 2013 – Dec 16, 2013

Subsystems (8)
Arm (32-bit) x86 PowerPC MIPS +4 more subsystems

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Kconfig: cleanup SERIO_I8042 dependencies

This patch series removes the messy dependencies from SERIO_I8042 by having it depend on one variable (ARCH_MAY_HAVE_PC_SERIO) and having architectures which need it select that variable in arch/*/Kconfig.

New architectures are unlikely to need SERIO_I8042, so this avoids having an ever growing list of architectures to exclude. If an architecture without i8042 support isn't excluded through the dependency list for SERIO_I8042 or through explicit disabling in a config, it will likely panic on boot with something similar to this (from arm64):

[   27.426181] [<ffffffc000403b1c>] i8042_flush+0x88/0x10c
[   27.426251] [<ffffffc00084cc2c>] i8042_init+0x58/0xe8
[   27.426320] [<ffffffc000080bec>] do_one_initcall+0xc4/0x14c
[   27.426404] [<ffffffc000820970>] kernel_init_freeable+0x1a4/0x244
[   27.426480] [<ffffffc0005a894c>] kernel_init+0x18/0x148
[   27.426561] Code: d2800c82 f2bf7c02 f2dff7e2 f2ffffe2 (39400042) 
[   27.426789] ---[ end trace ac076843cf0f383e ]---
[   27.426875] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

A tree with these patches is at:

git://github.com/mosalter/linux.git (serio-i8042 branch)

Mark Salter (10):
alpha: select ARCH_MIGHT_HAVE_PC_SERIO
arm: select ARCH_MIGHT_HAVE_PC_SERIO
ia64: select ARCH_MIGHT_HAVE_PC_SERIO
mips: select ARCH_MIGHT_HAVE_PC_SERIO
powerpc: select ARCH_MIGHT_HAVE_PC_SERIO
sh: select ARCH_MIGHT_HAVE_PC_SERIO
sparc: select ARCH_MIGHT_HAVE_PC_SERIO
unicore32: select ARCH_MIGHT_HAVE_PC_SERIO
x86: select ARCH_MIGHT_HAVE_PC_SERIO
Kconfig: cleanup SERIO_I8042 dependencies

 arch/alpha/Kconfig          |  1 +
 arch/arm/Kconfig            |  1 +
 arch/ia64/Kconfig           |  1 +
 arch/mips/Kconfig           |  1 +
 arch/powerpc/Kconfig        |  1 +
 arch/sh/Kconfig             |  1 +
 arch/sparc/Kconfig          |  1 +
 arch/unicore32/Kconfig      |  1 +
 arch/x86/Kconfig            |  1 +
 drivers/input/serio/Kconfig | 11 ++++++++---
 10 files changed, 17 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/10 alpha: select ARCH_MIGHT_HAVE_PC_SERIO

Architectures which might use an i8042 for serial IO to keyboard, mouse, etc should select ARCH_MIGHT_HAVE_PC_SERIO.

---
 arch/alpha/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/alpha/Kconfig +1 -0
index d39dc9b..7ce5ce5 100644
@@ -2,6 +2,7 @@ config ALPHA
 	bool
 	default y
 	select ARCH_MIGHT_HAVE_PC_PARPORT
+	select ARCH_MIGHT_HAVE_PC_SERIO
 	select HAVE_AOUT
 	select HAVE_IDE
 	select HAVE_OPROFILE
Signature · 1 line
1.8.3.1
#3 lore raw

PATCH 2/10 arm: select ARCH_MIGHT_HAVE_PC_SERIO

In reply to Mark Salter

Architectures which might use an i8042 for serial IO to keyboard, mouse, etc should select ARCH_MIGHT_HAVE_PC_SERIO.

CC Russell King <[email protected]>
CC linux-arm-kernel at lists.infradead.org
---
 arch/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/Kconfig +1 -0
index c1f1a7e..6990dc5 100644
@@ -6,6 +6,7 @@ config ARM
 	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
 	select ARCH_HAVE_CUSTOM_GPIO_H
 	select ARCH_MIGHT_HAVE_PC_PARPORT
+	select ARCH_MIGHT_HAVE_PC_SERIO if FOOTBRIDGE_HOST
 	select ARCH_USE_CMPXCHG_LOCKREF
 	select ARCH_WANT_IPC_PARSE_VERSION
 	select BUILDTIME_EXTABLE_SORT if MMU
Signature · 1 line
1.8.3.1
#4 lore raw

Re: [PATCH 02/10] arm: select ARCH_MIGHT_HAVE_PC_SERIO

Quoted 15 lines · Mark Salter

Architectures which might use an i8042 for serial IO to keyboard, mouse, etc should select ARCH_MIGHT_HAVE_PC_SERIO.

CC Russell King <[email protected]>
CC linux-arm-kernel at lists.infradead.org
---
 arch/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/Kconfig +0 -0
index c1f1a7e..6990dc5 100644

arch/arm/Kconfig config ARM · line 12

Quoted 7 lines
arch/arm/Kconfig +1 -0
@@ -6,6 +6,7 @@ config ARM
 	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
 	select ARCH_HAVE_CUSTOM_GPIO_H
 	select ARCH_MIGHT_HAVE_PC_PARPORT
+	select ARCH_MIGHT_HAVE_PC_SERIO if FOOTBRIDGE_HOST
 	select ARCH_USE_CMPXCHG_LOCKREF
 	select ARCH_WANT_IPC_PARSE_VERSION
 	select BUILDTIME_EXTABLE_SORT if MMU

It would be better to put this in arch/arm/mach-footbridge/Kconfig - ARM is impled as being true there.

Thanks.

#5 lore raw

PATCH 3/10 ia64: select ARCH_MIGHT_HAVE_PC_SERIO

In reply to Mark Salter

Architectures which might use an i8042 for serial IO to keyboard, mouse, etc should select ARCH_MIGHT_HAVE_PC_SERIO.

---
 arch/ia64/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/ia64/Kconfig +1 -0
index 4e4119b..f7337aa 100644
@@ -7,6 +7,7 @@ menu "Processor type and features"
 config IA64
 	bool
 	select ARCH_MIGHT_HAVE_PC_PARPORT
+	select ARCH_MIGHT_HAVE_PC_SERIO
 	select PCI if (!IA64_HP_SIM)
 	select ACPI if (!IA64_HP_SIM)
 	select PM if (!IA64_HP_SIM)
Signature · 1 line
1.8.3.1
#6 lore raw

PATCH 4/10 mips: select ARCH_MIGHT_HAVE_PC_SERIO

In reply to Mark Salter

Architectures which might use an i8042 for serial IO to keyboard, mouse, etc should select ARCH_MIGHT_HAVE_PC_SERIO.

---
 arch/mips/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/mips/Kconfig +1 -0
index 650de39..99db162 100644
@@ -2,6 +2,7 @@ config MIPS
 	bool
 	default y
 	select ARCH_MIGHT_HAVE_PC_PARPORT
+	select ARCH_MIGHT_HAVE_PC_SERIO
 	select HAVE_CONTEXT_TRACKING
 	select HAVE_GENERIC_DMA_COHERENT
 	select HAVE_IDE
Signature · 1 line
1.8.3.1
#8 lore raw

PATCH 5/10 powerpc: select ARCH_MIGHT_HAVE_PC_SERIO

In reply to Mark Salter

Architectures which might use an i8042 for serial IO to keyboard, mouse, etc should select ARCH_MIGHT_HAVE_PC_SERIO.

CC Benjamin Herrenschmidt <[email protected]>
CC Paul Mackerras <[email protected]>
---
 arch/powerpc/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/Kconfig +1 -0
index b44b52c..fb75485 100644
@@ -86,6 +86,7 @@ config PPC
 	bool
 	default y
 	select ARCH_MIGHT_HAVE_PC_PARPORT
+	select ARCH_MIGHT_HAVE_PC_SERIO
 	select BINFMT_ELF
 	select OF
 	select OF_EARLY_FLATTREE
Signature · 1 line
1.8.3.1
#9 lore raw

PATCH 6/10 sh: select ARCH_MIGHT_HAVE_PC_SERIO

In reply to Mark Salter

Architectures which might use an i8042 for serial IO to keyboard, mouse, etc should select ARCH_MIGHT_HAVE_PC_SERIO.

---
 arch/sh/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/sh/Kconfig +1 -0
index 9b0979f..3490fc2 100644
@@ -1,6 +1,7 @@
 config SUPERH
 	def_bool y
 	select ARCH_MIGHT_HAVE_PC_PARPORT
+	select ARCH_MIGHT_HAVE_PC_SERIO if SH_CAYMAN
 	select EXPERT
 	select CLKDEV_LOOKUP
 	select HAVE_IDE if HAS_IOPORT
Signature · 1 line
1.8.3.1
#10 lore raw

PATCH 7/10 sparc: select ARCH_MIGHT_HAVE_PC_SERIO

In reply to Mark Salter

Architectures which might use an i8042 for serial IO to keyboard, mouse, etc should select ARCH_MIGHT_HAVE_PC_SERIO.

---
 arch/sparc/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/sparc/Kconfig +1 -0
index d4f7a6a..034a680 100644
@@ -13,6 +13,7 @@ config SPARC
 	bool
 	default y
 	select ARCH_MIGHT_HAVE_PC_PARPORT if SPARC64 && PCI
+	select ARCH_MIGHT_HAVE_PC_SERIO
 	select OF
 	select OF_PROMTREE
 	select HAVE_IDE
Signature · 1 line
1.8.3.1
#12 lore raw

PATCH 8/10 unicore32: select ARCH_MIGHT_HAVE_PC_SERIO

In reply to Mark Salter

Architectures which might use an i8042 for serial IO to keyboard, mouse, etc should select ARCH_MIGHT_HAVE_PC_SERIO.

---
 arch/unicore32/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/unicore32/Kconfig +1 -0
index a7ba27b..25c0dba 100644
@@ -1,6 +1,7 @@
 config UNICORE32
 	def_bool y
 	select ARCH_MIGHT_HAVE_PC_PARPORT
+	select ARCH_MIGHT_HAVE_PC_SERIO
 	select HAVE_MEMBLOCK
 	select HAVE_GENERIC_DMA_COHERENT
 	select HAVE_DMA_ATTRS
Signature · 1 line
1.8.3.1
Acked-by Guan Xuetao on v1 8/10
#13 lore raw

回复: [PATCH 08/10] unicore32: select ARCH_MIGHT_HAVE_PC_SERIO

It's ok to unicore32.

Quoted 24 lines · ----- Mark Salter

Architectures which might use an i8042 for serial IO to keyboard, mouse, etc should select ARCH_MIGHT_HAVE_PC_SERIO.

---
 arch/unicore32/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/unicore32/Kconfig +1 -0
index a7ba27b..25c0dba 100644
@@ -1,6 +1,7 @@
 config UNICORE32
 	def_bool y
 	select ARCH_MIGHT_HAVE_PC_PARPORT
+	select ARCH_MIGHT_HAVE_PC_SERIO
 	select HAVE_MEMBLOCK
 	select HAVE_GENERIC_DMA_COHERENT
 	select HAVE_DMA_ATTRS
Signature · 1 line
1.8.3.1
#14 lore raw

PATCH 9/10 x86: select ARCH_MIGHT_HAVE_PC_SERIO

In reply to Mark Salter

Architectures which might use an i8042 for serial IO to keyboard, mouse, etc should select ARCH_MIGHT_HAVE_PC_SERIO.

CC Ingo Molnar <[email protected]>
CC Thomas Gleixner <[email protected]>
CC "H. Peter Anvin" <[email protected]>
---
 arch/x86/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/x86/Kconfig +1 -0
index e903c71..b7f0903 100644
@@ -23,6 +23,7 @@ config X86
 	def_bool y
 	select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
 	select ARCH_MIGHT_HAVE_PC_PARPORT
+	select ARCH_MIGHT_HAVE_PC_SERIO
 	select HAVE_AOUT if X86_32
 	select HAVE_UNSTABLE_SCHED_CLOCK
 	select ARCH_SUPPORTS_NUMA_BALANCING
Signature · 1 line
1.8.3.1
reviewer Acked-by on v1 9/10
#15 lore raw

Re: [PATCH 09/10] x86: select ARCH_MIGHT_HAVE_PC_SERIO

Quoted 18 lines · Mark Salter

Architectures which might use an i8042 for serial IO to keyboard, mouse, etc should select ARCH_MIGHT_HAVE_PC_SERIO.

CC Ingo Molnar <[email protected]>
CC Thomas Gleixner <[email protected]>
CC "H. Peter Anvin" <[email protected]>
---
 arch/x86/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/x86/Kconfig +0 -0
index e903c71..b7f0903 100644

arch/x86/Kconfig config X86 · line 29

Quoted 7 lines
arch/x86/Kconfig +1 -0
@@ -23,6 +23,7 @@ config X86
 	def_bool y
 	select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
 	select ARCH_MIGHT_HAVE_PC_PARPORT
+	select ARCH_MIGHT_HAVE_PC_SERIO
 	select HAVE_AOUT if X86_32
 	select HAVE_UNSTABLE_SCHED_CLOCK
 	select ARCH_SUPPORTS_NUMA_BALANCING
#16 lore raw

PATCH 10/10 Kconfig: cleanup SERIO_I8042 dependencies

In reply to Mark Salter

Remove messy dependencies from SERIO_I8042 by having it depend on one Kconfig symbol (ARCH_MIGHT_HAVE_PC_SERIO) and having architectures which need it select ARCH_MIGHT_HAVE_PC_SERIO in arch/*/Kconfig. New architectures are unlikely to need SERIO_I8042, so this avoids having an ever growing list of architectures to exclude.

CC Dmitry Torokhov <[email protected]>
CC Richard Henderson <[email protected]>
CC Russell King <[email protected]>
CC Tony Luck <[email protected]>
CC Fenghua Yu <[email protected]>
CC Ralf Baechle <[email protected]>
CC Benjamin Herrenschmidt <[email protected]>
CC Paul Mackerras <[email protected]>
CC Paul Mundt <[email protected]>
CC "David S. Miller" <[email protected]>
CC Guan Xuetao <[email protected]>
CC Ingo Molnar <[email protected]>
CC Thomas Gleixner <[email protected]>
CC "H. Peter Anvin" <[email protected]>
---
 drivers/input/serio/Kconfig | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/input/serio/Kconfig +8 -3
index 8541f94..1f5cec2 100644
@@ -16,14 +16,19 @@ config SERIO
 	  To compile this driver as a module, choose M here: the
 	  module will be called serio.
 
+config ARCH_MIGHT_HAVE_PC_SERIO
+	bool
+	help
+	  Select this config option from the architecture Kconfig if
+	  the architecture might use a PC serio device (i8042) to
+          communicate with keyboard, mouse, etc.
+
 if SERIO
 
 config SERIO_I8042
 	tristate "i8042 PC Keyboard controller"
 	default y
-	depends on !PARISC && (!ARM || FOOTBRIDGE_HOST) && \
-		   (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN && !S390 && \
-		   !ARC
+	depends on ARCH_MIGHT_HAVE_PC_SERIO
 	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,
Signature · 1 line
1.8.3.1
reviewer Acked-by on v1 10/10
#17 lore raw
Quoted 21 lines · Mark Salter

Remove messy dependencies from SERIO_I8042 by having it depend on one Kconfig symbol (ARCH_MIGHT_HAVE_PC_SERIO) and having architectures which need it select ARCH_MIGHT_HAVE_PC_SERIO in arch/*/Kconfig. New architectures are unlikely to need SERIO_I8042, so this avoids having an ever growing list of architectures to exclude.

CC Dmitry Torokhov <[email protected]>
CC Richard Henderson <[email protected]>
CC Russell King <[email protected]>
CC Tony Luck <[email protected]>
CC Fenghua Yu <[email protected]>
CC Ralf Baechle <[email protected]>
CC Benjamin Herrenschmidt <[email protected]>
CC Paul Mackerras <[email protected]>
CC Paul Mundt <[email protected]>
Quoted 8 lines
CC "David S. Miller" <[email protected]>
CC Guan Xuetao <[email protected]>
CC Ingo Molnar <[email protected]>
CC Thomas Gleixner <[email protected]>
CC "H. Peter Anvin" <[email protected]>
maintainer
#18 lore raw
Quoted 31 lines · H. Peter Anvin
Quoted 21 lines · Mark Salter

Remove messy dependencies from SERIO_I8042 by having it depend on one Kconfig symbol (ARCH_MIGHT_HAVE_PC_SERIO) and having architectures which need it select ARCH_MIGHT_HAVE_PC_SERIO in arch/*/Kconfig. New architectures are unlikely to need SERIO_I8042, so this avoids having an ever growing list of architectures to exclude.

CC Dmitry Torokhov <[email protected]>
CC Richard Henderson <[email protected]>
CC Russell King <[email protected]>
CC Tony Luck <[email protected]>
CC Fenghua Yu <[email protected]>
CC Ralf Baechle <[email protected]>
CC Benjamin Herrenschmidt <[email protected]>
CC Paul Mackerras <[email protected]>
CC Paul Mundt <[email protected]>
Quoted 8 lines
CC "David S. Miller" <[email protected]>
CC Guan Xuetao <[email protected]>
CC Ingo Molnar <[email protected]>
CC Thomas Gleixner <[email protected]>
CC "H. Peter Anvin" <[email protected]>
Quoted 1 line

How are we going to merge this? In bulk through input tree or peacemeal through all arches first?

Signature · 1 line
Dmitry
#19 lore raw
Quoted 11 lines · Dmitry Torokhov
Quoted 6 lines · H. Peter Anvin
Quoted 5 lines · Mark Salter

Remove messy dependencies from SERIO_I8042 by having it depend on one Kconfig symbol (ARCH_MIGHT_HAVE_PC_SERIO) and having architectures which need it select ARCH_MIGHT_HAVE_PC_SERIO in arch/*/Kconfig. New architectures are unlikely to need SERIO_I8042, so this avoids having an ever growing list of architectures to exclude.

How are we going to merge this? In bulk through input tree or peacemeal through all arches first?

They should all go together to eliminate the chance of bisect breakage. Either the input tree or maybe akpm tree.

maintainer
#20 lore raw

From: Mark Salter <[email protected]>
Date: Sun, 15 Dec 2013 10:50:26 -0500

Quoted 6 lines · Dmitry Torokhov
Quoted 2 lines

How are we going to merge this? In bulk through input tree or peacemeal through all arches first?

They should all go together to eliminate the chance of bisect breakage. Either the input tree or maybe akpm tree.

This sounds good to me.

maintainer
#21 lore raw
Quoted 11 lines · David Miller

From: Mark Salter <[email protected]>
Date: Sun, 15 Dec 2013 10:50:26 -0500

Quoted 6 lines · Dmitry Torokhov
Quoted 2 lines

How are we going to merge this? In bulk through input tree or peacemeal through all arches first?

They should all go together to eliminate the chance of bisect breakage. Either the input tree or maybe akpm tree.

This sounds good to me.

OK, then I'll pick it up once I collect more acks from the arch maintainers.

Signature · 1 line
Dmitry
Acked-by on v1 10/10
#22 lore raw
In reply to Mark Salter

drivers/input/serio/Kconfig config SERIO · line 31

Quoted 4 lines · Mark Salter
drivers/input/serio/Kconfig +1 -3
-	depends on !PARISC && (!ARM || FOOTBRIDGE_HOST) && \
-		   (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN && !S390 && \
-		   !ARC
+	depends on ARCH_MIGHT_HAVE_PC_SERIO

Most dependencies on an architecture's kconfig symbol outside arch/ should probably be treated as a bug.

Ralf