From nobody@FreeBSD.org  Mon Sep 26 21:14:27 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DE6C6106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 26 Sep 2011 21:14:27 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id CDD3B8FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 26 Sep 2011 21:14:27 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p8QLERvC051029
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 26 Sep 2011 21:14:27 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p8QLERSY051028;
	Mon, 26 Sep 2011 21:14:27 GMT
	(envelope-from nobody)
Message-Id: <201109262114.p8QLERSY051028@red.freebsd.org>
Date: Mon, 26 Sep 2011 21:14:27 GMT
From: Adam K Kirchhoff <adam.k.kirchhoff@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: PS/2 mouse does not work in 9.0-BETA2/-CURRENT
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         161043
>Category:       kern
>Synopsis:       [psm] PS/2 mouse does not work in 9.0-BETA2/-CURRENT [regression]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jhb
>State:          analyzed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 26 21:20:09 UTC 2011
>Closed-Date:    
>Last-Modified:  Tue May  7 15:20:01 UTC 2013
>Originator:     Adam K Kirchhoff
>Release:        9.0-BETA2, tracking -CURRENT
>Organization:
>Environment:
FreeBSD sorrow.ashke.com 9.0-BETA2 FreeBSD 9.0-BETA2 #5: Sun Sep 25 20:25:35 EDT 2011     root@sorrow.ashke.com:/usr/obj/usr/src/sys/SORROW  i386

>Description:

I have a logitech wireless PS/2 mouse that does not work on 9.0-BETA2.
If I boot from a flash drive with the 8.2 memstick image dd'ed to it,
and drop to a shell, the mouse is clearly detected:

[adamk@sorrow ~]$ egrep "atk|psm" 8.2-dmesg.txt 
psmcpnp0: <PS/2 mouse port> port 0x60,0x64 irq 12 on acpi0
atkbd: the current kbd controller command byte 0045
atkbd: keyboard ID 0xffffffff (1)
atkbd: failed to reset the keyboard.
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
kbd0: atkbd0, AT 84 (1), config:0x0, flags:0x3d0000
atkbd0: [GIANT-LOCKED]
atkbd0: [ITHREAD]
psm0: current command byte:0045
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: [ITHREAD]
psm0: model MouseMan+, device ID 0-3e, 3 buttons
psm0: config:00000000, flags:00000008, packet size:3
psm0: syncmask:08, syncbits:00

With 9.0-BETA2, atkbdc0 has issues:

[adamk@sorrow ~]$ egrep "atk|psm" 9.0-BETA2-dmesg.txt 
psmcpnp0: <PS/2 mouse port> port 0x60,0x64 irq 12 on acpi0
atkbd: the current kbd controller command byte 0045
atkbd: keyboard ID 0xffffffff (1)
atkbd: failed to reset the keyboard.
atkbdc0: <Keyboard controller (i8042)> failed to probe at port 0x60 on isa0

>How-To-Repeat:

Install 9.0-BETA2 on a Dell Precision 490, plug in PS/2 mouse, reboot.
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->wkoszek 
Responsible-Changed-By: wkoszek 
Responsible-Changed-When: czw 2 lut 2012 06:52:16 UTC 
Responsible-Changed-Why:  
Take this one. Seems like I have the same problem with Dell T7400 
workstation at work. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=161043 
State-Changed-From-To: open->analyzed 
State-Changed-By: wkoszek 
State-Changed-When: czw 2 lut 2012 06:52:59 UTC 
State-Changed-Why:  
Hello, 

I have tried running multiple kernel revisions from 2010 to narrow it down, 
and my analysis shows that following kernel works: 

http://freebsd.czest.pl/~wkoszek/stuff/freebsd/t7400/r216490_dmesg_v.txt 

So does the next two, in which John did some changed to atkbd/atkbdc: 

http://freebsd.czest.pl/~wkoszek/stuff/freebsd/t7400/r216491_dmesg_v.txt 
http://freebsd.czest.pl/~wkoszek/stuff/freebsd/t7400/r216492_dmesg_v.txt 

It worked for me at this stage. In other words: r216492 works for me - I can 
see /dev/psm0 and after moused -p /dev/psm0, vidcontrol -m on I see a mouse 
pointer and it works. 

