Please disable USB autosuspend for Avocent SC Secure KVM

Bug #1371403 reported by Bryce Harrington
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Trusty
Confirmed
Medium
Unassigned
Utopic
Won't Fix
Medium
Unassigned

Bug Description

My mouse becomes temporarily become unresponsive to drags and clicks, until I right-click or give keyboard input, when it's been idle for a few seconds. The same thing affects the keyboard. In some cases the mouse cursor jumps back to the center of the screen.

The mouse and keyboard are connected to a number of different computers via an 8-port Avocent SC Secure KVM. When the mouse and/or keyboard are directly attached to one of the PCs, there is no problem. I've tested with different keyboards and mice as well, and they're similarly messed up.

Only the computers running Ubuntu 14.04 are affected. Two of the computers are identical hardware, differing only in Ubuntu versions - the 14.04 one is affected but the one with 13.04 is not. I also have a machine with 12.04 on it connected to the KVM which is fine.
I first noticed the problem when I upgraded to 13.10.

In powertop I notice that autosuspend is enabled for the Avocent. If I switch that off, then the problem disappears completely. I can also prevent it by issuing:

  echo 'on' > '/sys/bus/usb/devices/3-10/power/control';

where 3-10 is the Avocent (the number is different on each of my systems).

I notice in 42-usb-hid-pm.rules there is a rule for Avocent devices:

  # Catch-all for Avocent HID devices. Keyed off interface in order to only
  # trigger on HID class devices.
  ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0624", ATTR{bInterfaceClass}=="03", TEST=="../power/control", ATTR{../power/control}="auto"

However my KVM device doesn't appear to have a bInterfaceClass defined.

In any case, the following udev rule corrects the problem for me:

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0624", ATTR{idProduct}=="0013", ATTR{product}=="SC Secure KVM", TEST=="power/control", ATTR{power/control}:="on"

Revision history for this message
Bryce Harrington (bryce) wrote :

P: /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4
N: bus/usb/001/003
E: BUSNUM=001
E: DEVNAME=/dev/bus/usb/001/003
E: DEVNUM=003
E: DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4
E: DEVTYPE=usb_device
E: DRIVER=usb
E: ID_BUS=usb
E: ID_MODEL=SC_Secure_KVM
E: ID_MODEL_ENC=SC\x20Secure\x20KVM\x20\x20\x20\x20\x20\x20\x20
E: ID_MODEL_ID=0013
E: ID_REVISION=0001
E: ID_SERIAL=AVOCENT_SC_Secure_KVM
E: ID_USB_INTERFACES=:030101:030102:
E: ID_VENDOR=AVOCENT
E: ID_VENDOR_ENC=AVOCENT\x20\x20\x20\x20\x20\x20
E: ID_VENDOR_FROM_DATABASE=Avocent Corp.
E: ID_VENDOR_ID=0624
E: MAJOR=189
E: MINOR=2
E: PRODUCT=624/13/1
E: SUBSYSTEM=usb
E: TYPE=0/0/0
E: USEC_INITIALIZED=48336

Revision history for this message
Bryce Harrington (bryce) wrote :

  looking at device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4':
    KERNEL=="1-1.4"
    SUBSYSTEM=="usb"
    DRIVER=="usb"
    ATTR{bDeviceSubClass}=="00"
    ATTR{bDeviceProtocol}=="00"
    ATTR{devpath}=="1.4"
    ATTR{idVendor}=="0624"
    ATTR{speed}=="12"
    ATTR{bNumInterfaces}==" 2"
    ATTR{bConfigurationValue}=="1"
    ATTR{bMaxPacketSize0}=="8"
    ATTR{busnum}=="1"
    ATTR{devnum}=="3"
    ATTR{configuration}==""
    ATTR{bMaxPower}=="100mA"
    ATTR{authorized}=="1"
    ATTR{bmAttributes}=="a0"
    ATTR{bNumConfigurations}=="1"
    ATTR{maxchild}=="0"
    ATTR{bcdDevice}=="0001"
    ATTR{avoid_reset_quirk}=="0"
    ATTR{quirks}=="0x0"
    ATTR{version}==" 2.00"
    ATTR{urbnum}=="34"
    ATTR{ltm_capable}=="no"
    ATTR{manufacturer}=="AVOCENT "
    ATTR{removable}=="removable"
    ATTR{idProduct}=="0013"
    ATTR{bDeviceClass}=="00"
    ATTR{product}=="SC Secure KVM "

