[Nut-upsuser] Windows 2.6.0-1 usbhid-ups driver infinite loop on USB disconnect

David Bolen db3l.net at gmail.com
Tue Jun 28 22:13:29 UTC 2011


I was doing some testing with the 2.6.0-1 beta Windows installer and a
Cyber Power CP1350PFCLCD UPS, and ran into an infinite loop in the
usbhid-ups driver if the UPS is lost on the UPS bus.  This is on a
Windows XP SP3 system.  USB device access is via libusb 1.2.4.0
(driver mode, not filter) in case that matters.

Everything seems to work just fine so far while the UPS is connected
(so kudos, BTW, on the port in general), but if I pull the USB cable
to the UPS during operation, usbhid-ups goes into a tight loop with
errors trying to process/poll the USB port and fails to recognize the
UPS is unavailable, even if the UPS is then reconnected.

So once the connection is broken, no further UPS communication takes
place although the rest of the system (status from upsd via upsc or
upsmon) continues to see UPS data from just before the disconnect, so
I'm assuming usbhid-ups is continuing to update stale data, which makes
the failure mode nasty.

Attached below is an excerpt of debugging output from usbhid-ups.  It
would appear that the interrupt and query failures have reasonably
appropriate errors, so maybe it's just a difference in how such errors
reflect under Windows vs. *nix.

Any suggestions welcome.  I haven't yet tried to build from source,
but will be getting that set up, so should be able to recompile if there
are specific patches to try.

-- David

Output from:  "usbhid-ups.exe -a ups -D"

   0.000000	debug level is '1'
   0.000000	upsdrv_initups...
   0.093750	Using subdriver: CyberPower HID 0.3
   0.093750	Path: UPS.PowerSummary.iProduct, Type: Feature, ReportID: 0x01, Offset: 0, Size: 8, Value: 1

   (... rest of UPS discovery parameters available if needed ...)

   0.140625	Network UPS Tools - Generic HID driver 0.35 (2.6.0-2988:2989M)
   0.140625	USB communication driver 0.31
   0.218750	Detected a UPS: CP1350PFCLCD/CRCA102.981
   0.234375	upsdrv_initinfo...
   0.234375	upsdrv_updateinfo...
   0.234375	Got 6 HID objects...
   0.234375	Quick update...
   0.234375	upsdrv_updateinfo...
   0.500000	Got 0 HID objects...
   0.500000	Quick update...
   0.500000	upsdrv_updateinfo...

   (... above repeated during normal operation - varying HID object count ...)

   (*** I pulled the cable here ***)

   4.984375	libusb_get_interrupt: libusb0-dll:err [_usb_reap_async] reaping request failed, win error: A device attached to the system is not functioning.
   4.984375	Got 0 HID objects...
   4.984375	Quick update...
   4.984375	upsdrv_updateinfo...
   5.234375	Got 0 HID objects...
   5.234375	Quick update...
   5.250000	upsdrv_updateinfo...
   5.406250	libusb_get_interrupt: libusb0-dll:err [_usb_reap_async] reaping request failed, win error: The device is not connected.
   5.406250	Got 0 HID objects...
   5.406250	Quick update...
   5.406250	upsdrv_updateinfo...
   5.656250	Got 0 HID objects...
   5.656250	Quick update...
   5.671875	upsdrv_updateinfo...
   5.671875	libusb_get_interrupt: libusb0-dll:err [submit_async] submitting request failed, win error: The device does not recognize the command.
   5.671875	Got 0 HID objects...
   5.671875	Quick update...
   5.671875	upsdrv_updateinfo...
   5.671875	libusb_get_interrupt: libusb0-dll:err [submit_async] submitting request failed, win error: The device does not recognize the command.
   5.671875	Got 0 HID objects...
   5.671875	Quick update...
   5.671875	upsdrv_updateinfo...
   5.671875	libusb_get_interrupt: libusb0-dll:err [submit_async] submitting request failed, win error: The device does not recognize the command.

   (... This repeats forever, even after reconnecting the UPS  ...)





More information about the Nut-upsuser mailing list