Now there was a point in a time, when it still worked: 

http://freebsd.czest.pl/~wkoszek/stuff/freebsd/t7400/r216613_dmesg_v.txt 

And stopped working after this commit: 

http://freebsd.czest.pl/~wkoszek/stuff/freebsd/t7400/r216614_dmesg_v.txt 

All kernel build, which I've tried: 

http://freebsd.czest.pl/~wkoszek/stuff/freebsd/t7400/kernels.rar 

This is Dell T7400 workstation with the newest BIOS, running FreeBSD/amd64. 

Wojciech 

http://freebsd.czest.pl/~wkoszek/stuff/freebsd/t7400/kernels.rar 

http://www.freebsd.org/cgi/query-pr.cgi?pr=161043 
Responsible-Changed-From-To: wkoszek->jhb 
Responsible-Changed-By: wkoszek 
Responsible-Changed-When: czw 2 lut 2012 07:01:26 UTC 
Responsible-Changed-Why:  
John, would you be willing to take a look at this? I can try inserting 
printf's, if necessary. 

Wojciech 

http://www.freebsd.org/cgi/query-pr.cgi?pr=161043 

From: John Baldwin <jhb@freebsd.org>
To: bug-followup@freebsd.org,
 adam.k.kirchhoff@gmail.com
Cc:  
Subject: Re: kern/161043: [psm] PS/2 mouse does not work in 9.0-BETA2/-CURRENT [regression]
Date: Thu, 2 Feb 2012 07:41:38 -0500

 It's not easy to fix this.  The problem is that the BIOS has put the I/O ports 
 for the keyboard controller on the PS/2 mouse device instead of the keyboard 
 controller device.  One thing we could do is have atkbdc basically attach to 
 both keyboards and mice and build a pseudo-bus out of it.  We already do this 
 now for IRQs (we move the IRQ resource from the mouse to the keyboard 
 controller), we just need to move ports and have it retry.
 
 -- 
 John Baldwin

From: Wojciech Koszek <wojciech.koszek@xilinx.com>
To: <bug-followup@FreeBSD.org>, <adam.k.kirchhoff@gmail.com>
Cc:  
Subject: Re: kern/161043: [psm] PS/2 mouse does not work in 9.0-BETA2/-CURRENT [regression]
Date: Thu, 2 Feb 2012 10:22:48 -0800

 SSBjYW4gdHJ5IHdoYXRldmVyIHBhdGNoZXMgdGhlcmUgYXJlIHRvIGZpeCB0aGlzIHJlZ3Jlc3Np
 b24uDQoNCldvamNpZWNoDQoKVGhpcyBlbWFpbCBhbmQgYW55IGF0dGFjaG1lbnRzIGFyZSBpbnRl
 bmRlZCBmb3IgdGhlIHNvbGUgdXNlIG9mIHRoZSBuYW1lZCByZWNpcGllbnQocykgYW5kIGNvbnRh
 aW4ocykgY29uZmlkZW50aWFsIGluZm9ybWF0aW9uIHRoYXQgbWF5IGJlIHByb3ByaWV0YXJ5LCBw
 cml2aWxlZ2VkIG9yIGNvcHlyaWdodGVkIHVuZGVyIGFwcGxpY2FibGUgbGF3LiBJZiB5b3UgYXJl
 IG5vdCB0aGUgaW50ZW5kZWQgcmVjaXBpZW50LCBkbyBub3QgcmVhZCwgY29weSwgb3IgZm9yd2Fy
 ZCB0aGlzIGVtYWlsIG1lc3NhZ2Ugb3IgYW55IGF0dGFjaG1lbnRzLiBEZWxldGUgdGhpcyBlbWFp
 bCBtZXNzYWdlIGFuZCBhbnkgYXR0YWNobWVudHMgaW1tZWRpYXRlbHkuCg==
 
 

From: taro <iwakura.taro.kun@gmail.com>
To: "bug-followup@freebsd.org" <bug-followup@freebsd.org>
Cc:  
Subject: Re: kern/161043: [psm] PS/2 mouse does not work in 9.0-BETA2/-CURRENT
 [regression]