Revision history for this message
Bryce Harrington (bryce) wrote :

/dev/input/event2
   bustype : BUS_USB
   vendor : 0x624
   product : 0x13
   version : 273
   name : "AVOCENT SC Secure KVM "
   phys : "usb-0000:00:14.0-14/input0"
   uniq : ""
   bits ev : EV_SYN EV_KEY EV_MSC EV_LED EV_REP

Revision history for this message
Bryce Harrington (bryce) wrote :

Relevant dmesg bits:
[ 1.745637] usb 3-14: New USB device found, idVendor=0624, idProduct=0013
[ 1.745639] usb 3-14: New USB device strings: Mfr=4, Product=32, SerialNumber=0
[ 1.745640] usb 3-14: Product: SC Secure KVM
[ 1.745641] usb 3-14: Manufacturer: AVOCENT
[ 1.745755] usb 3-14: ep 0x84 - rounding interval to 32 microframes, ep desc says 56 microframes
[ 1.745758] usb 3-14: ep 0x87 - rounding interval to 32 microframes, ep desc says 56 microframes
[ 1.746783] input: AVOCENT SC Secure KVM as /devices/pci0000:00/0000:00:14.0/usb3/3-14/3-14:1.0/input/input5
[ 1.746902] hid-generic 0003:0624:0013.0002: input,hidraw1: USB HID v1.11 Keyboard [AVOCENT SC Secure KVM ] on u\
sb-0000:00:14.0-14/input0
[ 1.747452] input: AVOCENT SC Secure KVM as /devices/pci0000:00/0000:00:14.0/usb3/3-14/3-14:1.1/input/input6
[ 1.747542] hid-generic 0003:0624:0013.0003: input,hidraw2: USB HID v1.11 Mouse [AVOCENT SC Secure KVM ] on usb-\
0000:00:14.0-14/input1

[ 4.031723] input: Eee PC WMI hotkeys as /devices/platform/eeepc-wmi/input/input12

Revision history for this message
Bryce Harrington (bryce) wrote :

When toggling the KVM:

[57110.209361] usb 3-1: new low-speed USB device number 5 using xhci_hcd
[57110.229267] usb 3-1: New USB device found, idVendor=046d,
idProduct=c05a
[57110.229276] usb 3-1: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[57110.229281] usb 3-1: Product: USB Optical Mouse
[57110.229285] usb 3-1: Manufacturer: Logitech
[57110.229558] usb 3-1: ep 0x81 - rounding interval to 64 microframes,
ep desc says 80 microframes
[57110.231929] input: Logitech USB Optical Mouse as
/devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/input/input17
[57110.232433] hid-generic 0003:046D:C05A.0004: input,hidraw3: USB HID
v1.11 Mouse [Logitech USB Optical Mouse] on usb-0000:00:14.0-1/input0
[58664.365776] usb 3-1: USB disconnect, device number 5
[66928.265348] perf samples too long (2522 > 2500), lowering
kernel.perf_event_max_sample_rate to 50000
[108370.384980] usb 3-14: USB disconnect, device number 4
[108380.472131] usb 3-14: new full-speed USB device number 6 using
xhci_hcd
[108380.489975] usb 3-14: New USB device found, idVendor=0624,
idProduct=0013
[108380.489977] usb 3-14: New USB device strings: Mfr=4, Product=32,
SerialNumber=0
[108380.489978] usb 3-14: Product: SC Secure KVM
[108380.489979] usb 3-14: Manufacturer: AVOCENT
[108380.490102] usb 3-14: ep 0x84 - rounding interval to 32 microframes,
ep desc says 56 microframes
[108380.490104] usb 3-14: ep 0x87 - rounding interval to 32 microframes,
ep desc says 56 microframes
[108380.491136] input: AVOCENT SC Secure KVM as
/devices/pci0000:00/0000:00:14.0/usb3/3-14/3-14:1.0/input/input18
[108380.491202] hid-generic 0003:0624:0013.0005: input,hidraw1: USB HID
v1.11 Keyboard [AVOCENT SC Secure KVM ] on
usb-0000:00:14.0-14/input0
[108380.491805] input: AVOCENT SC Secure KVM as
/devices/pci0000:00/0000:00:14.0/usb3/3-14/3-14:1.1/input/input19
[108380.491861] hid-generic 0003:0624:0013.0006: input,hidraw2: USB HID
v1.11 Mouse [AVOCENT SC Secure KVM ] on
usb-0000:00:14.0-14/input1

