umass driver doesn't rescan the bus

Nate Lawson nate at root.org
Thu Mar 1 23:37:39 UTC 2007


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


More information about the freebsd-acpi mailing list