Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 01 Mar 2007 15:06:15 -0800
From:      Nate Lawson <nate@root.org>
To:        =?UTF-8?B?TWljaGHFgiBGcnluYXM=?= <mfrynas@gmail.com>
Cc:        freebsd-acpi@freebsd.org
Subject:   Re: umass driver doesn't rescan the bus
Message-ID:  <45E75C67.5050107@root.org>
In-Reply-To: <8af9710703010127r64733012h20859ff9a61967bd@mail.gmail.com>
References:  <8af9710703010127r64733012h20859ff9a61967bd@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <bus>".

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45E75C67.5050107>