Opened 4 years ago

Closed 3 years ago

Last modified 22 months ago

#16969 closed bug (fixed)

USB stop working after disconnecting USB hub with keyboard and mouse (again)

Reported by: X512 Owned by: waddlesplash
Priority: normal Milestone: R1/beta4
Component: Drivers/USB/XHCI Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by X512)

This is hrev55104 x86_gcc2.

Problem described in #15561 is occuring again.

Syslog when disconnecting:

KERN: usb hub 2: port 3: device removed
KERN: usb xhci 0: cancel queued transfers (1) for pipe 0x82c72d08 (1)
KERN: usb xhci 0: transfer error on slot 5 endpoint 3: Stopped
USER 'KS': Notify of added/removed/started/stopped device
KERN: usb xhci 0: cancel queued transfers (0) for pipe 0x82c72d08 (1)
KERN: usb xhci 0: cancel queued transfers (0) for pipe 0x828218c0 (0)
KERN: usb xhci 0: cancel queued transfers (0) for pipe 0x82c72d08 (1)
KERN: usb xhci 0: cancel queued transfers (0) for pipe 0x82c72cd8 (2)
KERN: usb error xhci 0: unsuccessful command 15, error Context state (19)
KERN: usb xhci 0: cancel queued transfers (1) for pipe 0x82c72d98 (1)
KERN: usb xhci 0: transfer error on slot 4 endpoint 3: Stopped
USER 'KS': Notify of added/removed/started/stopped device
KERN: usb xhci 0: KERN: cancel queued transfers (0) for pipe 0x82c72d98 (1)
KERN: usb xhci 0: KERN: cancel queued transfers (0) for pipe 0x82821960 (0)
KERN: usb xhci 0: KERN: cancel queued transfers (0) for pipe 0x82c72d98 (1)
KERN: usb xhci 0: cancel queued transfers (1) for pipe 0x82c72d68 (2)
KERN: usb error xhci 0: unsuccessful command 15, error Context state (19)
KERN: usb error xhci 0: KERN: cancel queued transfers: could not stop endpoint: I/O error!
KERN: usb error xhci 0: unsuccessful command 15, error Context state (19)
KERN: usb xhci 0: cancel queued transfers (0) for pipe 0x82c72d38 (3)
KERN: usb error xhci 0: unsuccessful command 15, error Context state (19)
KERN: usb xhci 0: KERN: cancel queued transfers (1) for pipe 0x82bc15d0 (1)
KERN: usb xhci 0: transfer error on slot 1 endpoint 3: Stopped
KERN: usb xhci 0: cancel queued transfers (0) for pipe 0x82bc15d0 (1)
KERN: usb xhci 0: KERN: cancel queued transfers (0) for pipe 0x82c62240 (0)
KERN: usb error xhci 0: unsuccessful command 10, error Slot not enabled (11)

When connecting again:

KERN: usb hub 2: port 3: new device connected
KERN: usb error control pipe 72: KERN: timeout waiting for queued request to complete
KERN: usb xhci 0: KERN: cancel queued transfers (1) for pipe 0xdf1172c0 (0)
KERN: usb error xhci 0: cancel queued transfers: could not stop endpoint: Operation timed out!
KERN: usb error hub 71: KERN: error getting hub descriptor
KERN: usb error xhci 0: KERN: device object failed to initialize
KERN: usb error xhci 0: KERN: AllocateDevice() failed enable slot

KERN: usb hub 2: port 3: new device connected
KERN: usb error xhci 0: AllocateDevice() failed enable slot
Last message repeated 1 time

KERN: usb hub 2: KERN: port 3: new device connected
KERN: usb error xhci 0: AllocateDevice() failed enable slot
KERN: usb xhci 0: cancel queued transfers (1) for pipe 0x82c72df8 (2)
KERN: usb error xhci 0: AllocateDevice() failed enable slot
KERN: usb error xhci 0: cancel queued transfers: could not stop endpoint: Operation timed out!
KERN: usb_disk: acquire_sem failed while waiting for data transfer: Operation timed out

