Hassio kernel USB bug (ohci-pci: frame counter not updating; disabled)

Hello,

I have a Conbee USB zigbee stick connected to an Ubuntu 16.04.6 system (kernel 4.15.0) running Virtualbox 5.1.38 running HassIO 0.87.1 (kernel 4.19.20)

Multiple times per day, Hassio loses ability to communicate with the Conbee USB stick.
In journalctl, I see error message “ohci-pci: frame counter not updating; disabled”. Full error text pasted below.

The issue appears similar to this one described here:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1634737
Except HassIO is running a newer kernel version that supposedly has the fix.

Anyone have any idea how to fix this please?

Log extract:

Feb 21 16:56:20 hassio kernel: ohci-pci 0000:00:06.0: frame counter not updating; disabled
Feb 21 16:56:20 hassio kernel: ohci-pci 0000:00:06.0: HC died; cleaning up
Feb 21 16:56:20 hassio kernel: usb 1-1: USB disconnect, device number 2
Feb 21 16:56:20 hassio 4f0dca6ec50d[2410]: 16:56:20:631 device state timeout ignored in state 3
Feb 21 16:56:21 hassio 4f0dca6ec50d[2410]: 16:56:21:681 device state timeout ignored in state 3
Feb 21 16:56:22 hassio kernel: irq 22: nobody cared (try booting with the “irqpoll” option)
Feb 21 16:56:22 hassio kernel: CPU: 0 PID: 23039 Comm: kworker/0:2 Not tainted 4.19.20 #1
Feb 21 16:56:22 hassio kernel: Workqueue: usb_hub_wq hub_event
Feb 21 16:56:22 hassio kernel: Call Trace:
Feb 21 16:56:22 hassio kernel: <IRQ>
Feb 21 16:56:22 hassio kernel: dump_stack+0x5c/0x7b
Feb 21 16:56:22 hassio kernel: __report_bad_irq+0x2b/0xb0
Feb 21 16:56:22 hassio kernel: note_interrupt+0x230/0x280
Feb 21 16:56:22 hassio kernel: handle_irq_event_percpu+0x4c/0x70
Feb 21 16:56:22 hassio kernel: handle_irq_event+0x22/0x40
Feb 21 16:56:22 hassio kernel: handle_fasteoi_irq+0x66/0x120
Feb 21 16:56:22 hassio kernel: handle_irq+0xaa/0x110
Feb 21 16:56:22 hassio kernel: do_IRQ+0x3c/0xd0
Feb 21 16:56:22 hassio kernel: common_interrupt+0xf/0xf
Feb 21 16:56:22 hassio kernel: RIP: 0010:__do_softirq+0x6d/0x2d1
Feb 21 16:56:22 hassio kernel: Code: 60 00 01 00 00 44 0f b7 f0 c7 44 24 20 0a 00 00 00 44 89 74 24 04 48 c7 c0 80 1b 02 00 65 66 c7 00 00 00 fb 66 0f 1f 44 00 00 <b8> ff ff ff ff 0f bc 44 24 04 83 c0 01 89 44 24 10 0f 84 9c 00 00
Feb 21 16:56:22 hassio kernel: RSP: 0018:ffffa3ad7d803f78 EFLAGS: 00000206 ORIG_RAX: ffffffffffffffdd
Feb 21 16:56:22 hassio kernel: RAX: 0000000000021b80 RBX: ffffa3ad7d815f00 RCX: 0000000004208060
Feb 21 16:56:22 hassio kernel: RDX: 0000000000000000 RSI: 000000000000c123 RDI: 0000000000000380
Feb 21 16:56:22 hassio kernel: RBP: 0000000000000000 R08: 00003ec8924a9e5f R09: 000029f3e1452745
Feb 21 16:56:22 hassio kernel: R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000
Feb 21 16:56:22 hassio kernel: R13: 0000000000000000 R14: 0000000000000282 R15: 0000000000000000
Feb 21 16:56:22 hassio kernel: ? common_interrupt+0xa/0xf
Feb 21 16:56:22 hassio kernel: ? hrtimer_interrupt+0x113/0x240
Feb 21 16:56:22 hassio kernel: irq_exit+0xb8/0xc0
Feb 21 16:56:22 hassio kernel: smp_apic_timer_interrupt+0x67/0x120
Feb 21 16:56:22 hassio kernel: apic_timer_interrupt+0xf/0x20
Feb 21 16:56:22 hassio kernel: </IRQ>
Feb 21 16:56:22 hassio kernel: RIP: 0010:usb_hcd_flush_endpoint+0x65/0x100
Feb 21 16:56:22 hassio kernel: Code: 39 c4 48 8d 58 e0 74 14 8b 40 f8 85 c0 74 69 48 8b 43 28 49 39 c4 48 8d 58 e0 75 ec c6 05 de 80 46 01 00 fb 66 0f 1f 44 00 00 <eb> 3a 48 c7 c7 4c 71 bc a0 31 db e8 1b 58 39 00 48 8b 45 18 49 39
Feb 21 16:56:22 hassio kernel: RSP: 0018:ffffaa98c0c7fbe8 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
Feb 21 16:56:22 hassio kernel: RAX: ffffa3ad7f4ed5b8 RBX: ffffa3ad7f4ed598 RCX: 0000000000000002
Feb 21 16:56:22 hassio kernel: RDX: 0000000000000001 RSI: 0000000000000086 RDI: ffffffffa0bc714c
Feb 21 16:56:22 hassio kernel: RBP: ffffa3ad7f4ed5a0 R08: 0000000000000001 R09: 0000000000000000
Feb 21 16:56:22 hassio kernel: R10: 0000000000000001 R11: ffffa3ad7f2b9100 R12: ffffa3ad7f4ed5b8
Feb 21 16:56:22 hassio kernel: R13: 00000000ffffff94 R14: ffffa3ad7d763000 R15: 00000000ffffffed
Feb 21 16:56:22 hassio kernel: ? usb_hcd_flush_endpoint+0xe4/0x100
Feb 21 16:56:22 hassio kernel: usb_disable_interface+0x3b/0x50
Feb 21 16:56:22 hassio kernel: usb_unbind_interface+0x187/0x290
Feb 21 16:56:22 hassio kernel: device_release_driver_internal+0x1ac/0x270
Feb 21 16:56:22 hassio kernel: bus_remove_device+0xd7/0x120
Feb 21 16:56:22 hassio kernel: device_del+0x133/0x350
Feb 21 16:56:22 hassio kernel: ? usb_remove_ep_devs+0x16/0x30
Feb 21 16:56:22 hassio kernel: usb_disable_device+0x7c/0x1d0
Feb 21 16:56:22 hassio kernel: usb_disconnect+0xb7/0x230
Feb 21 16:56:22 hassio kernel: ? __switch_to_asm+0x34/0x70
Feb 21 16:56:22 hassio kernel: hub_quiesce+0x3e/0x90
Feb 21 16:56:22 hassio kernel: hub_event+0x380/0x1330
Feb 21 16:56:22 hassio kernel: ? __switch_to_asm+0x34/0x70
Feb 21 16:56:22 hassio kernel: ? __switch_to_asm+0x40/0x70
Feb 21 16:56:22 hassio kernel: ? __switch_to_asm+0x34/0x70
Feb 21 16:56:22 hassio kernel: ? __switch_to_asm+0x40/0x70
Feb 21 16:56:22 hassio kernel: ? __switch_to_asm+0x40/0x70
Feb 21 16:56:22 hassio kernel: ? __switch_to_asm+0x34/0x70
Feb 21 16:56:22 hassio kernel: ? __switch_to_asm+0x40/0x70
Feb 21 16:56:22 hassio kernel: ? __switch_to_asm+0x34/0x70
Feb 21 16:56:22 hassio kernel: ? __switch_to+0x8c/0x440
Feb 21 16:56:22 hassio kernel: ? __switch_to_asm+0x34/0x70
Feb 21 16:56:22 hassio kernel: ? __switch_to_asm+0x40/0x70
Feb 21 16:56:22 hassio kernel: process_one_work+0x1e9/0x3e0
Feb 21 16:56:22 hassio kernel: worker_thread+0x28/0x3d0
Feb 21 16:56:22 hassio kernel: ? process_one_work+0x3e0/0x3e0
Feb 21 16:56:22 hassio kernel: kthread+0x10e/0x130
Feb 21 16:56:22 hassio kernel: ? kthread_create_worker_on_cpu+0x70/0x70
Feb 21 16:56:22 hassio kernel: ret_from_fork+0x35/0x40
Feb 21 16:56:22 hassio kernel: handlers:
Feb 21 16:56:22 hassio kernel: [<00000000c6a9ade9>] usb_hcd_irq
Feb 21 16:56:22 hassio kernel: Disabling IRQ #22
Feb 21 16:56:22 hassio kenel: usb 1-2: USB disconnect, device number 3
Feb 21 16:56:22 hassio kernel: ftdi_sio ttyUSB0: error from flowcontrol urb
Feb 21 16:56:22 hassio kernel: ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
Feb 21 16:56:22 hassio kernel: ftdi_sio 1-2:1.0: device disconnected

