2005-09-16 04:38:00

by Tim Rupp

[permalink] [raw]
Subject: Lost keyboard on Inspiron 8200 at 2.6.13

112k kernel code, 14668k reserved, 1093k data, 176k init, 130952k highmem)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay using timer specific routine.. 3195.41 BogoMIPS (lpj=6390820)
Security Framework v1.0.0 initialized
SELinux: Disabled at boot.
Mount-cache hash table entries: 512
CPU: After generic identify, caps: 3febf9ff 00000000 00000000 00000000 00000000 00000000 00000000
CPU: After vendor identify, caps: 3febf9ff 00000000 00000000 00000000 00000000 00000000 00000000
CPU: Trace cache: 12K uops, L1 D cache: 8K
CPU: L2 cache: 512K
CPU: After all inits, caps: 3febf9ff 00000000 00000000 00000080 00000000 00000000 00000000
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
CPU0: Intel P4/Xeon Extended MCE MSRs (12) available
mtrr: v2.0 (20020519)
CPU: Intel(R) Pentium(R) 4 Mobile CPU 1.60GHz stepping 04
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Checking 'hlt' instruction... OK.
ACPI: setting ELCR to 0200 (from 0800)
checking if image is initramfs... it is
Freeing initrd memory: 984k freed
NET: Registered protocol family 16
ACPI: bus type pci registered
PCI: PCI BIOS revision 2.10 entry at 0xfbfee, last bus=2
PCI: Using configuration type 1
ACPI: Subsystem revision 20050408
ACPI: Interpreter enabled
ACPI: Using PIC for interrupt routing
ACPI: PCI Root Bridge [PCI0] (0000:00)
PCI: Probing PCI hardware (bus 00)
ACPI: Assume root bridge [\_SB_.PCI0] segment is 0
ACPI: Assume root bridge [\_SB_.PCI0] bus is 0
PCI: Ignoring BAR0-3 of IDE controller 0000:00:1f.1
Boot video device is 0000:01:00.0
PCI: Transparent bridge - 0000:00:1e.0
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
ACPI: PCI Interrupt Link [LNKA] (IRQs 9 10 *11)
ACPI: PCI Interrupt Link [LNKB] (IRQs 5 7) *11
ACPI: PCI Interrupt Link [LNKC] (IRQs 9 10 *11)
ACPI: PCI Interrupt Link [LNKD] (IRQs 5 7 9 10 *11)
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.AGP_._PRT]
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PCIE._PRT]
ACPI: Power Resource [PADA] (on)
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI init
pnp: PnP ACPI: found 16 devices
SCSI subsystem initialized
usbcore: registered new driver usbfs
usbcore: registered new driver hub
PCI: Using ACPI for IRQ routing
PCI: If a device doesn't work, try "pci=routeirq". If it helps, post a report
pnp: 00:01: ioport range 0x4d0-0x4d1 has been reserved
pnp: 00:01: ioport range 0x800-0x805 could not be reserved
pnp: 00:01: ioport range 0x808-0x80f could not be reserved
pnp: 00:02: ioport range 0x806-0x807 has been reserved
pnp: 00:02: ioport range 0x810-0x85f could not be reserved
pnp: 00:02: ioport range 0x860-0x87f has been reserved
pnp: 00:02: ioport range 0x880-0x8bf has been reserved
pnp: 00:02: ioport range 0x8c0-0x8ff has been reserved
pnp: 00:03: ioport range 0xf000-0xf0fe has been reserved
pnp: 00:03: ioport range 0xf100-0xf1fe has been reserved
pnp: 00:03: ioport range 0xf200-0xf2fe has been reserved
pnp: 00:03: ioport range 0xf400-0xf4fe has been reserved
pnp: 00:03: ioport range 0xf500-0xf5fe has been reserved
pnp: 00:03: ioport range 0xf600-0xf6fe has been reserved
pnp: 00:03: ioport range 0xf800-0xf8fe has been reserved
pnp: 00:03: ioport range 0xf900-0xf9fe has been reserved
pnp: 00:08: ioport range 0x900-0x91f has been reserved
pnp: 00:08: ioport range 0x3f0-0x3f1 has been reserved
PCI: Bridge: 0000:00:01.0
IO window: c000-cfff
MEM window: fc000000-fdffffff
PREFETCH window: d8000000-e7ffffff
PCI: Bus 3, cardbus bridge: 0000:02:01.0
IO window: 00001000-00001fff
IO window: 00002000-00002fff
PREFETCH window: 40000000-41ffffff
MEM window: f4000000-f5ffffff
PCI: Bus 7, cardbus bridge: 0000:02:01.1
IO window: 00003000-00003fff
IO window: 00004000-00004fff
PREFETCH window: 42000000-43ffffff
MEM window: f6000000-f7ffffff
PCI: Bridge: 0000:00:1e.0
IO window: e000-ffff
MEM window: f4000000-fbffffff
PREFETCH window: 40000000-44ffffff
PCI: Setting latency timer of device 0000:00:1e.0 to 64
PCI: Enabling device 0000:02:01.0 (0000 -> 0003)
ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 11
PCI: setting IRQ 11 as level-triggered
ACPI: PCI Interrupt 0000:02:01.0[A] -> Link [LNKD] -> GSI 11 (level, low) -> IRQ 11
PCI: Enabling device 0000:02:01.1 (0000 -> 0003)
ACPI: PCI Interrupt 0000:02:01.1[A] -> Link [LNKD] -> GSI 11 (level, low) -> IRQ 11
Machine check exception polling timer started.
audit: initializing netlink socket (disabled)
audit(1126817221.052:1): initialized
highmem bounce pool size: 64 pages
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
Installing knfsd (copyright (C) 1996 [email protected]).
Initializing Cryptographic API
ACPI: AC Adapter [AC] (on-line)
ACPI: Battery Slot [BAT0] (battery absent)
ACPI: Battery Slot [BAT1] (battery present)
ACPI: Lid Switch [LID]
ACPI: Power Button (CM) [PBTN]
ACPI: Sleep Button (CM) [SBTN]
ACPI: CPU0 (power states: C1[C1] C2[C2])
ACPI: Processor [CPU0] (supports 8 throttling states)
ACPI: Thermal Zone [THM] (60 C)
lp: driver loaded but no devices found
Dell laptop SMM driver v1.14 21/02/2005 Massimo Dal Zotto ([email protected])
Linux agpgart interface v0.101 (c) Dave Jones
agpgart: Detected an Intel i845 Chipset.
agpgart: AGP aperture is 64M @ 0xe8000000
[drm] Initialized drm 1.0.0 20040925
PNP: PS/2 Controller [PNP0303:KBC,PNP0f13:PS2M] at 0x60,0x64 irq 1,12
i8042.c: Can't read CTR while initializing i8042.
pnp: Device 00:05 does not supported disabling.
pnp: Device 00:04 does not supported disabling.
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 5
PCI: setting IRQ 5 as level-triggered
ACPI: PCI Interrupt 0000:00:1f.6[B] -> Link [LNKB] -> GSI 5 (level, low) -> IRQ 5
ACPI: PCI interrupt for device 0000:00:1f.6 disabled
parport: PnPBIOS parport detected.
parport0: PC-style at 0x378 (0x778), irq 7 [PCSPP(,...)]
lp0: using parport0 (interrupt-driven).
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
Floppy drive(s): fd0 is 1.44M
FDC 0 is a post-1991 82077
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
ICH3M: IDE controller at PCI slot 0000:00:1f.1
PCI: Enabling device 0000:00:1f.1 (0005 -> 0007)
ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 11
ACPI: PCI Interrupt 0000:00:1f.1[A] -> Link [LNKA] -> GSI 11 (level, low) -> IRQ 11
ICH3M: chipset revision 2
ICH3M: not 100% native mode: will probe irqs later
ide0: BM-DMA at 0xbfa0-0xbfa7, BIOS settings: hda:DMA, hdb:DMA
ide1: BM-DMA at 0xbfa8-0xbfaf, BIOS settings: hdc:DMA, hdd:pio
Probing IDE interface ide0...
hda: HTS548040M9AT00, ATA DISK drive
hdb: TEAC CD-RW CD-W224E, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1...
hdc: HL-DT-STDVD-ROM GDR8081N, ATAPI CD/DVD-ROM drive
ide1 at 0x170-0x177,0x376 on irq 15
hda: max request size: 1024KiB
hda: 78140160 sectors (40007 MB) w/7877KiB Cache, CHS=16383/255/63, UDMA(100)
hda: cache flushes supported
hda: hda1 hda2 hda3 hda4 < hda5 >
hdb: ATAPI 24X CD-ROM CD-R/RW drive, 1280kB Cache, DMA
Uniform CD-ROM driver Revision: 3.20
hdc: ATAPI 24X DVD-ROM drive, 512kB Cache, DMA
ieee1394: Initialized config rom entry `ip1394'
ohci1394: $Rev: 1299 $ Ben Collins <[email protected]>
ACPI: PCI Interrupt 0000:02:01.2[A] -> Link [LNKD] -> GSI 11 (level, low) -> IRQ 11
ohci1394: fw-host0: OHCI-1394 1.0 (PCI): IRQ=[11] MMIO=[f8fff000-f8fff7ff] Max Packet=[2048]
ieee1394: raw1394: /dev/raw1394 device initialized
usbmon: debugfs is not available
USB Universal Host Controller Interface driver v2.3
ACPI: PCI Interrupt 0000:00:1d.0[A] -> Link [LNKA] -> GSI 11 (level, low) -> IRQ 11
PCI: Setting latency timer of device 0000:00:1d.0 to 64
uhci_hcd 0000:00:1d.0: Intel Corporation 82801CA/CAM USB (Hub #1)
uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 1
uhci_hcd 0000:00:1d.0: irq 11, io base 0x0000bf80
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11
ACPI: PCI Interrupt 0000:00:1d.2[C] -> Link [LNKC] -> GSI 11 (level, low) -> IRQ 11
PCI: Setting latency timer of device 0000:00:1d.2 to 64
uhci_hcd 0000:00:1d.2: Intel Corporation 82801CA/CAM USB (Hub #3)
uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 2
uhci_hcd 0000:00:1d.2: irq 11, io base 0x0000bf20
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
usbcore: registered new driver usblp
drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usbcore: registered new driver usbhid
drivers/usb/input/hid-core.c: v2.01:USB HID core driver
mice: PS/2 mouse device common for all mice
input: PC Speaker
Advanced Linux Sound Architecture Driver Version 1.0.9b (Thu Jul 28 12:20:13 2005 UTC).
ALSA device list:
No soundcards found.
oprofile: using timer interrupt.
NET: Registered protocol family 2
IP route cache hash table entries: 65536 (order: 6, 262144 bytes)
TCP established hash table entries: 262144 (order: 9, 2097152 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 262144 bind 65536)
TCP reno registered
ip_conntrack version 2.1 (8191 buckets, 65528 max) - 212 bytes per conntrack
ip_tables: (C) 2000-2002 Netfilter core team
ipt_recent v0.3.1: Stephen Frost <[email protected]>. http://snowman.net/projects/ipt_recent/
arp_tables: (C) 2002 David S. Miller
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Using IPI Shortcut mode
ACPI wakeup devices:
LID PBTN PCI0 UAR1 USB0 USB1 USB2 MODM PCIE MPCI
ACPI: (supports S0 S1 S3 S4 S4bios S5)
Freeing unused kernel memory: 176k freed
kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
ieee1394: Host added: ID:BUS[0-00:1023] GUID[464fc000270ec421]
ACPI: PCI Interrupt 0000:02:00.0[A] -> Link [LNKC] -> GSI 11 (level, low) -> IRQ 11
3c59x: Donald Becker and others. http://www.scyld.com/network/vortex.html
0000:02:00.0: 3Com PCI 3c905C Tornado at 0xec80. Vers LK1.1.19
ACPI: PCI Interrupt 0000:00:1f.5[B] -> Link [LNKB] -> GSI 5 (level, low) -> IRQ 5
PCI: Setting latency timer of device 0000:00:1f.5 to 64
intel8x0_measure_ac97_clock: measured 55413 usecs
intel8x0: clocking to 48000
ACPI: PCI Interrupt 0000:00:1f.6[B] -> Link [LNKB] -> GSI 5 (level, low) -> IRQ 5
PCI: Setting latency timer of device 0000:00:1f.6 to 64
MC'97 1 converters and GPIO not ready (0xff00)
hw_random hardware driver 1.0.0 loaded
pci_hotplug: PCI Hot Plug PCI Core version: 0.5
shpchp: acpi_shpchprm:\_SB_.PCI0 evaluate _BBN fail=0x5
shpchp: acpi_shpchprm:get_device PCI ROOT HID fail=0x5
ACPI: PCI Interrupt 0000:02:01.0[A] -> Link [LNKD] -> GSI 11 (level, low) -> IRQ 11
Yenta: CardBus bridge found at 0000:02:01.0 [1028:00d4]
Yenta: Using CSCINT to route CSC interrupts to PCI
Yenta: Routing CardBus interrupts to PCI
Yenta TI: socket 0000:02:01.0, mfunc 0x05033002, devctl 0x64
Yenta: ISA IRQ mask 0x0418, PCI irq 11
Socket status: 30000020
pcmcia: parent PCI bridge I/O window: 0xe000 - 0xffff
pcmcia: parent PCI bridge Memory window: 0xf4000000 - 0xfbffffff
pcmcia: parent PCI bridge Memory window: 0x40000000 - 0x44ffffff
ACPI: PCI Interrupt 0000:02:01.1[A] -> Link [LNKD] -> GSI 11 (level, low) -> IRQ 11
Yenta: CardBus bridge found at 0000:02:01.1 [1028:00d4]
Yenta: Using CSCINT to route CSC interrupts to PCI
Yenta: Routing CardBus interrupts to PCI
Yenta TI: socket 0000:02:01.1, mfunc 0x05033002, devctl 0x64
Yenta: ISA IRQ mask 0x0418, PCI irq 11
Socket status: 30000061
pcmcia: parent PCI bridge I/O window: 0xe000 - 0xffff
pcmcia: parent PCI bridge Memory window: 0xf4000000 - 0xfbffffff
pcmcia: parent PCI bridge Memory window: 0x40000000 - 0x44ffffff
PCI: Enabling device 0000:07:00.2 (0000 -> 0002)
ACPI: PCI Interrupt 0000:07:00.2[C] -> Link [LNKD] -> GSI 11 (level, low) -> IRQ 11
ehci_hcd 0000:07:00.2: NEC Corporation USB 2.0
ehci_hcd 0000:07:00.2: new USB bus registered, assigned bus number 3
ehci_hcd 0000:07:00.2: irq 11, io mem 0xf6002000
ehci_hcd 0000:07:00.2: USB 2.0 initialized, EHCI 0.95, driver 10 Dec 2004
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 5 ports detected
ohci_hcd: 2005 April 22 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
PCI: Enabling device 0000:07:00.0 (0000 -> 0002)
ACPI: PCI Interrupt 0000:07:00.0[A] -> Link [LNKD] -> GSI 11 (level, low) -> IRQ 11
PCI: Setting latency timer of device 0000:07:00.0 to 64
ohci_hcd 0000:07:00.0: NEC Corporation USB
ohci_hcd 0000:07:00.0: new USB bus registered, assigned bus number 4
ohci_hcd 0000:07:00.0: irq 11, io mem 0xf6000000
hub 4-0:1.0: USB hub found
hub 4-0:1.0: 3 ports detected
PCI: Enabling device 0000:07:00.1 (0000 -> 0002)
ACPI: PCI Interrupt 0000:07:00.1[B] -> Link [LNKD] -> GSI 11 (level, low) -> IRQ 11
PCI: Setting latency timer of device 0000:07:00.1 to 64
ohci_hcd 0000:07:00.1: NEC Corporation USB (#2)
ohci_hcd 0000:07:00.1: new USB bus registered, assigned bus number 5
ohci_hcd 0000:07:00.1: irq 11, io mem 0xf6001000
hub 5-0:1.0: USB hub found
hub 5-0:1.0: 2 ports detected
audit(1126817240.999:2): user pid=2110 uid=0 auid=4294967295 msg='hwclock: op=changing system time id=0 res=success'
ACPI: Video Device [VID] (multi-head: yes rom: no post: no)
EXT3 FS on hda5, internal journal
kjournald starting. Commit interval 5 seconds
EXT3 FS on hda2, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
Adding 610460k swap on /dev/hda3. Priority:-1 extents:1
ACPI: PCI Interrupt 0000:02:00.0[A] -> Link [LNKC] -> GSI 11 (level, low) -> IRQ 11
dazuko: version magic '2.6.12.3 preempt PENTIUM4 REGPARM 4KSTACKS gcc-4.0' should be '2.6.13.1 preempt PENTIUM4 gcc-4.0'
audit(1126817293.782:3): user pid=2922 uid=0 auid=4294967295 msg='PAM authentication: user=tim exe="/usr/sbin/sshd" (hostname=10.21.6.21, addr=10.21.6.21, terminal=ssh result=Success)'
audit(1126817293.782:4): user pid=2922 uid=0 auid=4294967295 msg='PAM accounting: user=tim exe="/usr/sbin/sshd" (hostname=10.21.6.21, addr=10.21.6.21, terminal=ssh result=Success)'
audit(1126817293.886:5): user pid=2926 uid=0 auid=4294967295 msg='PAM session open: user=tim exe="/usr/sbin/sshd" (hostname=10.21.6.21, addr=10.21.6.21, terminal=ssh result=Success)'
audit(1126817293.886:6): user pid=2926 uid=0 auid=4294967295 msg='PAM setcred: user=tim exe="/usr/sbin/sshd" (hostname=10.21.6.21, addr=10.21.6.21, terminal=ssh result=Success)'
audit(1126817300.399:7): user pid=2957 uid=500 auid=4294967295 msg='PAM authentication: user=root exe="/bin/su" (hostname=?, addr=?, terminal=pts/0 result=Success)'
audit(1126817300.399:8): user pid=2957 uid=500 auid=4294967295 msg='PAM accounting: user=root exe="/bin/su" (hostname=?, addr=?, terminal=pts/0 result=Success)'
audit(1126817300.491:9): user pid=2957 uid=500 auid=4294967295 msg='PAM session open: user=root exe="/bin/su" (hostname=?, addr=?, terminal=pts/0 result=Success)'
audit(1126817300.491:10): user pid=2957 uid=500 auid=4294967295 msg='PAM setcred: user=root exe="/bin/su" (hostname=?, addr=?, terminal=pts/0 result=Success)'


Attachments:
dmesg-2.6.12.3-08-05-2005 (14.60 kB)
dmesg-2.6.13.1 (15.14 kB)
Download all attachments

2005-09-16 04:58:04

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: Lost keyboard on Inspiron 8200 at 2.6.13

On Thursday 15 September 2005 23:29, Tim Rupp wrote:
> I just recently went to upgrade to 2.6.13 from 2.6.12.3 and after
> re-compiling with a clean .config, I've hit a snag.
>
> I'm pretty sure I've got the config script down right, but upon reboot,
> I no longer have a keyboard.
>
> I checked to see if this had crept up between 2.6.12.3 and 2.6.13.1. It
> seems that >2.6.13 are the versions that do this.
>
> Attached are dmesgs from my 2.6.13.1 and 2.6.12.3 kernels. In the
> 2.6.13.1 kernel I noticed this line.
>
> i8042.c: Can't read CTR while initializing i8042
>

The kernel failed to talk to your keyboard controller. Try booting with
"usb-handoff" and also try "acpi=off"

--
Dmitry

2005-09-16 05:22:35

by Tim Rupp

[permalink] [raw]
Subject: Re: Lost keyboard on Inspiron 8200 at 2.6.13

Dmitry Torokhov wrote:
> On Thursday 15 September 2005 23:29, Tim Rupp wrote:
>
>>I just recently went to upgrade to 2.6.13 from 2.6.12.3 and after
>>re-compiling with a clean .config, I've hit a snag.
>>
>>I'm pretty sure I've got the config script down right, but upon reboot,
>>I no longer have a keyboard.
>>
>>I checked to see if this had crept up between 2.6.12.3 and 2.6.13.1. It
>>seems that >2.6.13 are the versions that do this.
>>
>>Attached are dmesgs from my 2.6.13.1 and 2.6.12.3 kernels. In the
>>2.6.13.1 kernel I noticed this line.
>>
>> i8042.c: Can't read CTR while initializing i8042
>>
>
>
> The kernel failed to talk to your keyboard controller. Try booting with
> "usb-handoff" and also try "acpi=off"
>

Excellent, either argument gets me my keyboard back, thanks a ton Dmitry!

Tim

2005-09-16 09:54:34

by Andrew Morton

[permalink] [raw]
Subject: Re: Lost keyboard on Inspiron 8200 at 2.6.13

Dmitry Torokhov <[email protected]> wrote:
>
> On Thursday 15 September 2005 23:29, Tim Rupp wrote:
> > I just recently went to upgrade to 2.6.13 from 2.6.12.3 and after
> > re-compiling with a clean .config, I've hit a snag.
> >
> > I'm pretty sure I've got the config script down right, but upon reboot,
> > I no longer have a keyboard.
> >
> > I checked to see if this had crept up between 2.6.12.3 and 2.6.13.1. It
> > seems that >2.6.13 are the versions that do this.
> >
> > Attached are dmesgs from my 2.6.13.1 and 2.6.12.3 kernels. In the
> > 2.6.13.1 kernel I noticed this line.
> >
> > i8042.c: Can't read CTR while initializing i8042
> >
>
> The kernel failed to talk to your keyboard controller. Try booting with
> "usb-handoff" and also try "acpi=off"
>

This is of course not an acceptable solution. A machine which worked
without funky commandline parameters should continue to work in later
kernels.

How come it broke?

2005-09-16 15:25:17

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: Lost keyboard on Inspiron 8200 at 2.6.13

On 9/16/05, Andrew Morton <[email protected]> wrote:
> Dmitry Torokhov <[email protected]> wrote:
> >
> > On Thursday 15 September 2005 23:29, Tim Rupp wrote:
> > > I just recently went to upgrade to 2.6.13 from 2.6.12.3 and after
> > > re-compiling with a clean .config, I've hit a snag.
> > >
> > > I'm pretty sure I've got the config script down right, but upon reboot,
> > > I no longer have a keyboard.
> > >
> > > I checked to see if this had crept up between 2.6.12.3 and 2.6.13.1. It
> > > seems that >2.6.13 are the versions that do this.
> > >
> > > Attached are dmesgs from my 2.6.13.1 and 2.6.12.3 kernels. In the
> > > 2.6.13.1 kernel I noticed this line.
> > >
> > > i8042.c: Can't read CTR while initializing i8042
> > >
> >
> > The kernel failed to talk to your keyboard controller. Try booting with
> > "usb-handoff" and also try "acpi=off"
> >
>
> This is of course not an acceptable solution. A machine which worked
> without funky commandline parameters should continue to work in later
> kernels.
>
> How come it broke?
>

Interdependencies between ACPI, PNP, USB Legacy emulation and I8042 is
very delicate and quite often changes in ACPI/PNP break that balance.
USB legacy emulation is just evil. We need to have "usb-handoff" thing
enabled by default, it fixes alot of problems.

--
Dmitry

2005-09-16 15:35:21

by Alan

[permalink] [raw]
Subject: Re: Lost keyboard on Inspiron 8200 at 2.6.13

On Gwe, 2005-09-16 at 10:25 -0500, Dmitry Torokhov wrote:
> Interdependencies between ACPI, PNP, USB Legacy emulation and I8042 is
> very delicate and quite often changes in ACPI/PNP break that balance.
> USB legacy emulation is just evil. We need to have "usb-handoff" thing
> enabled by default, it fixes alot of problems.

I would definitely agree with this. There are very few, if any, cases
usb handoff doesn't work now that the Nvidia problems are fixed.


2005-09-16 18:45:07

by Greg KH

[permalink] [raw]
Subject: Re: Lost keyboard on Inspiron 8200 at 2.6.13

On Fri, Sep 16, 2005 at 05:00:49PM +0100, Alan Cox wrote:
> On Gwe, 2005-09-16 at 10:25 -0500, Dmitry Torokhov wrote:
> > Interdependencies between ACPI, PNP, USB Legacy emulation and I8042 is
> > very delicate and quite often changes in ACPI/PNP break that balance.
> > USB legacy emulation is just evil. We need to have "usb-handoff" thing
> > enabled by default, it fixes alot of problems.
>
> I would definitely agree with this. There are very few, if any, cases
> usb handoff doesn't work now that the Nvidia problems are fixed.

Are we sure? Yeah, SuSE has shipped that code "enabled" for a while,
but I'm still not comfortable making that the default.

Only if we merge the code that does the handoff, with the same code that
does it in the usb core, would I feel more comfortable to enable this
always. I had a patch from David Brownell to do this, but it had some
link errors at times, so I had to drop it :(

thanks,

greg k-h

2005-09-16 19:00:42

by Alan Stern

[permalink] [raw]
Subject: Re: [linux-usb-devel] Re: Lost keyboard on Inspiron 8200 at 2.6.13

On Fri, 16 Sep 2005, Greg KH wrote:

> On Fri, Sep 16, 2005 at 05:00:49PM +0100, Alan Cox wrote:
> > On Gwe, 2005-09-16 at 10:25 -0500, Dmitry Torokhov wrote:
> > > Interdependencies between ACPI, PNP, USB Legacy emulation and I8042 is
> > > very delicate and quite often changes in ACPI/PNP break that balance.
> > > USB legacy emulation is just evil. We need to have "usb-handoff" thing
> > > enabled by default, it fixes alot of problems.
> >
> > I would definitely agree with this. There are very few, if any, cases
> > usb handoff doesn't work now that the Nvidia problems are fixed.
>
> Are we sure? Yeah, SuSE has shipped that code "enabled" for a while,
> but I'm still not comfortable making that the default.
>
> Only if we merge the code that does the handoff, with the same code that
> does it in the usb core, would I feel more comfortable to enable this
> always. I had a patch from David Brownell to do this, but it had some
> link errors at times, so I had to drop it :(

Merging the code would be a good thing. As it stands right now, bad
interactions between the PCI handoff code and uhci-hcd will prevent UHCI
controllers from retaining state across a suspend-to-disk.

Alan Stern

2005-09-16 19:45:33

by David Brownell

[permalink] [raw]
Subject: Re: Lost keyboard on Inspiron 8200 at 2.6.13

> > > Interdependencies between ACPI, PNP, USB Legacy emulation and I8042 is
> > > very delicate and quite often changes in ACPI/PNP break that balance.
> > > USB legacy emulation is just evil. We need to have "usb-handoff" thing
> > > enabled by default, it fixes alot of problems.
> >
> > I would definitely agree with this. There are very few, if any, cases
> > usb handoff doesn't work now that the Nvidia problems are fixed.
>
> Are we sure? Yeah, SuSE has shipped that code "enabled" for a while,
> but I'm still not comfortable making that the default.

I tend to believe it's the right direction, but also concur with what
Greg writes below. Which suggests _maybe_ the default could change in
the 2.6.15 release, and meanwhile folk booting with USB keyboards and
mice will just have to use the commandline parameter.


> Only if we merge the code that does the handoff, with the same code that
> does it in the usb core, would I feel more comfortable to enable this
> always. I had a patch from David Brownell to do this, but it had some
> link errors at times, so I had to drop it :(

And for reference, here's that patch. I have no clue why anyone had
link problems associated with _this_ patch, since all systems I have
work just fine with it. I thought it was something else in the MM
tree that was making problems.

/Dave



This moves the PCI quirk handling for USB host controllers from the
PCI directory to the USB directory. Follow-on patches will need to:

(a) merge these copies with the originals in the HCD reset methods.
they don't wholly agree, despite doing the very same thing; and

(b) eventually change it so "usb-handoff" is the default, to help
get more robust USB/BIOS/input/... interactions.

Signed-off-by: David Brownell <[email protected]>

--- g26.orig/drivers/Makefile 2005-09-09 22:50:03.000000000 -0700
+++ g26/drivers/Makefile 2005-09-10 01:06:27.000000000 -0700
@@ -5,7 +5,7 @@
# Rewritten to use lists instead of if-statements.
#

-obj-$(CONFIG_PCI) += pci/
+obj-$(CONFIG_PCI) += pci/ usb/host/
obj-$(CONFIG_PARISC) += parisc/
obj-y += video/
obj-$(CONFIG_ACPI) += acpi/
--- g26.orig/drivers/usb/Makefile 2005-09-09 22:31:55.000000000 -0700
+++ g26/drivers/usb/Makefile 2005-09-10 01:06:27.000000000 -0700
@@ -8,6 +8,7 @@ obj-$(CONFIG_USB) += core/

obj-$(CONFIG_USB_MON) += mon/

+obj-$(CONFIG_PCI) += host/
obj-$(CONFIG_USB_EHCI_HCD) += host/
obj-$(CONFIG_USB_ISP116X_HCD) += host/
obj-$(CONFIG_USB_OHCI_HCD) += host/
--- g26.orig/drivers/usb/host/Makefile 2005-09-09 22:31:55.000000000 -0700
+++ g26/drivers/usb/host/Makefile 2005-09-10 01:06:27.000000000 -0700
@@ -1,8 +1,9 @@
#
-# Makefile for USB Host Controller Driver
-# framework and drivers
+# Makefile for USB Host Controller Drivers
#

+obj-$(CONFIG_PCI) += pci-quirks.o
+
obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o
obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ g26/drivers/usb/host/pci-quirks.c 2005-09-10 01:06:27.000000000 -0700
@@ -0,0 +1,272 @@
+/*
+ * This file contains code to reset and initialize USB host controllers.
+ * Some of it includes work-arounds for PCI hardware and BIOS quirks.
+ * It may need to run early during booting -- before USB would normally
+ * initialize -- to ensure that Linux doesn't use any legacy modes.
+ *
+ * Copyright (c) 1999 Martin Mares <[email protected]>
+ * (and others)
+ */
+
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/acpi.h>
+
+
+/*
+ * PIIX3 USB: We have to disable USB interrupts that are
+ * hardwired to PIRQD# and may be shared with an
+ * external device.
+ *
+ * Legacy Support Register (LEGSUP):
+ * bit13: USB PIRQ Enable (USBPIRQDEN),
+ * bit4: Trap/SMI On IRQ Enable (USBSMIEN).
+ *
+ * We mask out all r/wc bits, too.
+ */
+static void __devinit quirk_piix3_usb(struct pci_dev *dev)
+{
+ u16 legsup;
+
+ pci_read_config_word(dev, 0xc0, &legsup);
+ legsup &= 0x50ef;
+ pci_write_config_word(dev, 0xc0, legsup);
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_2, quirk_piix3_usb );
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_2, quirk_piix3_usb );
+
+
+/* FIXME these should be the guts of hcd->reset() methods; resolve all
+ * the differences between this version and the HCD's version.
+ */
+
+#define UHCI_USBLEGSUP 0xc0 /* legacy support */
+#define UHCI_USBCMD 0 /* command register */
+#define UHCI_USBSTS 2 /* status register */
+#define UHCI_USBINTR 4 /* interrupt register */
+#define UHCI_USBLEGSUP_DEFAULT 0x2000 /* only PIRQ enable set */
+#define UHCI_USBCMD_RUN (1 << 0) /* RUN/STOP bit */
+#define UHCI_USBCMD_GRESET (1 << 2) /* Global reset */
+#define UHCI_USBCMD_CONFIGURE (1 << 6) /* config semaphore */
+#define UHCI_USBSTS_HALTED (1 << 5) /* HCHalted bit */
+
+#define OHCI_CONTROL 0x04
+#define OHCI_CMDSTATUS 0x08
+#define OHCI_INTRSTATUS 0x0c
+#define OHCI_INTRENABLE 0x10
+#define OHCI_INTRDISABLE 0x14
+#define OHCI_OCR (1 << 3) /* ownership change request */
+#define OHCI_CTRL_IR (1 << 8) /* interrupt routing */
+#define OHCI_INTR_OC (1 << 30) /* ownership change */
+
+#define EHCI_HCC_PARAMS 0x08 /* extended capabilities */
+#define EHCI_USBCMD 0 /* command register */
+#define EHCI_USBCMD_RUN (1 << 0) /* RUN/STOP bit */
+#define EHCI_USBSTS 4 /* status register */
+#define EHCI_USBSTS_HALTED (1 << 12) /* HCHalted bit */
+#define EHCI_USBINTR 8 /* interrupt register */
+#define EHCI_USBLEGSUP 0 /* legacy support register */
+#define EHCI_USBLEGSUP_BIOS (1 << 16) /* BIOS semaphore */
+#define EHCI_USBLEGSUP_OS (1 << 24) /* OS semaphore */
+#define EHCI_USBLEGCTLSTS 4 /* legacy control/status */
+#define EHCI_USBLEGCTLSTS_SOOE (1 << 13) /* SMI on ownership change */
+
+int usb_early_handoff __devinitdata = 0;
+static int __init usb_handoff_early(char *str)
+{
+ usb_early_handoff = 1;
+ return 0;
+}
+__setup("usb-handoff", usb_handoff_early);
+
+static void __devinit quirk_usb_handoff_uhci(struct pci_dev *pdev)
+{
+ unsigned long base = 0;
+ int wait_time, delta;
+ u16 val, sts;
+ int i;
+
+ for (i = 0; i < PCI_ROM_RESOURCE; i++)
+ if ((pci_resource_flags(pdev, i) & IORESOURCE_IO)) {
+ base = pci_resource_start(pdev, i);
+ break;
+ }
+
+ if (!base)
+ return;
+
+ /*
+ * stop controller
+ */
+ sts = inw(base + UHCI_USBSTS);
+ val = inw(base + UHCI_USBCMD);
+ val &= ~(u16)(UHCI_USBCMD_RUN | UHCI_USBCMD_CONFIGURE);
+ outw(val, base + UHCI_USBCMD);
+
+ /*
+ * wait while it stops if it was running
+ */
+ if ((sts & UHCI_USBSTS_HALTED) == 0)
+ {
+ wait_time = 1000;
+ delta = 100;
+
+ do {
+ outw(0x1f, base + UHCI_USBSTS);
+ udelay(delta);
+ wait_time -= delta;
+ val = inw(base + UHCI_USBSTS);
+ if (val & UHCI_USBSTS_HALTED)
+ break;
+ } while (wait_time > 0);
+ }
+
+ /*
+ * disable interrupts & legacy support
+ */
+ outw(0, base + UHCI_USBINTR);
+ outw(0x1f, base + UHCI_USBSTS);
+ pci_read_config_word(pdev, UHCI_USBLEGSUP, &val);
+ if (val & 0xbf)
+ pci_write_config_word(pdev, UHCI_USBLEGSUP, UHCI_USBLEGSUP_DEFAULT);
+
+}
+
+static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
+{
+ void __iomem *base;
+ int wait_time;
+
+ base = ioremap_nocache(pci_resource_start(pdev, 0),
+ pci_resource_len(pdev, 0));
+ if (base == NULL) return;
+
+ if (readl(base + OHCI_CONTROL) & OHCI_CTRL_IR) {
+ wait_time = 500; /* 0.5 seconds */
+ writel(OHCI_INTR_OC, base + OHCI_INTRENABLE);
+ writel(OHCI_OCR, base + OHCI_CMDSTATUS);
+ while (wait_time > 0 &&
+ readl(base + OHCI_CONTROL) & OHCI_CTRL_IR) {
+ wait_time -= 10;
+ msleep(10);
+ }
+ }
+
+ /*
+ * disable interrupts
+ */
+ writel(~(u32)0, base + OHCI_INTRDISABLE);
+ writel(~(u32)0, base + OHCI_INTRSTATUS);
+
+ iounmap(base);
+}
+
+static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
+{
+ int wait_time, delta;
+ void __iomem *base, *op_reg_base;
+ u32 hcc_params, val, temp;
+ u8 cap_length;
+
+ base = ioremap_nocache(pci_resource_start(pdev, 0),
+ pci_resource_len(pdev, 0));
+ if (base == NULL) return;
+
+ cap_length = readb(base);
+ op_reg_base = base + cap_length;
+ hcc_params = readl(base + EHCI_HCC_PARAMS);
+ hcc_params = (hcc_params >> 8) & 0xff;
+ if (hcc_params) {
+ pci_read_config_dword(pdev,
+ hcc_params + EHCI_USBLEGSUP,
+ &val);
+ if (((val & 0xff) == 1) && (val & EHCI_USBLEGSUP_BIOS)) {
+ /*
+ * Ok, BIOS is in smm mode, try to hand off...
+ */
+ pci_read_config_dword(pdev,
+ hcc_params + EHCI_USBLEGCTLSTS,
+ &temp);
+ pci_write_config_dword(pdev,
+ hcc_params + EHCI_USBLEGCTLSTS,
+ temp | EHCI_USBLEGCTLSTS_SOOE);
+ val |= EHCI_USBLEGSUP_OS;
+ pci_write_config_dword(pdev,
+ hcc_params + EHCI_USBLEGSUP,
+ val);
+
+ wait_time = 500;
+ do {
+ msleep(10);
+ wait_time -= 10;
+ pci_read_config_dword(pdev,
+ hcc_params + EHCI_USBLEGSUP,
+ &val);
+ } while (wait_time && (val & EHCI_USBLEGSUP_BIOS));
+ if (!wait_time) {
+ /*
+ * well, possibly buggy BIOS...
+ */
+ printk(KERN_WARNING "EHCI early BIOS handoff "
+ "failed (BIOS bug ?)\n");
+ pci_write_config_dword(pdev,
+ hcc_params + EHCI_USBLEGSUP,
+ EHCI_USBLEGSUP_OS);
+ pci_write_config_dword(pdev,
+ hcc_params + EHCI_USBLEGCTLSTS,
+ 0);
+ }
+ }
+ }
+
+ /*
+ * halt EHCI & disable its interrupts in any case
+ */
+ val = readl(op_reg_base + EHCI_USBSTS);
+ if ((val & EHCI_USBSTS_HALTED) == 0) {
+ val = readl(op_reg_base + EHCI_USBCMD);
+ val &= ~EHCI_USBCMD_RUN;
+ writel(val, op_reg_base + EHCI_USBCMD);
+
+ wait_time = 2000;
+ delta = 100;
+ do {
+ writel(0x3f, op_reg_base + EHCI_USBSTS);
+ udelay(delta);
+ wait_time -= delta;
+ val = readl(op_reg_base + EHCI_USBSTS);
+ if ((val == ~(u32)0) || (val & EHCI_USBSTS_HALTED)) {
+ break;
+ }
+ } while (wait_time > 0);
+ }
+ writel(0, op_reg_base + EHCI_USBINTR);
+ writel(0x3f, op_reg_base + EHCI_USBSTS);
+
+ iounmap(base);
+
+ return;
+}
+
+
+
+static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev)
+{
+ if (!usb_early_handoff)
+ return;
+
+ if (pdev->class == ((PCI_CLASS_SERIAL_USB << 8) | 0x00)) { /* UHCI */
+ quirk_usb_handoff_uhci(pdev);
+ } else if (pdev->class == ((PCI_CLASS_SERIAL_USB << 8) | 0x10)) { /* OHCI */
+ quirk_usb_handoff_ohci(pdev);
+ } else if (pdev->class == ((PCI_CLASS_SERIAL_USB << 8) | 0x20)) { /* EHCI */
+ quirk_usb_disable_ehci(pdev);
+ }
+
+ return;
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, quirk_usb_early_handoff);
--- g26.orig/drivers/pci/quirks.c 2005-09-09 22:50:09.000000000 -0700
+++ g26/drivers/pci/quirks.c 2005-09-10 01:06:27.000000000 -0700
@@ -7,6 +7,9 @@
*
* Copyright (c) 1999 Martin Mares <[email protected]>
*
+ * Init/reset quirks for USB host controllers should be in the
+ * USB quirks file, where their drivers can access reuse it.
+ *
* The bridge optimization stuff has been removed. If you really
* have a silly BIOS which is unable to set your host bridge right,
* use the PowerTweak utility (see http://powertweak.sourceforge.net).
@@ -558,28 +561,6 @@ static void quirk_via_irq(struct pci_dev
DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_irq);

/*
- * PIIX3 USB: We have to disable USB interrupts that are
- * hardwired to PIRQD# and may be shared with an
- * external device.
- *
- * Legacy Support Register (LEGSUP):
- * bit13: USB PIRQ Enable (USBPIRQDEN),
- * bit4: Trap/SMI On IRQ Enable (USBSMIEN).
- *
- * We mask out all r/wc bits, too.
- */
-static void __devinit quirk_piix3_usb(struct pci_dev *dev)
-{
- u16 legsup;
-
- pci_read_config_word(dev, 0xc0, &legsup);
- legsup &= 0x50ef;
- pci_write_config_word(dev, 0xc0, legsup);
-}
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_2, quirk_piix3_usb );
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_2, quirk_piix3_usb );
-
-/*
* VIA VT82C598 has its device ID settable and many BIOSes
* set it to the ID of VT82C597 for backward compatibility.
* We need to switch it off to be able to recognize the real
@@ -927,234 +908,6 @@ static void __init quirk_sis_96x_smbus(s
pci_read_config_byte(dev, 0x77, &val);
}

-
-#define UHCI_USBLEGSUP 0xc0 /* legacy support */
-#define UHCI_USBCMD 0 /* command register */
-#define UHCI_USBSTS 2 /* status register */
-#define UHCI_USBINTR 4 /* interrupt register */
-#define UHCI_USBLEGSUP_DEFAULT 0x2000 /* only PIRQ enable set */
-#define UHCI_USBCMD_RUN (1 << 0) /* RUN/STOP bit */
-#define UHCI_USBCMD_GRESET (1 << 2) /* Global reset */
-#define UHCI_USBCMD_CONFIGURE (1 << 6) /* config semaphore */
-#define UHCI_USBSTS_HALTED (1 << 5) /* HCHalted bit */
-
-#define OHCI_CONTROL 0x04
-#define OHCI_CMDSTATUS 0x08
-#define OHCI_INTRSTATUS 0x0c
-#define OHCI_INTRENABLE 0x10
-#define OHCI_INTRDISABLE 0x14
-#define OHCI_OCR (1 << 3) /* ownership change request */
-#define OHCI_CTRL_IR (1 << 8) /* interrupt routing */
-#define OHCI_INTR_OC (1 << 30) /* ownership change */
-
-#define EHCI_HCC_PARAMS 0x08 /* extended capabilities */
-#define EHCI_USBCMD 0 /* command register */
-#define EHCI_USBCMD_RUN (1 << 0) /* RUN/STOP bit */
-#define EHCI_USBSTS 4 /* status register */
-#define EHCI_USBSTS_HALTED (1 << 12) /* HCHalted bit */
-#define EHCI_USBINTR 8 /* interrupt register */
-#define EHCI_USBLEGSUP 0 /* legacy support register */
-#define EHCI_USBLEGSUP_BIOS (1 << 16) /* BIOS semaphore */
-#define EHCI_USBLEGSUP_OS (1 << 24) /* OS semaphore */
-#define EHCI_USBLEGCTLSTS 4 /* legacy control/status */
-#define EHCI_USBLEGCTLSTS_SOOE (1 << 13) /* SMI on ownership change */
-
-int usb_early_handoff __devinitdata = 0;
-static int __init usb_handoff_early(char *str)
-{
- usb_early_handoff = 1;
- return 0;
-}
-__setup("usb-handoff", usb_handoff_early);
-
-static void __devinit quirk_usb_handoff_uhci(struct pci_dev *pdev)
-{
- unsigned long base = 0;
- int wait_time, delta;
- u16 val, sts;
- int i;
-
- for (i = 0; i < PCI_ROM_RESOURCE; i++)
- if ((pci_resource_flags(pdev, i) & IORESOURCE_IO)) {
- base = pci_resource_start(pdev, i);
- break;
- }
-
- if (!base)
- return;
-
- /*
- * stop controller
- */
- sts = inw(base + UHCI_USBSTS);
- val = inw(base + UHCI_USBCMD);
- val &= ~(u16)(UHCI_USBCMD_RUN | UHCI_USBCMD_CONFIGURE);
- outw(val, base + UHCI_USBCMD);
-
- /*
- * wait while it stops if it was running
- */
- if ((sts & UHCI_USBSTS_HALTED) == 0)
- {
- wait_time = 1000;
- delta = 100;
-
- do {
- outw(0x1f, base + UHCI_USBSTS);
- udelay(delta);
- wait_time -= delta;
- val = inw(base + UHCI_USBSTS);
- if (val & UHCI_USBSTS_HALTED)
- break;
- } while (wait_time > 0);
- }
-
- /*
- * disable interrupts & legacy support
- */
- outw(0, base + UHCI_USBINTR);
- outw(0x1f, base + UHCI_USBSTS);
- pci_read_config_word(pdev, UHCI_USBLEGSUP, &val);
- if (val & 0xbf)
- pci_write_config_word(pdev, UHCI_USBLEGSUP, UHCI_USBLEGSUP_DEFAULT);
-
-}
-
-static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
-{
- void __iomem *base;
- int wait_time;
-
- base = ioremap_nocache(pci_resource_start(pdev, 0),
- pci_resource_len(pdev, 0));
- if (base == NULL) return;
-
- if (readl(base + OHCI_CONTROL) & OHCI_CTRL_IR) {
- wait_time = 500; /* 0.5 seconds */
- writel(OHCI_INTR_OC, base + OHCI_INTRENABLE);
- writel(OHCI_OCR, base + OHCI_CMDSTATUS);
- while (wait_time > 0 &&
- readl(base + OHCI_CONTROL) & OHCI_CTRL_IR) {
- wait_time -= 10;
- msleep(10);
- }
- }
-
- /*
- * disable interrupts
- */
- writel(~(u32)0, base + OHCI_INTRDISABLE);
- writel(~(u32)0, base + OHCI_INTRSTATUS);
-
- iounmap(base);
-}
-
-static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
-{
- int wait_time, delta;
- void __iomem *base, *op_reg_base;
- u32 hcc_params, val, temp;
- u8 cap_length;
-
- base = ioremap_nocache(pci_resource_start(pdev, 0),
- pci_resource_len(pdev, 0));
- if (base == NULL) return;
-
- cap_length = readb(base);
- op_reg_base = base + cap_length;
- hcc_params = readl(base + EHCI_HCC_PARAMS);
- hcc_params = (hcc_params >> 8) & 0xff;
- if (hcc_params) {
- pci_read_config_dword(pdev,
- hcc_params + EHCI_USBLEGSUP,
- &val);
- if (((val & 0xff) == 1) && (val & EHCI_USBLEGSUP_BIOS)) {
- /*
- * Ok, BIOS is in smm mode, try to hand off...
- */
- pci_read_config_dword(pdev,
- hcc_params + EHCI_USBLEGCTLSTS,
- &temp);
- pci_write_config_dword(pdev,
- hcc_params + EHCI_USBLEGCTLSTS,
- temp | EHCI_USBLEGCTLSTS_SOOE);
- val |= EHCI_USBLEGSUP_OS;
- pci_write_config_dword(pdev,
- hcc_params + EHCI_USBLEGSUP,
- val);
-
- wait_time = 500;
- do {
- msleep(10);
- wait_time -= 10;
- pci_read_config_dword(pdev,
- hcc_params + EHCI_USBLEGSUP,
- &val);
- } while (wait_time && (val & EHCI_USBLEGSUP_BIOS));
- if (!wait_time) {
- /*
- * well, possibly buggy BIOS...
- */
- printk(KERN_WARNING "EHCI early BIOS handoff "
- "failed (BIOS bug ?)\n");
- pci_write_config_dword(pdev,
- hcc_params + EHCI_USBLEGSUP,
- EHCI_USBLEGSUP_OS);
- pci_write_config_dword(pdev,
- hcc_params + EHCI_USBLEGCTLSTS,
- 0);
- }
- }
- }
-
- /*
- * halt EHCI & disable its interrupts in any case
- */
- val = readl(op_reg_base + EHCI_USBSTS);
- if ((val & EHCI_USBSTS_HALTED) == 0) {
- val = readl(op_reg_base + EHCI_USBCMD);
- val &= ~EHCI_USBCMD_RUN;
- writel(val, op_reg_base + EHCI_USBCMD);
-
- wait_time = 2000;
- delta = 100;
- do {
- writel(0x3f, op_reg_base + EHCI_USBSTS);
- udelay(delta);
- wait_time -= delta;
- val = readl(op_reg_base + EHCI_USBSTS);
- if ((val == ~(u32)0) || (val & EHCI_USBSTS_HALTED)) {
- break;
- }
- } while (wait_time > 0);
- }
- writel(0, op_reg_base + EHCI_USBINTR);
- writel(0x3f, op_reg_base + EHCI_USBSTS);
-
- iounmap(base);
-
- return;
-}
-
-
-
-static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev)
-{
- if (!usb_early_handoff)
- return;
-
- if (pdev->class == ((PCI_CLASS_SERIAL_USB << 8) | 0x00)) { /* UHCI */
- quirk_usb_handoff_uhci(pdev);
- } else if (pdev->class == ((PCI_CLASS_SERIAL_USB << 8) | 0x10)) { /* OHCI */
- quirk_usb_handoff_ohci(pdev);
- } else if (pdev->class == ((PCI_CLASS_SERIAL_USB << 8) | 0x20)) { /* EHCI */
- quirk_usb_disable_ehci(pdev);
- }
-
- return;
-}
-DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, quirk_usb_early_handoff);
-
/*
* ... This is further complicated by the fact that some SiS96x south
* bridges pretend to be 85C503/5513 instead. In that case see if we

2005-09-16 22:24:59

by Pete Zaitcev

[permalink] [raw]
Subject: Re: [linux-usb-devel] Re: Lost keyboard on Inspiron 8200 at 2.6.13

On Fri, 16 Sep 2005 11:44:40 -0700, Greg KH <[email protected]> wrote:
> On Fri, Sep 16, 2005 at 05:00:49PM +0100, Alan Cox wrote:
> > On Gwe, 2005-09-16 at 10:25 -0500, Dmitry Torokhov wrote:

> Only if we merge the code that does the handoff, with the same code that
> does it in the usb core, would I feel more comfortable to enable this
> always. I had a patch from David Brownell to do this, but it had some
> link errors at times, so I had to drop it :(

I see why you would want to merge them, but is it worth the trouble?
They are not identical. For one thing, early handoff installs its own
fake interrupt handlers (Alan Cox insisted on it in the RHEL
implementation).

I'd like to see handoff done by default, too. If you make it predicated
on the merge, so be it.

-- Pete

2005-09-16 22:38:55

by Greg KH

[permalink] [raw]
Subject: Re: [linux-usb-devel] Re: Lost keyboard on Inspiron 8200 at 2.6.13

On Fri, Sep 16, 2005 at 03:24:32PM -0700, Pete Zaitcev wrote:
> On Fri, 16 Sep 2005 11:44:40 -0700, Greg KH <[email protected]> wrote:
> > On Fri, Sep 16, 2005 at 05:00:49PM +0100, Alan Cox wrote:
> > > On Gwe, 2005-09-16 at 10:25 -0500, Dmitry Torokhov wrote:
>
> > Only if we merge the code that does the handoff, with the same code that
> > does it in the usb core, would I feel more comfortable to enable this
> > always. I had a patch from David Brownell to do this, but it had some
> > link errors at times, so I had to drop it :(
>
> I see why you would want to merge them, but is it worth the trouble?

We've already divered from the original code, which was identical.
People forget to fix the other instance, when then change one of them.

> They are not identical. For one thing, early handoff installs its own
> fake interrupt handlers (Alan Cox insisted on it in the RHEL
> implementation).

The interrupt handlers aren't an issue. It's how the handoff happens at
a hardware level that is. I just want to make sure any changes made to
one place, make it to the other place.

thanks,

greg k-h

2005-09-16 23:29:57

by Alan

[permalink] [raw]
Subject: Re: [linux-usb-devel] Re: Lost keyboard on Inspiron 8200 at 2.6.13

On Gwe, 2005-09-16 at 15:24 -0700, Pete Zaitcev wrote:
> I see why you would want to merge them, but is it worth the trouble?
> They are not identical. For one thing, early handoff installs its own
> fake interrupt handlers (Alan Cox insisted on it in the RHEL
> implementation).

You need them because an IRQ could be pending on the channel at the
point you switch over or triggered on the switch and a few people saw
this behaviour.

I'd like to see it shared but that means handoff belongs in the input
layer code and the USB layer needs to call into it if appropriate.

2005-09-17 04:12:24

by Alan Stern

[permalink] [raw]
Subject: Re: [linux-usb-devel] Re: Lost keyboard on Inspiron 8200 at 2.6.13

On Sat, 17 Sep 2005, Alan Cox wrote:

> On Gwe, 2005-09-16 at 15:24 -0700, Pete Zaitcev wrote:
> > I see why you would want to merge them, but is it worth the trouble?
> > They are not identical. For one thing, early handoff installs its own
> > fake interrupt handlers (Alan Cox insisted on it in the RHEL
> > implementation).

Where does early handoff install a fake interrupt handler for UHCI? I
don't see any in drivers/pci/quirks.c.

> You need them because an IRQ could be pending on the channel at the
> point you switch over or triggered on the switch and a few people saw
> this behaviour.

Yes, that would be needed if you have edge-triggered interrupts. But
isn't PCI supposed to be level-triggered?

> I'd like to see it shared but that means handoff belongs in the input
> layer code and the USB layer needs to call into it if appropriate.

Why does it mean that? And why the input layer as opposed to the PCI
layer, where it is now?

Alan Stern

2005-09-17 07:43:08

by Alan

[permalink] [raw]
Subject: Re: [linux-usb-devel] Re: Lost keyboard on Inspiron 8200 at 2.6.13

On Sad, 2005-09-17 at 00:12 -0400, Alan Stern wrote:
> Where does early handoff install a fake interrupt handler for UHCI? I
> don't see any in drivers/pci/quirks.c.

Fedora patches for 2.6.9 rather than the current code.

> > You need them because an IRQ could be pending on the channel at the
> > point you switch over or triggered on the switch and a few people saw
> > this behaviour.
>
> Yes, that would be needed if you have edge-triggered interrupts. But
> isn't PCI supposed to be level-triggered?

Yes and at the time several people saw hangs on the changeover unless we
cleared pending IRQ bits in the IRQ handler. That may have been related
to various ACPI problems from back then. I don't know for sure.

> > I'd like to see it shared but that means handoff belongs in the input
> > layer code and the USB layer needs to call into it if appropriate.
>
> Why does it mean that? And why the input layer as opposed to the PCI
> layer, where it is now?

PCI layer makes even more sense yes