From owner-freebsd-current@FreeBSD.ORG Sat Jun 25 19:30:26 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B687106566C; Sat, 25 Jun 2011 19:30:26 +0000 (UTC) (envelope-from gcr+freebsd-current@tharned.org) Received: from roadkill.tharned.org (roadkill.tharned.org [75.145.12.185]) by mx1.freebsd.org (Postfix) with ESMTP id 2B3448FC12; Sat, 25 Jun 2011 19:30:25 +0000 (UTC) Received: from badger.tharned.org (badger.tharned.org [10.10.10.23]) (authenticated bits=0) by roadkill.tharned.org (8.14.4/8.14.4) with ESMTP id p5PIrrD7084787 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 25 Jun 2011 13:53:54 -0500 (CDT) (envelope-from gcr+freebsd-current@tharned.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tharned.org; s=2011; t=1309028034; bh=HuRj4zXJo+O2p+oOpnrI2asyADKt8zyfCKVKj6Ltzlk=; l=3734; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=QypPQbs61rrfF+D5igo2D7um4RIz1+24EN6guxxkO9uJWD2H9EWNAntawHVesFPpZ 61NHuFS2jPy+tjrMkGMIo3MpnPGFpjNUFDKIcDEjh5C2HDpbNDqQeiwFgmEHnrktv0 Tj7cWgQkNyMsKyIuqvMPw85z/8A7mlJDy28RfiUM= Date: Sat, 25 Jun 2011 13:53:53 -0500 (CDT) From: Greg Rivers To: Hans Petter Selasky In-Reply-To: <201106241531.19375.hselasky@c2i.net> Message-ID: References: <201106241531.19375.hselasky@c2i.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (roadkill.tharned.org [75.145.12.185]); Sat, 25 Jun 2011 13:53:54 -0500 (CDT) Cc: gnome@freebsd.org, freebsd-current@freebsd.org Subject: Re: [Testing wanted] USB patch for HAL X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 19:30:26 -0000 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: at usbus4 Jun 25 13:15:45 blue kernel: umass0: 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: 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: 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