Opened 18 years ago

Closed 17 years ago

#834 closed bug (fixed)

Disconnecting USB mouse/keyboard problem

Reported by: marcusoverhagen Owned by: mmlr
Priority: normal Milestone: R1
Component: - General Version: R1/pre-alpha1
Keywords: Cc: diver
Blocked By: Blocking:
Platform: All

Description

When disconecting a USB mouse/keyboard (KVM switch):

usb_uhci: td (0x02b164a0) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02b16520) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02b164a0) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02b16520) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02b164a0) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02b16520) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02b164a0) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02b16520) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02b164a0) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02b16520) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02b164a0) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02b16520) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02b164a0) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02b16520) error: 0x254507ff
usb_hid: bus status 10 
[continues endless...]

After reconnection it (previous attempt, must have stopped, but beginning of log was lost):

usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02ab6520) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02ab64c0) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02ab6560) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02ab6520) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02ab64c0) error: 0x254507ff
usb_hid: bus status 10
usb_hid: clear_feature() error -2147483643
usb_uhci: td (0x02ab6560) error: 0x254507ff
usb_hid: bus status 10
vm_soft_fault: va 0xdeadbef3 not covered by area in address space
vm_page_fault: vm_soft_fault returned error -2147478783 on fault at 0xdeadbef3, ip 0x803bc88f, write 0, user 0, thread 0x57
PANIC: vm_page_fault: unhandled page fault in kernel space at 0xdeadbef3, ip 0x803bc88f

keyboard no longer working, no stack crawl possible.

Change History (10)

comment:1 by diver, 18 years ago

Cc: diver added

comment:2 by wkornewald, 18 years ago

Milestone: R1
Version: R1 development

comment:3 by marcusoverhagen, 18 years ago

Since hrev19738, the behaviour has changed, but the problem unfortunately stays. Switching to a different computer using the KVM switch makes haiku lose USB input.

When switching with the KVM switch to another computer, which basically should be similar to a disconnect, I get this:

usb_uhci: td (0x02b91760) error: status: 0x254507ff; token: 0x00608469; usb_hid: bus status -2147442668

or, at another time, this:

usb_uhci: td (0x02b23cc0) error: status: 0x254507ff; token: 0x00688469; usb_hid: bus status -2147442668

After switching back to haiku, both mouse and keyboard no longer work, but the cursor is still blinking. no further debug output.

When simply disconnecting the KVM, i get:

usb_uhci: td (0x02b22900) error: status: 0x254507ff; token: 0x00688469; si-3112 handle_interrupt Last message repeated 2 times. usb_hid: bus status -2147442668 si-3112 handle_interrupt Last message repeated 955 times. Pipe: cancelling transfers is not implemented! si-3112 handle_interrupt Last message repeated 2 times. Pipe: cancelling transfers is not implemented! si-3112 handle_interrupt Last message repeated 3 times. USB Hub Explore(): port 1 disabled si-3112 handle_interrupt Last message repeated 1436 times. USB Hub Explore(): port 1 disabled si-3112 handle_interrupt (continues, port 1 disabled printed about every 1/2 second)

comment:4 by mmlr, 18 years ago

As of hrev19860 the disconnect sequence has changed a bit. Can you please try it out again and see whether the repeated error messages stay? The "port x disabled" message has been fixed in hrev19861 by actually implementing the clear selector for the root hub.

Note however that input will not be reenabled after switching back / reconnecting as the necessary devfs rescan function is not yet implemented under Haiku.

comment:5 by mmlr, 18 years ago

Status: newassigned

comment:6 by korli, 18 years ago

Michael, it seems cancelling transfers should be implemented to avoid such panics. Do you know how the stack is supposed to track transfers (ie a map of lists (one list for each pipe) ?

comment:7 by mmlr, 17 years ago

Transfer canceling has been implemented by now. Also much of the connect/disconnect handling has been revised. Can this bug still be reproduced?

comment:8 by marcusoverhagen, 17 years ago

This bug can still be reproduced. I'll add serial debug output during the weekend.

comment:9 by marcusoverhagen, 17 years ago

When switching from Haiku to a different computer with the KVM switch, in Haiku this happens:

usb_uhci: td (0x0501bfa0) error: status: 0x254507ff; token: 0x00608469; usb_hid: bus status -2147442668 USB ControlPipe: timeout waiting for queued request to complete usb_hid: clear_feature() error -2147483639 usb_uhci: td (0x0501e180) error: status: 0x04450007; token: 0x00e0042d; usb_uhci: td (0x0501e220) error: status: 0x254507ff; token: 0x00608469; usb_hid: bus status -2147442668 USB ControlPipe: timeout waiting for queued request to complete USB ControlPipe: timeout waiting for queued request to complete USB Hub 2: error updating port status usb_hid: clear_feature() error -2147483639 usb_uhci: td (0x0501e2c0) error: status: 0x04450007; token: 0x00e0042d; usb_uhci: td (0x0501e360) error: status: 0x254507ff; token: 0x00608469; usb_hid: bus status -2147442668 USB ControlPipe: timeout waiting for queued request to complete USB ControlPipe: timeout waiting for queued request to complete usb_hid: clear_feature() error -2147483639 usb_uhci: td (0x0501e400) error: status: 0x04450007; token: 0x00e0042d; USB Hub 2: error updating port status usb_uhci: td (0x0501e440) error: status: 0x254507ff; token: 0x00608469; usb_hid: bus status -2147442668 USB ControlPipe: timeout waiting for queued request to complete usb_hid: clear_feature() error -2147483639 usb_uhci: td (0x0501e480) error: status: 0x04450007; token: 0x00e0042d; usb_uhci: td (0x0501e520) error: status: 0x254507ff; token: 0x00608469; usb_hid: bus status -2147442668 USB ControlPipe: timeout waiting for queued request to complete USB ControlPipe: timeout waiting for queued request to complete usb_hid: clear_feature() error -2147483639 USB Hub 2: error updating port status usb_uhci: td (0x0501e5c0) error: status: 0x04450007; token: 0x00e0042d; usb_uhci: td (0x0501e600) error: status: 0x254507ff; token: 0x00608469; usb_hid: bus status -2147442668 USB ControlPipe: timeout waiting for queued request to complete USB Hub 2: error updating port status USB ControlPipe: timeout waiting for queued request to complete usb_hid: clear_feature() error -2147483639 usb_uhci: td (0x0501e6a0) error: status: 0x04450007; token: 0x00e0042d; usb_uhci: td (0x0501e740) error: status: 0x254507ff; token: 0x00608469; usb_hid: bus status -2147442668 USB ControlPipe: timeout waiting for queued request to complete USB ControlPipe: timeout waiting for queued request to complete usb_hid: clear_feature() error -2147483639 CPU 0 halted! PANIC: free(): address 0x909e4160 already exists in bin free list

Welcome to Kernel Debugging Land... Running on CPU 1 kdebug>

comment:10 by mmlr, 17 years ago

Resolution: fixed
Status: assignedclosed

Should be fixed after the recent rework of usb_hid / devfs.

Note: See TracTickets for help on using tickets.