The code in sys/dev/ahci.c automatically detects whether or not a device has AHCI_CAP_EMS support, then automatically loads the ahciem device. The ahciem device should instead be loaded in the default kernel as a dependency of ahci. 310 if (ctlr->caps & AHCI_CAP_EMS) { 311 child = device_add_child(dev, "ahciem", -1); 312 if (child == NULL) 313 device_printf(dev, "failed to add enclosure device\n"); 314 else 315 device_set_ivars(child, (void *)(intptr_t)-1); 316 }
Not sure I understand your proposition. Do you want ahciem to be separate module, or do you want some tunable to disable it, or something else?
(In reply to Alexander Motin from comment #1) > Not sure I understand your proposition. Do you want ahciem to be separate > module, or do you want some tunable to disable it, or something else? I jumped to a conclusion without providing a proper problem statement. Basically we have a platform at work that has ahciems support, but our software isn't coded up to handle ahciems currently, so this causes our software to poke at the boot drives for ahciems status a little too much. Having the support on by default makes sense from a usability perspective. In general, being able to enable/disable ahciems on a global or a per-controller basis (like atc.wc.enable) is desirable, because the end-user might not want ahciems support to be enabled, or the device support provided/integrated in with some vendors might be buggy/broken. PS I was working on a patch to separate out the drivers, but then I realized that it would introduce unnecessary complexity because of how the driver currently hangs ahciems devices off of ahci controllers, and how the ahciems instances are created/destroyed at ahci controller attach/detach.