1 Like

As a temporary workaround, USB connection can be restored as follows:

# cd /sys/bus/pci/drivers/ohci-pci/
# ls
0000:00:06.0 bind new_id remove_id uevent unbind
# echo -n 0000:00:06.0 > unbind
# echo -n 0000:00:06.0 > bind

Bump…

Any luck with this butako13?

I’m having the same issue, restarting hassio at least once per day is getting old.

1 Like

Bump…

Anyone??

For anyone still struggling with the ohci-pci issue when running Home Assistant OS in a VirtualBox VM. Best I can find is that this is an issue related to the timing of frame-counter with USB devices. The timing counter occurs fast (4ms or something), and recognizes the USB as redundant and shuts it down.

Setting your VirtualBox USB settings to USB 3.0: xHCI, should fix this. I made this change from previous USB 2.0 and have not experienced since.

5 Likes

I have same problem. Constantly USB disconnect after period of time.


Is it the only change you made?

I have the same issue. Does any one has a solution for this?

I have the same problem, on fairly different hardware/software versions.

I’m on a old Intel Core i7-4770S machine and a Sonoff Zigbee 3.0 USB Dongle Plus connected over OHCI, running Ubuntu 12.04 and VirtualBox 4.3.40 (I know I should upgrade both Ubuntu and VirtualBox, but I have loads of inter-related stuff that I’d also need to upgrade/change). I don’t expect anyone to rush around trying to fix this issue, given it may well be purely down to my out of date software.

