Bug 6440 - PS/2 mouse don't work properly after detach/attach
Summary: PS/2 mouse don't work properly after detach/attach
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Input Devices (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Dmitry Torokhov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-25 12:12 UTC by paapaa125
Modified: 2006-05-01 15:46 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.16.9
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
Fix new device detection logic (820 bytes, patch)
2006-04-25 21:19 UTC, Dmitry Torokhov
Details | Diff

Description paapaa125 2006-04-25 12:12:31 UTC
Most recent kernel where this bug did not occur: 2.6.15.6
Distribution: Gentoo
Hardware Environment: x86
Software Environment:

Problem Description: My PS/2 mouse (Logitech MX500) has 8 buttons. If I remove
it from the computer and plug it back, I lose the functionality of all the
buttons above 3. Only buttons 1-3 remain functional. 2.6.17_rc2 also does this.
Kernel 2.6.15.6 and earlier didn't behave like this: all the buttons remained
totally functional after detaching and attaching the mouse. 

The question is: should the user expect a PS/2 mouse to work properly after
deatching/attaching it (and why this behaviour changed in 2.6.16 kernel)? If
not, then this is not a bug.

Steps to reproduce:
1. Remove the PS/2 mouse connector from the computer.
2. Connect the PS/2 mouse back to the computer.
Comment 1 paapaa125 2006-04-25 12:20:29 UTC
Here is dmesg from 2.6.16. The last line ("psmouse.c...") appears after
detach/attach:

Linux version 2.6.16 (root@loota) (gcc version 3.4.5 (Gentoo 3.4.5-r1,
ssp-3.4.5-1.0, pie-8.7.9)) #1 Tue Apr 25 22:04:17 EEST 2006
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
 BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000003fff0000 (usable)
 BIOS-e820: 000000003fff0000 - 000000003fff3000 (ACPI NVS)
 BIOS-e820: 000000003fff3000 - 0000000040000000 (ACPI data)
 BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)
 BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
 BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)
127MB HIGHMEM available.
896MB LOWMEM available.
On node 0 totalpages: 262128
  DMA zone: 4096 pages, LIFO batch:0
  DMA32 zone: 0 pages, LIFO batch:0
  Normal zone: 225280 pages, LIFO batch:31
  HighMem zone: 32752 pages, LIFO batch:7
DMI 2.2 present.
ACPI: RSDP (v000 Nvidia                                ) @ 0x000f75f0
ACPI: RSDT (v001 Nvidia AWRDACPI 0x42302e31 AWRD 0x00000000) @ 0x3fff3000
ACPI: FADT (v001 Nvidia AWRDACPI 0x42302e31 AWRD 0x00000000) @ 0x3fff3040
ACPI: MADT (v001 Nvidia AWRDACPI 0x42302e31 AWRD 0x00000000) @ 0x3fff74c0
ACPI: DSDT (v001 NVIDIA AWRDACPI 0x00001000 MSFT 0x0100000e) @ 0x00000000
ACPI: PM-Timer IO Port: 0x4008
Allocating PCI resources starting at 50000000 (gap: 40000000:bec00000)
Built 1 zonelists
Kernel command line: root=/dev/hda3 parport=0x378,7,3
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
PID hash table entries: 4096 (order: 12, 65536 bytes)
Detected 2159.504 MHz processor.
Using pmtmr for high-res timesource
Console: colour VGA+ 80x25
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 1036340k/1048512k available (1772k kernel code, 11580k reserved, 471k
data, 128k init, 131008k highmem)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay using timer specific routine.. 4323.88 BogoMIPS (lpj=2161943)
Mount-cache hash table entries: 512
CPU: After generic identify, caps: 0383fbff c1cbfbff 00000000 00000000 00000000
00000000 00000000
CPU: After vendor identify, caps: 0383fbff c1cbfbff 00000000 00000000 00000000
00000000 00000000
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 512K (64 bytes/line)
CPU: After all inits, caps: 0383fbff c1cbfbff 00000000 00000020 00000000
00000000 00000000
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
CPU: AMD Unknown CPU Typ stepping 00
Checking 'hlt' instruction... OK.
ACPI: setting ELCR to 0200 (from 0c38)
NET: Registered protocol family 16
ACPI: bus type pci registered
PCI: PCI BIOS revision 2.10 entry at 0xfb470, last bus=2
PCI: Using configuration type 1
ACPI: Subsystem revision 20060127
ACPI: Interpreter enabled
ACPI: Using PIC for interrupt routing
ACPI: PCI Root Bridge [PCI0] (0000:00)
PCI: Probing PCI hardware (bus 00)
PCI: nForce2 C1 Halt Disconnect fixup
Boot video device is 0000:02:00.0
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.HUB0._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.AGPB._PRT]
ACPI: PCI Interrupt Link [LNK1] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNK2] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNK3] (IRQs 3 4 5 6 7 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNK4] (IRQs 3 4 *5 6 7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LNK5] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LUBA] (IRQs 3 4 *5 6 7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LUBB] (IRQs 3 4 5 6 7 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LMAC] (IRQs 3 4 5 6 7 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LAPU] (IRQs 3 *4 5 6 7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LACI] (IRQs *3 4 5 6 7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LMCI] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LSMB] (IRQs *3 4 5 6 7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LUB2] (IRQs 3 4 5 6 7 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LFIR] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [L3CM] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LIDE] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [APC1] (IRQs *16), disabled.
ACPI: PCI Interrupt Link [APC2] (IRQs *17), disabled.
ACPI: PCI Interrupt Link [APC3] (IRQs *18), disabled.
ACPI: PCI Interrupt Link [APC4] (IRQs *19), disabled.
ACPI: PCI Interrupt Link [APC5] (IRQs *16), disabled.
ACPI: PCI Interrupt Link [APCF] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCG] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCH] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCI] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCJ] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCK] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCS] (IRQs *23), disabled.
ACPI: PCI Interrupt Link [APCL] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCM] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [AP3C] (IRQs 20 21 22) *0, disabled.
ACPI: PCI Interrupt Link [APCZ] (IRQs 20 21 22) *0, disabled.
PCI: Using ACPI for IRQ routing
PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a report
PCI: Bridge: 0000:00:08.0
  IO window: 9000-afff
  MEM window: ea000000-ebffffff
  PREFETCH window: 50000000-500fffff
