From owner-freebsd-acpi@FreeBSD.ORG Thu Mar 1 23:37:39 2007 Return-Path: X-Original-To: freebsd-acpi@freebsd.org Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6FE1116A400 for ; Thu, 1 Mar 2007 23:37:39 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id 5331613C442 for ; Thu, 1 Mar 2007 23:37:39 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 88164 invoked from network); 1 Mar 2007 23:06:01 -0000 Received: from ppp-71-139-18-69.dsl.snfc21.pacbell.net (HELO ?10.0.5.55?) (nate-mail@71.139.18.69) by root.org with ESMTPA; 1 Mar 2007 23:06:01 -0000 Message-ID: <45E75C67.5050107@root.org> Date: Thu, 01 Mar 2007 15:06:15 -0800 From: Nate Lawson User-Agent: Thunderbird 1.5.0.9 (X11/20070214) MIME-Version: 1.0 To: =?UTF-8?B?TWljaGHFgiBGcnluYXM=?= References: <8af9710703010127r64733012h20859ff9a61967bd@mail.gmail.com> In-Reply-To: <8af9710703010127r64733012h20859ff9a61967bd@mail.gmail.com> X-Enigmail-Version: 0.94.2.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: freebsd-acpi@freebsd.org Subject: Re: umass driver doesn't rescan the bus X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2007 23:37:39 -0000 MichaƂ Frynas wrote: > Hello all, > > I've got a small problem when trying to configure the devd daemon to work > with umass driver. Here's what I'm trying to achive: I configured the devd > to handle the nomatch event as follows: > > nomatch 100 { > match "vendor" "[ven_id]"; > match "product" "[prod_id]"; > match "release" "[rel_id]"; > action "if ! kldstat -n umass; then kldload umass; fi"; > }; > > detach 100 { > device-name "umass[0-9]+"; > action "if kldstat -n umass; then kldunload; fi"; > }; > > Then, when I'm attaching the usb umass device, in this case the 80gb > external hdd, devd recognize the device and runs the proper action. > However, > after loading the umass driver the bus isn't rescaned automatically. I need > to plug the device out, and plug it in again for the umass driver to > recognize it correctly. I'm wondering how can I enforce that the attach > event is generated again after the umass driver is loaded, or how enforce > rescanning the usb/scsi bus (I tried the camcontrol, but no effect). > Oh, and one more thing. The kernel sees the device as the "lost device", > even it's recognized correctly, but the umass doesn't connect it the the > bus, so the userland is not able to use it in anyway. > > PS. cam driver is also load. This is not at all an ACPI question but I think I can answer it. umass isn't a device type, it's a transfer method for SCSI or ATA devices. In most cases devices are SCSI and thus the da driver will attach to disks. You can just run "camcontrol rescan all" but that shouldn't be necessary since umass will trigger the rescan. If it's ata, I think the corresponding command is "atacontrol attach ". In any case, that's not your problem. The issue is that for USB, an irq is generated when a device is plugged in. Since no driver is loaded, the irq is ignored. When you load the driver later, it doesn't know that anything is attached. It's possible this could be solved in the host interface driver (uhci/ehci/ohci) but probably not easy. Solution: load umass at boot. -- Nate