Revision history for this message
Bryce Harrington (bryce) wrote :
Download full text (4.1 KiB)

Xorg.0.log just for fun

[ 6.533] (II) config/udev: Adding input device Power Button (/dev/input/event1)
[ 6.534] (**) Power Button: Applying InputClass "evdev keyboard catchall"
[ 6.535] (II) Using input driver 'evdev' for 'Power Button'
[ 6.535] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input1/event1"
[ 6.535] (II) config/udev: Adding input device Power Button (/dev/input/event0)
[ 6.535] (**) Power Button: Applying InputClass "evdev keyboard catchall"
[ 6.535] (II) Using input driver 'evdev' for 'Power Button'
[ 6.535] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input0/event0"
[ 6.535] (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD, id 7)

[ 6.536] (II) config/udev: Adding input device AVOCENT SC Secure KVM (/dev/input/event2)
[ 6.536] (**) AVOCENT SC Secure KVM : Applying InputClass "evdev keyboard catchall"
[ 6.536] (II) Using input driver 'evdev' for 'AVOCENT SC Secure KVM '
[ 6.536] (**) AVOCENT SC Secure KVM : always reports core events
[ 6.536] (**) evdev: AVOCENT SC Secure KVM : Device: "/dev/input/event2"
[ 6.536] (--) evdev: AVOCENT SC Secure KVM : Vendor 0x624 Product 0x13
[ 6.536] (--) evdev: AVOCENT SC Secure KVM : Found keys
[ 6.536] (II) evdev: AVOCENT SC Secure KVM : Configuring as keyboard
[ 6.536] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb3/3-14/3-14:1.0/input/input5/event2"
[ 6.536] (II) XINPUT: Adding extended input device "AVOCENT SC Secure KVM " (type: KEYBOARD, id 8)
[ 6.536] (**) Option "xkb_rules" "evdev"
[ 6.536] (**) Option "xkb_model" "pc105"
[ 6.536] (**) Option "xkb_layout" "us"

[ 6.537] (II) config/udev: Adding input device AVOCENT SC Secure KVM (/dev/input/event3)
[ 6.537] (**) AVOCENT SC Secure KVM : Applying InputClass "evdev pointer catchall"
[ 6.537] (II) Using input driver 'evdev' for 'AVOCENT SC Secure KVM '
[ 6.537] (**) AVOCENT SC Secure KVM : always reports core events
[ 6.537] (**) evdev: AVOCENT SC Secure KVM : Device: "/dev/input/event3"
[ 6.537] (--) evdev: AVOCENT SC Secure KVM : Vendor 0x624 Product 0x13
[ 6.537] (--) evdev: AVOCENT SC Secure KVM : Found 9 mouse buttons
[ 6.537] (--) evdev: AVOCENT SC Secure KVM : Found scroll wheel(s)
[ 6.537] (--) evdev: AVOCENT SC Secure KVM : Found relative axes
[ 6.537] (--) evdev: AVOCENT SC Secure KVM : Found x and y relative axes
[ 6.537] (II) evdev: AVOCENT SC Secure KVM : Configuring as mouse
[ 6.537] (II) evdev: AVOCENT SC Secure KVM : Adding scrollwheel support
[ 6.537] (**) evdev: AVOCENT SC Secure KVM : YAxisMapping: buttons 4 and 5
[ 6.537] (**) evdev: AVOCENT SC Secure KVM : EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheel
Timeout: 200
[ 6.537] (**) Option "config_info" "udev:/sys/devices...