PCI: Bridge: 0000:00:1e.0
  IO window: b000-bfff
  MEM window: e8000000-e9ffffff
  PREFETCH window: d8000000-e7ffffff
PCI: Setting latency timer of device 0000:00:08.0 to 64
highmem bounce pool size: 64 pages
io scheduler noop registered
io scheduler deadline registered (default)
lp: driver loaded but no devices found
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
parport0: PC-style at 0x378 (0x778), irq 7, dma 3 [PCSPP,TRISTATE,COMPAT,ECP,DMA]
parport0: Printer, Hewlett-Packard HP LaserJet 1200
lp0: using parport0 (interrupt-driven).
forcedeth.c: Reverse Engineered nForce ethernet driver. Version 0.49.
ACPI: PCI Interrupt Link [LMAC] enabled at IRQ 10
PCI: setting IRQ 10 as level-triggered
ACPI: PCI Interrupt 0000:00:04.0[A] -> Link [LMAC] -> GSI 10 (level, low) -> IRQ 10
PCI: Setting latency timer of device 0000:00:04.0 to 64
eth0: forcedeth.c: subsystem: 01043:80a7 bound to 0000:00:04.0
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
NFORCE2: IDE controller at PCI slot 0000:00:09.0
NFORCE2: chipset revision 162
NFORCE2: not 100% native mode: will probe irqs later
NFORCE2: BIOS didn't set cable bits correctly. Enabling workaround.
NFORCE2: 0000:00:09.0 (rev a2) UDMA133 controller
    ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:DMA, hdb:DMA
    ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:DMA, hdd:DMA
Probing IDE interface ide0...
hda: IBM-DTLA-305020, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1...
hdc: PLEXTOR CD-R PX-W4824A, ATAPI CD/DVD-ROM drive
ide1 at 0x170-0x177,0x376 on irq 15
hda: max request size: 128KiB
hda: 40188960 sectors (20576 MB) w/380KiB Cache, CHS=39870/16/63, UDMA(100)
hda: cache flushes not supported
 hda: hda1 hda2 hda3
hdc: ATAPI 40X CD-ROM CD-R/RW drive, 4096kB Cache, UDMA(33)
Uniform CD-ROM driver Revision: 3.20
mice: PS/2 mouse device common for all mice
Advanced Linux Sound Architecture Driver Version 1.0.11rc2 (Wed Jan 04 08:57:20
2006 UTC).
ACPI: PCI Interrupt Link [LACI] enabled at IRQ 3
PCI: setting IRQ 3 as level-triggered
ACPI: PCI Interrupt 0000:00:06.0[A] -> Link [LACI] -> GSI 3 (level, low) -> IRQ 3
PCI: Setting latency timer of device 0000:00:06.0 to 64
input: AT Translated Set 2 keyboard as /class/input/input0
intel8x0_measure_ac97_clock: measured 50668 usecs
intel8x0: clocking to 47378
ALSA device list:
  #0: NVidia nForce2 with ALC650F at 0xec081000, irq 3
