NetBSD Problem Report #28360
From wolfgang@wsrcc.com Fri Nov 19 20:54:18 2004
Return-Path: <wolfgang@wsrcc.com>
Received: from sonic.wsrcc.com (sonic.wsrcc.com [64.142.50.224])
by narn.netbsd.org (Postfix) with ESMTP id 1257C251F7A
for <gnats-bugs@gnats.NetBSD.org>; Fri, 19 Nov 2004 20:54:16 +0000 (UTC)
Message-Id: <20041119205409.B0D314E344A@capsicum.wsrcc.com>
Date: Fri, 19 Nov 2004 12:54:09 -0800 (PST)
From: wolfgang@wsrcc.com
Reply-To: wolfgang@wsrcc.com
To: gnats-bugs@netbsd.org
Subject: usb ugen reads hang when talking to APC UPS
X-Send-Pr-Version: 3.95
>Number: 28360
>Category: kern
>Synopsis: usb ugen reads hang when talking to APC UPS
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Nov 19 20:55:02 +0000 2004
>Last-Modified: Thu Oct 20 22:44:01 +0000 2005
>Originator: Wolfgang S. Rupprecht
>Release: NetBSD 2.99.10
>Organization:
W S Rupprecht Computer Consulting, Fremont CA
>Environment:
System: NetBSD capsicum.wsrcc.com 2.99.10 NetBSD 2.99.10 (WSRCC_ATHLON) #15: Tue Nov 16 19:23:29 PST 2004 wolfgang@capsicum.wsrcc.com:/var/obj/netbsd/sys/arch/i386/compile/WSRCC_ATHLON i386
Architecture: i386
Machine: i386
>Description:
The usb ugen driver will hang after a minute or two of talking
to an "American Power Conversion Back-UPS RS 1500".
Everything works fine before that time and apcupsd can read
the UPS status and voltages etc.
$ ps -axlww | egrep 'apc|PID'
UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND
0 238 1 0 -6 0 2208 1028 usbsyn Dsa ?? 0:00.18 /sbin/apcupsd --kill-on-powerfail
The process is unkillable (neg priority), but the hang can be
cleared by unplugging the usb cable and plugging it back in.
A debug trace with the following turned on is available below.
usbdebug 6
ugendebug 6
uhcidebug 6
http://www.wsrcc.com/wolfgang/private/ups-hang-log3.txt.gz
>How-To-Repeat:
compile and install apcupsd-3.10.16-test2 run with usb cable,
usb protocol selected in the config file. A version of
apcupsd w. usb support that compiles on netbsd can be found
here. (I didn't do this port, but can't find the orignal site
right now.)
http://www.wsrcc.com/wolfgang/private/apcupsd-3.10.16-test2-wsr.tar.gz
cat << EOF > /etc/apcupsd/apcupsd.conf
UPSCABLE usb
UPSTYPE usb
LOCKFILE /var/spool/lock
ONBATTERYDELAY 6
BATTERYLEVEL 20
MINUTES 10
TIMEOUT 0
ANNOY 300
ANNOYDELAY 60
NOLOGON disable
KILLDELAY 0
NETSERVER on
NISIP 0.0.0.0
NISPORT 3551
EVENTSFILE /var/log/apcupsd.events
EVENTSFILEMAX 10
UPSCLASS standalone
UPSMODE disable
STATTIME 0
STATFILE /var/log/apcupsd.status
LOGSTATS off
DATATIME 0
EOF
Kernel needs to be compiled without uhidev and children (uhid,
ukbd, wsmouse etc).
The above trace very clearly shows when the usb starts to
hang. Perhaps someone familiar with the USB can spot what is
going wrong. My inexperienced eye didn't spot any funny
exchanges just before hang.
>Fix:
>Audit-Trail:
From: "Adam Kropelin" <akropel1@rochester.rr.com>
To: <gnats-bugs@netbsd.org>
Cc:
Subject: Re: kern/28360 usb ugen reads hang when talking to APC UPS
Date: Thu, 20 Oct 2005 18:45:12 -0400
This problem turns out to be caused by short reads. apcupsd-3.10.17a and
later have a workaround that appears to be effective.
--Adam
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.