Read more...

Revision history for this message
Bryce Harrington (bryce) wrote :

Not sure where the best place for this rule is, but 42-usb-hid-pm.rules includes a rule for Avocent already so here's a patch to add this rule there.

description: updated
Revision history for this message
Bryce Harrington (bryce) wrote :

Fwiw, my guess is that autosuspend should be off for more than just this specific product id, so perhaps the rule should be cast more broadly. But I have no evidence to support that so am just proposing this udev rule as a product-specific quirk.

Revision history for this message
Bryce Harrington (bryce) wrote :

To verify the udev rule is operating properly I use this test case:

# echo "auto" > /sys/bus/usb/devices/1-1.4/power/control; cat /sys/bus/usb/devices/*/power/control; echo "---"; service udev force-reload ; udevadm test /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4 > /tmp/foo 2>&1; cat /sys/bus/usb/devices/*/power/control
auto
auto
auto
auto
auto
auto
auto
---
on
auto
auto
auto
auto
auto
auto

Bryce Harrington (bryce)
summary: - Disable USB autosuspend for Avocent SC Secure KVM
+ Please disable USB autosuspend for Avocent SC Secure KVM
tags: added: patch
Bryce Harrington (bryce)
Changed in udev (Ubuntu Trusty):
milestone: none → trusty-updates
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in udev (Ubuntu Trusty):
status: New → Confirmed
Changed in udev (Ubuntu Utopic):
status: New → Confirmed
Changed in udev (Ubuntu):
status: New → Confirmed
Mathew Hodson (mhodson)
Changed in udev (Ubuntu Utopic):
status: Confirmed → Won't Fix
Mathew Hodson (mhodson)
Changed in udev (Ubuntu):
importance: Undecided → Medium
Changed in udev (Ubuntu Trusty):
importance: Undecided → Medium
Changed in udev (Ubuntu Utopic):
importance: Undecided → Medium
tags: added: trusty
Bryce Harrington (bryce)
summary: - Please disable USB autosuspend for Avocent SC Secure KVM
+ [PATCH] Please disable USB autosuspend for Avocent SC Secure KVM
Revision history for this message
Martin Pitt (pitti) wrote : Re: [PATCH] Please disable USB autosuspend for Avocent SC Secure KVM

42-usb-hid.rules got removed in vivid (or so), thus marking the floating task invalid.

Changed in udev (Ubuntu):
status: Confirmed → Invalid
affects: udev (Ubuntu) → systemd (Ubuntu)
Revision history for this message
Martin Pitt (pitti) wrote :

Bryce, that rule looks fine for a trusty SRU. Please go ahead and upload. Thanks!

Changed in systemd (Ubuntu Trusty):
status: Confirmed → Triaged
Bryce Harrington (bryce)
Changed in systemd (Ubuntu Trusty):
status: Triaged → In Progress
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Bryce, or anyone else affected,

Accepted systemd into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/204-5ubuntu20.16 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in systemd (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Bryce Harrington (bryce) wrote : Re: [PATCH] Please disable USB autosuspend for Avocent SC Secure KVM

While the rules seem to work fine, apparently the syntax checker in the packaging scripts don't like the use of := for assignment, so I've change that to just =. I think that should also work fine, but will test once the package actually is built.

tags: removed: verification-needed
Changed in systemd (Ubuntu Trusty):
status: Fix Committed → In Progress
Revision history for this message
Bryce Harrington (bryce) wrote :

Hrm, well with the := changed to =, the rule doesn't seem to be working. (I guess it's the := change; I suppose there could be another error somewhere...)