Date: Tue, 07 May 2013 18:15:28 +0300

 Hi,
 
 Having the same issue on 9.1-STABLE.
 Mouse works well on 8.3-STABLE.
 Motherboard is MSI 890GXM-G65 with one PS/2 port and mouse plugged.
 
 But in my case no mouse-related messages even showed in the dmesg.
 
 Copyright (c) 1992-2013 The FreeBSD Project.
 Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
 	The Regents of the University of California. All rights reserved.
 FreeBSD is a registered trademark of The FreeBSD Foundation.
 FreeBSD 9.1-STABLE #2: Sun Apr 28 12:59:12 EEST 2013
      root@Pym.local:/usr/obj/usr/src/sys/SUGOI amd64
 gcc version 4.2.1 20070831 patched [FreeBSD]
 link_elf_obj: symbol ata_controlcmd undefined
 KLD file atapicam.ko - could not finalize loading
 CPU: AMD Phenom(tm) II X4 905e Processor (2500.04-MHz K8-class CPU)
    Origin = "AuthenticAMD"  Id = 0x100f42  Family = 0x10  Model = 0x4   
 Stepping = 2
    Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
    Features2=0x802009<SSE3,MON,CX16,POPCNT>
    AMD  
 Features=0xee500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM,3DNow!+,3DNow!>
    AMD  
 Features2=0x837ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS,SKINIT,WDT,NodeId>
    TSC: P-state invariant
 real memory  = 2147483648 (2048 MB)
 avail memory = 2054205440 (1959 MB)
 Event timer "LAPIC" quality 400
 ACPI APIC Table: <7642MS A7642100>
 FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
 FreeBSD/SMP: 1 package(s) x 4 core(s)
   cpu0 (BSP): APIC ID:  0
   cpu1 (AP): APIC ID:  1
   cpu2 (AP): APIC ID:  2
   cpu3 (AP): APIC ID:  3
 ioapic0 <Version 2.1> irqs 0-23 on motherboard
 acpi0: <7642MS A7642100> on motherboard
 acpi0: Power Button (fixed)
 acpi0: reservation of fee00000, 1000 (3) failed
 acpi0: reservation of ffb80000, 80000 (3) failed
 acpi0: reservation of fec10000, 20 (3) failed
 acpi0: reservation of fed80000, 1000 (3) failed
 acpi0: reservation of 0, a0000 (3) failed
 acpi0: reservation of 100000, 7ff00000 (3) failed
 cpu0: <ACPI CPU> on acpi0
 cpu1: <ACPI CPU> on acpi0
 cpu2: <ACPI CPU> on acpi0
 cpu3: <ACPI CPU> on acpi0
 attimer0: <AT timer> port 0x40-0x43 irq 0 on acpi0
 Timecounter "i8254" frequency 1193182 Hz quality 0
 Event timer "i8254" frequency 1193182 Hz quality 100
 atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0
 hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
 Timecounter "HPET" frequency 14318180 Hz quality 950
 Event timer "HPET" frequency 14318180 Hz quality 450
 Event timer "HPET1" frequency 14318180 Hz quality 450
 Event timer "HPET2" frequency 14318180 Hz quality 450
 Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
 acpi_timer0: <32-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
 pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
 pci0: <ACPI PCI bus> on pcib0
 pcib1: <ACPI PCI-PCI bridge> at device 1.0 on pci0
 pci1: <ACPI PCI bus> on pcib1
 vgapci0: <VGA-compatible display> port 0xa000-0xa0ff mem  
 0xf0000000-0xf7ffffff,0xfe7f0000-0xfe7fffff,0xfe600000-0xfe6fffff irq 18  
 at device 5.0 on pci1
 drm0: <ATI RS880> on vgapci0
 info: [drm] MSI enabled 1 message(s)
 info: [drm] Initialized radeon 1.31.0 20080613
 hdac0: <ATI (0x970f) HDA Controller> mem 0xfe7e8000-0xfe7ebfff irq 19 at  
 device 5.1 on pci1
 pcib2: <ACPI PCI-PCI bridge> irq 17 at device 5.0 on pci0
 pci2: <ACPI PCI bus> on pcib2
 re0: <RealTek 8168/8111 B/C/CP/D/DP/E/F PCIe Gigabit Ethernet> port  
 0xb800-0xb8ff mem 0xfdfff000-0xfdffffff,0xfdff8000-0xfdffbfff irq 17 at  
 device 0.0 on pci2
 re0: Using 1 MSI-X message
 re0: Chip rev. 0x28000000
 re0: MAC rev. 0x00000000
 miibus0: <MII bus> on re0
 rgephy0: <RTL8169S/8110S/8211 1000BASE-T media interface> PHY 1 on miibus0
 rgephy0:  none, 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX,  
 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT, 1000baseT-master,  
 1000baseT-FDX, 1000baseT-FDX-master, 1000baseT-FDX-flow,  
 1000baseT-FDX-flow-master, auto, auto-flow
 re0: Ethernet address: 40:61:86:e7:98:ff
 pcib3: <ACPI PCI-PCI bridge> irq 18 at device 6.0 on pci0
 pci3: <ACPI PCI bus> on pcib3
 ahci0: <ATI IXP700 AHCI SATA controller> port  
 0x9000-0x9007,0x8000-0x8003,0x7000-0x7007,0x6000-0x6003,0x5000-0x500f mem  
 0xfe5ffc00-0xfe5fffff irq 19 at device 17.0 on pci0
 ahci0: AHCI v1.20 with 6 6Gbps ports, Port Multiplier supported
 ahcich0: <AHCI channel> at channel 0 on ahci0
 ahcich1: <AHCI channel> at channel 1 on ahci0
 ahcich2: <AHCI channel> at channel 2 on ahci0
 ahcich3: <AHCI channel> at channel 3 on ahci0
 ahcich4: <AHCI channel> at channel 4 on ahci0
 ahcich5: <AHCI channel> at channel 5 on ahci0
 ohci0: <AMD SB7x0/SB8x0/SB9x0 USB controller> mem 0xfe5fe000-0xfe5fefff  
 irq 18 at device 18.0 on pci0
 usbus0 on ohci0
 ehci0: <AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller> mem  
 0xfe5ff800-0xfe5ff8ff irq 17 at device 18.2 on pci0
 usbus1: EHCI version 1.0
 usbus1 on ehci0
 ohci1: <AMD SB7x0/SB8x0/SB9x0 USB controller> mem 0xfe5fd000-0xfe5fdfff  
 irq 18 at device 19.0 on pci0
 usbus2 on ohci1
 ehci1: <AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller> mem  
 0xfe5ff400-0xfe5ff4ff irq 17 at device 19.2 on pci0
 usbus3: EHCI version 1.0
 usbus3 on ehci1
 pci0: <serial bus, SMBus> at device 20.0 (no driver attached)
 hdac1: <ATI SB600 HDA Controller> mem 0xfe5f4000-0xfe5f7fff irq 16 at  
 device 20.2 on pci0
 isab0: <PCI-ISA bridge> at device 20.3 on pci0
 isa0: <ISA bus> on isab0
 pcib4: <ACPI PCI-PCI bridge> at device 20.4 on pci0
 pci4: <ACPI PCI bus> on pcib4
 xl0: <3Com 3c905B-TX Fast Etherlink XL> port 0xc800-0xc87f mem  
 0xfe9fbc00-0xfe9fbc7f irq 20 at device 5.0 on pci4
 miibus1: <MII bus> on xl0
 bmtphy0: <Broadcom 3c905B internal PHY> PHY 24 on miibus1
 bmtphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto,  
 auto-flow
 xl0: Ethernet address: 00:50:04:45:70:30
 ohci2: <AMD SB7x0/SB8x0/SB9x0 USB controller> mem 0xfe5fc000-0xfe5fcfff  
 irq 18 at device 20.5 on pci0
 usbus4 on ohci2
 pcib5: <ACPI PCI-PCI bridge> at device 21.0 on pci0
 pci5: <ACPI PCI bus> on pcib5
 atapci0: <JMicron JMB368 UDMA133 controller> port  
 0xe800-0xe807,0xe400-0xe403,0xe000-0xe007,0xd800-0xd803,0xd400-0xd40f irq  
 16 at device 0.0 on pci5
 ata2: <ATA channel> at channel 0 on atapci0
 ohci3: <AMD SB7x0/SB8x0/SB9x0 USB controller> mem 0xfe5f3000-0xfe5f3fff  
 irq 18 at device 22.0 on pci0
 usbus5 on ohci3
 ehci2: <AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller> mem  
 0xfe5ff000-0xfe5ff0ff irq 17 at device 22.2 on pci0
 usbus6: EHCI version 1.0
 usbus6 on ehci2
 amdtemp0: <AMD CPU On-Die Thermal Sensors> on hostb4
 acpi_button0: <Power Button> on acpi0
 uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
 amdsbwd0: <AMD SB8xx Watchdog Timer> at iomem  
 0xfec000f0-0xfec000f3,0xfec000f4-0xfec000f7 on isa0
 sc0: <System console> at flags 0x100 on isa0
 sc0: VGA <16 virtual consoles, flags=0x300>
 vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
 ppc0: cannot reserve I/O port range
 ctl: CAM Target Layer loaded
 acpi_throttle0: <ACPI CPU Throttling> on cpu0
 hwpstate0: <Cool`n'Quiet 2.0> on cpu0
 Timecounters tick every 1.000 msec
 hdacc0: <ATI RS690/780 HDA CODEC> at cad 0 on hdac0
 hdaa0: <ATI RS690/780 Audio Function Group> at nid 1 on hdacc0
 pcm0: <ATI RS690/780 (HDMI)> at nid 3 on hdaa0
 hdacc1: <Realtek ALC889 HDA CODEC> at cad 2 on hdac1
 hdaa1: <Realtek ALC889 Audio Function Group> at nid 1 on hdacc1
 pcm1: <Realtek ALC889 (Rear Analog 7.1/2.0)> at nid 20,22,21,23 and 24,26  
 on hdaa1
 pcm2: <Realtek ALC889 (Front Analog)> at nid 27 and 25 on hdaa1
 pcm3: <Realtek ALC889 (Rear Digital)> at nid 30 on hdaa1
 pcm4: <Realtek ALC889 (Rear Digital)> at nid 17 on hdaa1
 usbus0: 12Mbps Full Speed USB v1.0
 usbus1: 480Mbps High Speed USB v2.0
 usbus2: 12Mbps Full Speed USB v1.0
 usbus3: 480Mbps High Speed USB v2.0
 usbus4: 12Mbps Full Speed USB v1.0
 usbus5: 12Mbps Full Speed USB v1.0
 usbus6: 480Mbps High Speed USB v2.0
 ugen0.1: <ATI> at usbus0
 uhub0: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
 ugen1.1: <ATI> at usbus1
 uhub1: <ATI EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
 ugen2.1: <ATI> at usbus2
 uhub2: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus2
 ugen3.1: <ATI> at usbus3
 uhub3: <ATI EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus3
 ugen4.1: <ATI> at usbus4
 uhub4: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus4
 ugen5.1: <ATI> at usbus5
 uhub5: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus5
 ugen6.1: <ATI> at usbus6
 uhub6: <ATI EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus6
 ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
 ada0: <WDC WD10EARS-00Y5B1 80.00A80> ATA-8 SATA 2.x device
 ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
 ada0: Command Queueing enabled
 ada0: 953869MB (1953525168 512 byte sectors: 16H 63S/T 16383C)
 ada0: Previously was known as ad4
 SMP: AP CPU #2 Launched!
 SMP: AP CPU #3 Launched!
 SMP: AP CPU #1 Launched!
 Timecounter "TSC-low" frequency 1250018099 Hz quality 800
 uhub4: 2 ports with 2 removable, self powered
 uhub5: 4 ports with 4 removable, self powered
 uhub0: 5 ports with 5 removable, self powered
 uhub2: 5 ports with 5 removable, self powered
 Root mount waiting for: usbus6 usbus3 usbus1
 Root mount waiting for: usbus6 usbus3 usbus1
 uhub6: 4 ports with 4 removable, self powered
 uhub1: 5 ports with 5 removable, self powered
 uhub3: 5 ports with 5 removable, self powered
 Trying to mount root from ufs:/dev/ada0s1a [rw,noatime]...
 ugen0.2: <Logitech> at usbus0
 ukbd0: <Logitech Logitech USB Keyboard, class 0/0, rev 1.10/28.00, addr 2>  
 on usbus0
 kbd0 at ukbd0
 
 --
 Best regards
>Unformatted:
