Re: [Testing wanted] USB patch for HAL

From: Greg Rivers <gcr+freebsd-current_at_tharned.org>
Date: Sat, 25 Jun 2011 13:53:53 -0500 (CDT)
On Fri, 24 Jun 2011, Hans Petter Selasky wrote:

> It appears there are some bugs in the USB2 HAL implementation. For 
> example the parent USB device is not always correctly set and there are 
> problems with dynamic attach/detach of USB devices in hald.
>
> For users of 9-current and 8-stable:
>
> Copy the attached file to /usr/ports/sysutils/hal/files/
>
> Then rebuild HAL.
>
> Does it fix any USB/HAL related problems? For example related to 
> multimedia/webcamd, lshal, mouse, keyboard etc.
>

I tried your patch Hans (on 8.2-STABLE as of June 1), but it did not fix 
the problem I've been having on some machines with hald and umass devices. 
For reference, I first reported this problem[1] ~2 years ago.

Basically what happens is this: when the first umass device is attached, I 
see the attach message and then a CAM error at ~1 second intervals (I 
assume this is the hald polling period) for the duration.  When I pull the 
device I see the detach message, and it's over; hald is now unkillable, 
and the USB bus will no longer attach any other device, umass or 
otherwise.  The only way out of this is a reboot.

Here's an illustration:
Jun 25 13:15:45 blue root: Unknown USB device: vendor 0x1307 product 0x0163 bus uhub4
Jun 25 13:15:45 blue kernel: ugen4.3: <USBest Technology> at usbus4
Jun 25 13:15:45 blue kernel: umass0: <USBest Technology USB Mass Storage Device, class 0/0, rev 2.00/1.00, addr 3> on usbus4
Jun 25 13:15:45 blue kernel: umass0:  SCSI over Bulk-Only; quirks = 0x0000
Jun 25 13:15:47 blue kernel: umass0:0:0:-1: Attached to scbus0
Jun 25 13:15:47 blue kernel: da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
Jun 25 13:15:47 blue kernel: da0: <Simple Bonzai Xpress 0.00> Removable Direct Access SCSI-2 device 
Jun 25 13:15:47 blue kernel: da0: 40.000MB/s transfers
Jun 25 13:15:47 blue kernel: da0: 983MB (2015231 512 byte sectors: 64H 32S/T 983C)
Jun 25 13:15:47 blue kernel: (sg0:umass-sim0:0:0:0): cam_periph_release_locked: release 0xc47bfc00 when refcount is zero
Jun 25 13:15:47 blue kernel: (sg0:umass-sim0:0:0:0): cam_periph_release_locked: release 0xc47bfc00 when refcount is zero
Jun 25 13:15:47 blue kernel: 
Jun 25 13:15:49 blue kernel: (sg0:umass-sim0:0:0:0): cam_periph_release_locked: release 0xc47bfc00 when refcount is zero
Jun 25 13:15:49 blue kernel: 
Jun 25 13:15:51 blue kernel: (sg0:umass-sim0:0:0:0): cam_periph_release_locked: release 0xc47bfc00 when refcount is zero
Jun 25 13:15:51 blue kernel: 
Jun 25 13:15:53 blue kernel: (sg0:umass-sim0:0:0:0): cam_periph_release_locked: release 0xc47bfc00 when refcount is zero
Jun 25 13:15:53 blue kernel: 
Jun 25 13:15:55 blue kernel: (sg0:umass-sim0:0:0:0): cam_periph_release_locked: release 0xc47bfc00 when refcount is zero
Jun 25 13:15:55 blue kernel: 
Jun 25 13:15:57 blue kernel: (sg0:umass-sim0:0:0:0): cam_periph_release_locked: release 0xc47bfc00 when refcount is zero
Jun 25 13:15:57 blue kernel: 
Jun 25 13:15:58 blue kernel: ugen4.3: <USBest Technology> at usbus4 (disconnected)
Jun 25 13:15:58 blue kernel: umass0: at uhub4, port 1, addr 3 (disconnected)
Jun 25 13:16:07 blue kernel: (da0:umass-sim0:0:0:0): lost device
Jun 25 13:16:07 blue kernel: (da0:umass-sim0:0:0:0): removing device entry

At this point the USB bus is effectively wedged.  It seems to be the 
detach that triggers the problem.  If I do not detach anything, I can 
continue to add other devices and they attach fine.

I'd be happy to continue troubleshooting and testing if you'd like to 
pursue this.  Just let me know what you'd like me to do.  Thanks for all 
your great work!

[1] 
http://lists.freebsd.org/pipermail/freebsd-current/2009-August/010406.html

-- 
Greg Rivers
Received on Sat Jun 25 2011 - 17:30:26 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:15 UTC