[Nut-upsuser] tracing a problem with newhidups

Arnaud Quette aquette.dev at gmail.com
Thu Jul 6 19:15:31 UTC 2006


Hi Rodrigo,

2006/7/6, Rodrigo Ventura <yoda at isr.ist.utl.pt>:
>
>
> Hi. I'm having trouble with nut-2.0.3 on a linux kernel 2.4.32 machine and
> a
> MGE Evolution 3000. The problem is that I'm getting the following message,
> repeatidly, on dmesg:
>
> usbdevfs: usb_submit_urb returned -22
>
> (-22 means -EINVAL)
>
> I traced the problem with newhidups -DDDDDD auto and found out that the
> -22
> error appears in a line "none (-22)" of the output as:
>
> ----------
> upsdrv_updateinfo...
> Waiting for notifications...
> none (-22)
> entering string_to_path()
> parsing UPS
> Looking up UPS
> ----------
>
> The function calls in userspace are:
>
> [newhidups.c] upsdrv_updateinfo()
>    [libhid.c] HIDGetEvents()
>       [libusb.c] libusb_get_interrupt()
>          [libusb] usb_interrupt_read()
>             [libusb] usb_urb_transfer()
>
> In the usb_urb_transfer() function one can find that
>
> ----------
>     urb.number_of_packets = 0;  /* don't do isochronous yet */
>     urb.usercontext = NULL;
>
>     ret = ioctl(dev->fd, IOCTL_USB_SUBMITURB, &urb);
> ----------
>
> and in the kernel code of linux/drivers/usb/host/uhci.c:
>
> ----------
> static int uhci_submit_urb(struct urb *urb)
> [...]
>         case PIPE_ISOCHRONOUS:
>                 if (urb->bandwidth == 0) {      /* not yet
> checked/allocated
> */
>                         if (urb->number_of_packets <= 0) {
>                                 ret = -EINVAL;
> ----------
>
> So it seems that setting number_of_packets to zero is directly related
> with
> the kernel error.
>
> What is going on here? Is it a bug in nut?
>

a good try, and amount of effort.
Sadly, notifications are on the PIPE_INTERRUPT

If everything's working fine otherwise (ie UPS status changes are seen), you
should dig a bit more the code as it sound like a kernel regression.

If something is not working, you can try to reset the communication: power
off the UPS, then unplug its power cable, wait (at least) 10 seconds and
replug/restart all.

Arnaud
-- 
Linux / Unix Expert - MGE UPS SYSTEMS - R&D Dpt
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://people.debian.org/~aquette/
OpenSource Developer - http://arnaud.quette.free.fr/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20060706/aa013a91/attachment.html


More information about the Nut-upsuser mailing list