I get the same:

frame counter not updating; disabled

and:

[zigpy_znp.zigbee.application] Failed to reset before disconnect: 'NoneType' object has no attribute 'write'

"/usr/local/lib/python3.13/site-packages/zigpy_znp/zigbee/application.py", line 850, in _send_request_raw

There is never anything logged on the Ubuntu side when it happens. It happens very randomly intermittently. Sometimes it takes months to happen, other times it can happen an hour after I’ve fixed it.

I’ve tried to do the reseting of the device on the Ubuntu side, but that didn’t seem to do anything. The only way I’ve found of fixing it is restarting the VM that HAOS is running in.

I can’t connect it over USB 3, I assume because of my old version of VirtualBox.

So for now I’ve worked around the problem, with a janky Heath Robinson “solution”:

  • an automation that listens for system_log_event events with the name zigpy_znp.zigbee.application containing “Failed to reset”
  • the automation sends some notifications and also posts a mqtt message
  • it then shuts down HA so everything is cleanly shutdown
  • a python script running from cron at boot on the host Ubuntu machine listens for the mqtt messages
  • the script waits 30 seconds to give HA time to shutdown
  • the script stops the VM and then starts it again

A whole load of mess I’d rather not do, but I’m fed up with randomly finding zigbee is dead again…

It is good that I could build it reasonably easily though.

However let’s see if it all actually works next time the problem occurs, it isn’t easy to test fully. And also at least once zigpy/zha has lost access to the dongle in some other way, but I didn’t manage to capture the logs of that event so don’t know the details, apart from there was no entry in system_log_event that I could use.