[Nut-upsdev] Bug#462468: nut: megatec_usb ups not detected since 2.2.1 update anymore

Arjen de Korte arjen at de-korte.org
Sat Jan 26 10:36:08 UTC 2008


>> The output of lsusb and ls -lR /dev/bus/usb is the same for the two
>> versions.
> thanks for your quick feedback Sven.
> @Carlos: there is a clear regression here.

Poor Carlos, he is getting all the flak, while the problem is in the
megatec_usb.c... :-)

> I'm thinking of a recent timeout problem (was 1000 instead of 5000).
> Do you see something?

Increasing the timeout value here, is the worst fix possible. Under no
circumstance should drivers hang around that long in upsdrv_updateinfo().
The problem here is that none of the subdrivers in 'megatec_usb.c' in
nut-2.2.1 handle the return codes from the libusb functions properly. By
sending the EAGAIN error code, they clearly indicate that the command
needs to be retried, instead of declaring it a failure. This might be
handled a little better from r1211 onwards, which added a the possibility
to reconnect. I'm not sure if reconnecting is the proper way to handle
this though. It might be better to just retry the command the next time.

Best regards, Arjen
Eindhoven - The Netherlands
Key fingerprint - 66 4E 03 2C 9D B5 CB 9B  7A FE 7E C1 EE 88 BC 57

More information about the Nut-upsdev mailing list