Skip to contentSkip to conversation

kernel bug with CONFIG_KEYBOARD_ATKBD=y

DISCUSSION Dennis Gilmore 2 participants 7 messages Apr 7, 2009 – Apr 8, 2009 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

I enabled CONFIG_KEYBOARD_ATKBD on the latest fedora rawhide kernel in an attempt to get the keyboard and touchpad working on my ultrabook2e. Right now i have working console and X but i need to plug a USB keyboard and mouse in. I was told that the internel keyboard and touchpad will be standard PC ones. I was also told that there is a 3rd port that is used for power management. when booting i get the following.

Initalizing network drop monitor service
kernel BUG at /builddir/build/BUILD/kernel-2.6.29/linux-2.6.29.sparc64/arch/sparc/include/asm/tlb_64.h:48!

              \|/ ____ \|/
              "@'/ .. \`@"
              /_| \__/ |_\
                 \__U_/

init(1): Kernel bad sw trap 5 [#1]
TSTATE: 0000004411001600 TPC: 00000000004be804 TNPC: 00000000004be808 Y:
00000000 Not tainted
TPC: <unmap_region+0x44/0x134>
g0: fffffffffffffffe g1: 00000000009ba400 g2: 0000000000903eb8 g3: 000000000092d908
g4: fffff8005e050000 g5: 000000000000006f g6: fffff8005e060000 g7:
8000000000000000
o0: 000000000088f7d0 o1: 0000000000000030 o2: 0000000000000030 o3: ffffffffffffffff
o4: 0000000000000000 o5: 0000000000000000 sp: fffff8005e063481 ret_pc:
00000000004be7fc
RPC: <unmap_region+0x3c/0x134>
l0: fffff8005c1f42a0 l1: 0000000000000000 l2: 0000000000000000 l3:
0000000000000000
l4: 0000000000000000 l5: 0000000000000000 l6: 0000000000000000 l7:
00000000f7fe37e8
i0: fffff8005c1b8000 i1: fffff8005c180b28 i2: fffff8005c1f5260 i3: 00000000f7fe0000
i4: 00000000f7fe2000 i5: 0000000000000080 i6: fffff8005e063541 i7:
00000000004bfa20
I7: <do_munmap+0x278/0x2ec>
Caller[00000000004bfa20]: do_munmap+0x278/0x2ec Caller[00000000004bfac0]: SyS_munmap+0x2c/0x48 Caller[0000000000406114]: linux_sparc_syscall32+0x34/0x40 Caller[00000000f7fb7d98]: 0xf7fb7d98
Instruction DUMP: 92102030 7ffdac5c 901223d0 <91d02005> c0206140 84103fff f0706130 c4206138 ce5e2098
usb 1-1: New USB device found, idVendorb3, idProduct10b
usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
usb 1-1: configuration #1 chosen from 1 choice
input: HID 04b3:310b as /devices/root/f0062918/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/input/input0 generic-usb 0003:04B3:310B.0001: input,hidraw0: USB HID v1.00 Mouse [HID 04b3:310b] on usb-0000:00:14.0-1/input0
usb 1-2: new low speed USB device using ohci_hcd and address 3
usb 1-2: New USB device found, idVendor30, idProduct05
usb 1-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
usb 1-2: configuration #1 chosen from 1 choice
input: HID 0430:0005 as /devices/root/f0062918/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/input/input1 generic-usb 0003:0430:0005.0002: input,hidraw1: USB HID v1.00 Keyboard [HID 0430:0005] on usb-0000:00:14.0-2/input0

#1 lore raw
Quoted 24 lines · Dennis Gilmore

Initalizing network drop monitor service
kernel BUG at /builddir/build/BUILD/kernel-2.6.29/linux-2.6.29.sparc64/arch/sparc/include /asm/tlb_64.h:48! \|/ ____ \|/

              "@'/ .. \`@"
              /_| \__/ |_\
                 \__U_/

init(1): Kernel bad sw trap 5 [#1]
TSTATE: 0000004411001600 TPC: 00000000004be804 TNPC: 00000000004be808 Y:
00000000 Not tainted
TPC: <unmap_region+0x44/0x134>
g0: fffffffffffffffe g1: 00000000009ba400 g2: 0000000000903eb8 g3:
000000000092d908 g4: fffff8005e050000 g5: 000000000000006f g6:
fffff8005e060000 g7: 8000000000000000
o0: 000000000088f7d0 o1: 0000000000000030 o2: 0000000000000030 o3:
ffffffffffffffff o4: 0000000000000000 o5: 0000000000000000 sp:
fffff8005e063481 ret_pc: 00000000004be7fc
RPC: <unmap_region+0x3c/0x134>
l0: fffff8005c1f42a0 l1: 0000000000000000 l2: 0000000000000000 l3:
0000000000000000
l4: 0000000000000000 l5: 0000000000000000 l6: 0000000000000000 l7:
00000000f7fe37e8
i0: fffff8005c1b8000 i1: fffff8005c180b28 i2: fffff8005c1f5260 i3:
00000000f7fe0000 i4: 00000000f7fe2000 i5: 0000000000000080 i6:

Quoted 8 lines

fffff8005e063541 i7: 00000000004bfa20
I7: <do_munmap+0x278/0x2ec>
Caller[00000000004bfa20]: do_munmap+0x278/0x2ec Caller[00000000004bfac0]: SyS_munmap+0x2c/0x48 Caller[0000000000406114]: linux_sparc_syscall32+0x34/0x40 Caller[00000000f7fb7d98]: 0xf7fb7d98
Instruction DUMP: 92102030 7ffdac5c 901223d0 <91d02005> c0206140 84103fff f0706130 c4206138 ce5e2098

I just tested the kernel on one of my netra X1's and go the same result.

Dennis

maintainer
#2 lore raw
In reply to Dennis Gilmore

From: Dennis Gilmore <[email protected]>
Date: Tue, 7 Apr 2009 10:01:17 -0500

Quoted 3 lines

Initalizing network drop monitor service
kernel BUG at /builddir/build/BUILD/kernel-2.6.29/linux-2.6.29.sparc64/arch/sparc/include/asm/tlb_64.h:48!

What kernel is this tree based upon? 2.6.29.1?

#3 lore raw
In reply to Dennis Gilmore
Quoted 9 lines · David Miller

From: Dennis Gilmore <[email protected]>
Date: Tue, 7 Apr 2009 10:01:17 -0500

Quoted 4 lines

Initalizing network drop monitor service
kernel BUG at /builddir/build/BUILD/kernel-2.6.29/linux-2.6.29.sparc64/arch/sparc/inclu de/asm/tlb_64.h:48!

What kernel is this tree based upon? 2.6.29.1?

yeah 2.6.29.1

kernel-2.6.29.1-52.fc11 from fedora cvs with

CONFIG_KEYBOARD_ATKBD=y
# CONFIG_KGDB is not set

they were the only changes i made to the config

Dennis

maintainer
#4 lore raw
In reply to Dennis Gilmore

From: Dennis Gilmore <[email protected]>
Date: Tue, 7 Apr 2009 17:10:08 -0500

Quoted 11 lines · David Miller
Quoted 9 lines

From: Dennis Gilmore <[email protected]>
Date: Tue, 7 Apr 2009 10:01:17 -0500

Quoted 4 lines

Initalizing network drop monitor service
kernel BUG at /builddir/build/BUILD/kernel-2.6.29/linux-2.6.29.sparc64/arch/sparc/inclu de/asm/tlb_64.h:48!

What kernel is this tree based upon? 2.6.29.1?

yeah 2.6.29.1

A sparc64 fix I put into 2.6.29.1 is likely the cause. It's possible I put in a version without a particular issue cured.

I'm going to work on figuring out what the problem is, but for now you can just revert the patch below. Your problem had absolutely nothing to do with turning KEYBOARD_ATKBD on, any kernel configuration would hit this when running the X server.

commit b6816b706138c3870f03115071872cad824f90b4

Author: David S. Miller <[email protected]>
Date:   Thu Mar 26 01:28:53 2009 -0700

sparc64: Flush TLB before releasing pages.

[ Upstream commit a552a42cfa91ab653128dff89a70c8dde7fed042 ]

tlb_flush_mmu() needs to flush pending TLB entries before processing the mmu_gather ->pages list.

Noticed by Benjamin Herrenschmidt.

arch/sparc/include/asm/tlb_64.h +2 -2
index ec81cde..0aaa086 100644
@@ -58,6 +58,8 @@ static inline struct mmu_gather *tlb_gather_mmu(struct mm_struct *mm, unsigned i
 static inline void tlb_flush_mmu(struct mmu_gather *mp)
 {
 	if (mp->need_flush) {
+		if (!mp->fullmm)
+			flush_tlb_pending();
 		free_pages_and_swap_cache(mp->pages, mp->pages_nr);
 		mp->pages_nr = 0;
 		mp->need_flush = 0;
@@ -78,8 +80,6 @@ static inline void tlb_finish_mmu(struct mmu_gather *mp, unsigned long start, un
 
 	if (mp->fullmm)
 		mp->fullmm = 0;
-	else
-		flush_tlb_pending();
 
 	/* keep the page table cache within bounds */
 	check_pgt_cache();
maintainer
#5 lore raw
In reply to Dennis Gilmore

From: David Miller <[email protected]>
Date: Tue, 07 Apr 2009 15:16:38 -0700 (PDT)

Quoted 12 lines

From: Dennis Gilmore <[email protected]>
Date: Tue, 7 Apr 2009 17:10:08 -0500

Quoted 9 lines · David Miller
Quoted 8 lines

From: Dennis Gilmore <[email protected]>
Date: Tue, 7 Apr 2009 10:01:17 -0500

Quoted 4 lines

Initalizing network drop monitor service
kernel BUG at /builddir/build/BUILD/kernel-2.6.29/linux-2.6.29.sparc64/arch/sparc/inclu de/asm/tlb_64.h:48!

Quoted 5 lines
Quoted 2 lines
Quoted 1 line

What kernel is this tree based upon? 2.6.29.1?

yeah 2.6.29.1

A sparc64 fix I put into 2.6.29.1 is likely the cause. It's possible I put in a version without a particular issue cured.

Indeed, here is the fix, I'll push it to -stable. Thanks for your report:

sparc64: Fix bug in ("sparc64: Flush TLB before releasing pages.")

[ No upstream commit, this regression was added only to 2.6.29.1 ]

Unfortunately I merged an earlier version of commit b6816b706138c3870f03115071872cad824f90b4 ("sparc64: Flush TLB before releasing pages.") than what I actually tested and merged upstream.

Simply diffing asm/tlb_64.h in Linus's tree vs. what ended up in 2.6.29.1 confirms this.

Sync things up to fix BUG() triggers some users are seeing.

---
 arch/sparc/include/asm/tlb_64.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/sparc/include/asm/tlb_64.h +2 -2
index 0aaa086..ee38e73 100644
@@ -57,9 +57,9 @@ static inline struct mmu_gather *tlb_gather_mmu(struct mm_struct *mm, unsigned i
 
 static inline void tlb_flush_mmu(struct mmu_gather *mp)
 {
+	if (!mp->fullmm)
+		flush_tlb_pending();
 	if (mp->need_flush) {
-		if (!mp->fullmm)
-			flush_tlb_pending();
 		free_pages_and_swap_cache(mp->pages, mp->pages_nr);
 		mp->pages_nr = 0;
 		mp->need_flush = 0;
Signature · 1 line
1.6.2.2
#6 lore raw
In reply to Dennis Gilmore
Quoted 53 lines · David Miller

From: David Miller <[email protected]>
Date: Tue, 07 Apr 2009 15:16:38 -0700 (PDT)

Quoted 12 lines

From: Dennis Gilmore <[email protected]>
Date: Tue, 7 Apr 2009 17:10:08 -0500

Quoted 9 lines · David Miller
Quoted 8 lines

From: Dennis Gilmore <[email protected]>
Date: Tue, 7 Apr 2009 10:01:17 -0500

Quoted 4 lines

Initalizing network drop monitor service
kernel BUG at /builddir/build/BUILD/kernel-2.6.29/linux-2.6.29.sparc64/arch/sparc/i nclu de/asm/tlb_64.h:48!

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

What kernel is this tree based upon? 2.6.29.1?

yeah 2.6.29.1

A sparc64 fix I put into 2.6.29.1 is likely the cause. It's possible I put in a version without a particular issue cured.

Indeed, here is the fix, I'll push it to -stable. Thanks for your report:

sparc64: Fix bug in ("sparc64: Flush TLB before releasing pages.")

[ No upstream commit, this regression was added only to 2.6.29.1 ]

Unfortunately I merged an earlier version of commit b6816b706138c3870f03115071872cad824f90b4 ("sparc64: Flush TLB before releasing pages.") than what I actually tested and merged upstream.

Simply diffing asm/tlb_64.h in Linus's tree vs. what ended up in 2.6.29.1 confirms this.

Sync things up to fix BUG() triggers some users are seeing.

---
 arch/sparc/include/asm/tlb_64.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/arch/sparc/include/asm/tlb_64.h index 0aaa086..ee38e73 100644

arch/sparc/include/asm/tlb_64.h +0 -0
@@ -57,9 +57,9 @@ static inline struct mmu_gather *tlb_gather_mmu(struct

mm_struct *mm, unsigned i

static inline void tlb_flush_mmu(struct mmu_gather *mp) {

arch/sparc/include/asm/tlb_64.h

Quoted 8 lines
arch/sparc/include/asm/tlb_64.h +2 -2
+	if (!mp->fullmm)
+		flush_tlb_pending();
 	if (mp->need_flush) {
-		if (!mp->fullmm)
-			flush_tlb_pending();
 		free_pages_and_swap_cache(mp->pages, mp->pages_nr);
 		mp->pages_nr = 0;
 		mp->need_flush = 0;

Thanks Dave,

I can confirm that i can boot a 2.6.29.1 kernel with the patch applied.

Dennis