blackwold:~$ sudo ./disable_avocent_autosuspend
[sudo] password for bryce:
/sys/bus/usb/devices/3-13 on
/sys/bus/usb/devices/3-14 SC Secure KVM auto
/sys/bus/usb/devices/3-3 Perfection1240 on
/sys/bus/usb/devices/3-4 USB Modem on
/sys/bus/usb/devices/4-2 PRO57U SS on
/sys/bus/usb/devices/usb1 EHCI Host Controller auto
/sys/bus/usb/devices/usb2 EHCI Host Controller auto
/sys/bus/usb/devices/usb3 xHCI Host Controller auto
/sys/bus/usb/devices/usb4 xHCI Host Controller auto
--- (setting to auto)
/sys/bus/usb/devices/3-13 on
/sys/bus/usb/devices/3-14 SC Secure KVM auto
/sys/bus/usb/devices/3-3 Perfection1240 on
/sys/bus/usb/devices/3-4 USB Modem on
/sys/bus/usb/devices/4-2 PRO57U SS on
/sys/bus/usb/devices/usb1 EHCI Host Controller auto
/sys/bus/usb/devices/usb2 EHCI Host Controller auto
/sys/bus/usb/devices/usb3 xHCI Host Controller auto
/sys/bus/usb/devices/usb4 xHCI Host Controller auto
--- (applying udev rule)
/sys/bus/usb/devices/3-13 on
/sys/bus/usb/devices/3-14 SC Secure KVM auto
/sys/bus/usb/devices/3-3 Perfection1240 on
/sys/bus/usb/devices/3-4 USB Modem on
/sys/bus/usb/devices/4-2 PRO57U SS on
/sys/bus/usb/devices/usb1 EHCI Host Controller auto
/sys/bus/usb/devices/usb2 EHCI Host Controller auto
/sys/bus/usb/devices/usb3 xHCI Host Controller auto
/sys/bus/usb/devices/usb4 xHCI Host Controller auto
--- (forcing to on)
/sys/bus/usb/devices/3-13 on
/sys/bus/usb/devices/3-14 SC Secure KVM on
/sys/bus/usb/devices/3-3 Perfection1240 on
/sys/bus/usb/devices/3-4 USB Modem on
/sys/bus/usb/devices/4-2 PRO57U SS on
/sys/bus/usb/devices/usb1 EHCI Host Controller auto
/sys/bus/usb/devices/usb2 EHCI Host Controller auto
/sys/bus/usb/devices/usb3 xHCI Host Controller auto
/sys/bus/usb/devices/usb4 xHCI Host Controller auto
blackwold:~$ apt-cache policy udev
udev:
  Installed: 204-5ubuntu20.17
  Candidate: 204-5ubuntu20.17
  Version table:
 *** 204-5ubuntu20.17 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     204-5ubuntu20.15 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
     204-5ubuntu20 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

Not really certain where to go from here... :-/

Revision history for this message
Martin Pitt (pitti) wrote :

> Hrm, well with the := changed to =, the rule doesn't seem to be working.

:= means "finally assign", and further rules can't change it any more. So perhaps your rule is just too early, and later rules assign a different key?

Revision history for this message
Martin Pitt (pitti) wrote :

Any progress here? This is blocking other SRUs, and this has been sitting in -proposed for over two months now.

Revision history for this message
Bryce Harrington (bryce) wrote :

See #17 for where this is stuck.

Revision history for this message
Steve Langasek (vorlon) wrote :

Based on the bug history, it seems "verification-failed" is correct, and the SRU should be removed from trusty-proposed.

tags: added: verification-failed
Revision history for this message
Martin Pitt (pitti) wrote : Proposed package removed from archive

The version of systemd in the proposed pocket of Trusty that was purported to fix this bug report has been removed because the bugs that were to be fixed by the upload were not verified in a timely (105 days) fashion.

Bryce Harrington (bryce)
Changed in systemd (Ubuntu Trusty):
status: In Progress → Confirmed
Mathew Hodson (mhodson)
no longer affects: systemd (Ubuntu)
Martin Pitt (pitti)
summary: - [PATCH] Please disable USB autosuspend for Avocent SC Secure KVM
+ Please disable USB autosuspend for Avocent SC Secure KVM
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.