KERN: usb hub 2: port 3: new device connected
KERN: usb error xhci 0: AllocateDevice() failed enable slot
Last message repeated 1 time

KERN: usb hub 2: port 3: new device connected
KERN: usb error xhci 0: AllocateDevice() failed enable slot
Last message repeated 1 time

KERN: usb hub 2: port 3: new device connected
KERN: usb error xhci 0: KERN: AllocateDevice() failed enable slot
KERN: usb error xhci 0: AllocateDevice() failed enable slot

KERN: usb hub 2: port 3: new device connected
KERN: usb error xhci 0: AllocateDevice() failed enable slot
Last message repeated 1 time

KERN: usb hub 2: port 3: new device connected
KERN: usb error xhci 0: KERN: AllocateDevice() failed enable slot
KERN: usb error xhci 0: AllocateDevice() failed enable slot

KERN: usb hub 2: port 3: new device connected
KERN: usb error xhci 0: AllocateDevice() failed enable slot
Last message repeated 1 time

KERN: usb hub 2: port 3: new device connected
KERN: usb error xhci 0: AllocateDevice() failed enable slot
Last message repeated 1 time

KERN: usb hub 2: port 3: new device connected
KERN: usb error xhci 0: AllocateDevice() failed enable slot
Last message repeated 1 time

Same message sequence is continuously repeating.

Following message is repeated if only one device connected (mouse):

KERN: usb hub 2: port 3: new device connected
KERN: usb error xhci 0: AllocateDevice() failed enable slot
Last message repeated 1 time

Attachments (3)

hrev55427.jpg (196.8 KB ) - added by X512 3 years ago.
hrev55436.jpg (181.9 KB ) - added by X512 3 years ago.
syslog-4491 (265.8 KB ) - added by X512 3 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 by X512, 4 years ago

Not related to hrev55104, problems occured before it.

comment:2 by X512, 4 years ago

Description: modified (diff)

comment:3 by X512, 4 years ago

Description: modified (diff)

comment:4 by X512, 4 years ago

Maybe related: #14968.

comment:6 by X512, 3 years ago

Retested with clean hrev55427 x86_64. After disconnecting USB hub with keyboard and mouse, whole USB stack dies and USB boot disk unmounts.

Finally it show empty white KDL area at top of screen at shutdown.

by X512, 3 years ago

Attachment: hrev55427.jpg added

comment:7 by X512, 3 years ago

I tested hrev55436 and now it show empty white KDL area immediately after disconnecting USB hub.

comment:8 by X512, 3 years ago

After disabling usb_keyboard kernel addon it shows "USB object did not become unbusy!" KDL.

by X512, 3 years ago

Attachment: hrev55436.jpg added

comment:9 by waddlesplash, 3 years ago

Indeed it seems that transfer cancellation and release of the object might occur in the wrong order here. Not entirely sure how to rectify that, it will require some clever restructuring of the code.

comment:10 by waddlesplash, 3 years ago

With the changes merged in hrev55442, X512 reports:

<x512> waddlesplash: It seems works. USB survived one disconnecting and reconnecting of USB hub and devices on hub are still working on reconnection. Need some more testing.

comment:11 by X512, 3 years ago

Issue seems gone after applying https://review.haiku-os.org/c/haiku/+/4491. I did quick USB hub connecting/disconnecting multiple times and it is still functional as well devices connected to it, no KDLs.

Last edited 3 years ago by X512 (previous) (diff)

by X512, 3 years ago

Attachment: syslog-4491 added

comment:12 by waddlesplash, 3 years ago

Milestone: UnscheduledR1/beta4
Resolution: fixed
Status: newclosed

Superb!

comment:13 by spilldisc, 22 months ago

spam

Last edited 22 months ago by korli (previous) (diff)
Note: See TracTickets for help on using tickets.