NET: Registered protocol family 2
IP route cache hash table entries: 65536 (order: 6, 262144 bytes)
TCP established hash table entries: 262144 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 262144 bind 65536)
TCP reno registered
TCP bic registered
NET: Registered protocol family 1
Using IPI Shortcut mode
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory: 128k freed
input: PS2++ Logitech MX Mouse as /class/input/input1
Adding 506036k swap on /dev/hda2.  Priority:-1 extents:1 across:506036k
EXT3 FS on hda3, internal journal
lp0: ECP mode
psmouse.c: MX Mouse at isa0060/serio1/input0 lost synchronization, throwing 1
bytes away.
Comment 2 Dmitry Torokhov 2006-04-25 13:05:06 UTC
Could you please do the following:
1. echo 1 > /sys/modules/i8042/parameters/debug
2. pull the mouse out
3. plug it back in
4. echo 0 > /sys/modules/i8042/parameters/debug
5. post your dmesg

Thank you.
Comment 3 paapaa125 2006-04-25 15:57:08 UTC
Ok, here are the interesting lines:

drivers/input/serio/i8042.c: 9c <- i8042 (interrupt, KBD, 1) [171244]
drivers/input/serio/i8042.c: aa <- i8042 (interrupt, AUX, 12) [176080]
drivers/input/serio/i8042.c: 00 <- i8042 (interrupt, AUX, 12) [176081]
psmouse.c: MX Mouse at isa0060/serio1/input0 lost synchronization, throwing 1 by
tes away.
drivers/input/serio/i8042.c: d4 -> i8042 (command) [176081]
drivers/input/serio/i8042.c: f5 -> i8042 (parameter) [176081]
drivers/input/serio/i8042.c: fa <- i8042 (interrupt, AUX, 12) [176084]
drivers/input/serio/i8042.c: d4 -> i8042 (command) [176084]
drivers/input/serio/i8042.c: eb -> i8042 (parameter) [176084]
drivers/input/serio/i8042.c: fa <- i8042 (interrupt, AUX, 12) [176087]
drivers/input/serio/i8042.c: 08 <- i8042 (interrupt, AUX, 12) [176088]
drivers/input/serio/i8042.c: 00 <- i8042 (interrupt, AUX, 12) [176090]
drivers/input/serio/i8042.c: 00 <- i8042 (interrupt, AUX, 12) [176091]
drivers/input/serio/i8042.c: d4 -> i8042 (command) [176091]
drivers/input/serio/i8042.c: f4 -> i8042 (parameter) [176091]
drivers/input/serio/i8042.c: fa <- i8042 (interrupt, AUX, 12) [176094]
drivers/input/serio/i8042.c: e0 <- i8042 (interrupt, KBD, 1) [177890]
drivers/input/serio/i8042.c: 49 <- i8042 (interrupt, KBD, 1) [177892]
drivers/input/serio/i8042.c: e0 <- i8042 (interrupt, KBD, 1) [178021]
drivers/input/serio/i8042.c: c9 <- i8042 (interrupt, KBD, 1) [178025]
drivers/input/serio/i8042.c: e0 <- i8042 (interrupt, KBD, 1) [178271]
drivers/input/serio/i8042.c: 49 <- i8042 (interrupt, KBD, 1) [178273]
drivers/input/serio/i8042.c: e0 <- i8042 (interrupt, KBD, 1) [178378]
drivers/input/serio/i8042.c: c9 <- i8042 (interrupt, KBD, 1) [178382]
drivers/input/serio/i8042.c: 1c <- i8042 (interrupt, KBD, 1) [178876]
Comment 4 Dmitry Torokhov 2006-04-25 21:19:59 UTC
Created attachment 7960 [details]
Fix new device detection logic

Thank you for the dmesg. I believe this patch should restore the proper
behavior.
Comment 5 paapaa125 2006-04-26 00:59:20 UTC
Great work, thank you! That fixed the problem completely and now detaching and
attaching doesn't affect the mouse functionality.
Comment 6 Daniel Drake 2006-05-01 15:46:07 UTC
This is now in Linus' tree, thanks Dmitry!

Note You need to log in before you can comment on or make changes to this bug.