When to burn those bridges

John Baldwin jhb at FreeBSD.org
Thu Sep 11 07:51:01 PDT 2003


On 11-Sep-2003 Doug Rabson wrote:
> On Wed, 2003-09-10 at 23:39, John Baldwin wrote:
>> On 10-Sep-2003 Doug Rabson wrote:
>> > 
>> > My feeling about that was always that the hostb driver provides
>> > absolutely no added value in the system. When I was developing agp
>> > originally, I just nuked it and kldloading agp.ko worked just fine.
>> 
>> I don't mind if hostb were to die, but it does serve somewhat of a
>> purpose.  A dummy vga driver might also be useful with Warner's PCI
>> power management stuff as well.
> 
> A long time ago, I was thinking about a scheme where newbus would detach
> a driver which had attached to a device at a very low priority if a new
> driver was added via kldload.
> 
> The way it might work is that a 'placeholder' driver like hostb would
> mark the device with a flag, e.g. device_set_placeholder. When a new
> driver is loaded, devices set as placeholders would be re-probed in
> bus_generic_driver_added as well as devices with no drivers at all. If
> the new driver probed with a higher value than the current placeholder
> driver, in device_probe_and_attach, the old driver would be detached and
> the new one attached.

I have thought about this as well, but instead of a placeholder flag,
just doing this for any driver that returned a probe value != 0.
This relies on very simple probes however, since ideally you would
want to execute the new driver's probe and if it matches better, then
you detach the old driver and attach the new one.   This requires
that the new driver's probe not try to alloc resources or dink with
the hardware though.

-- 

John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


More information about the freebsd-arch mailing list