PERFORCE change 101080 for review

M. Warner Losh imp at
Mon Jul 10 14:54:10 UTC 2006

In message: <200607101034.38923.jhb at>
            John Baldwin <jhb at> writes:
: On Sunday 09 July 2006 04:22, M. Warner Losh wrote:
: > 
: > John,
: > 
: > I think the following change is good reguardless of how the current
: > discussions about how to get acpi devices wired falls out.  It
: > modifies devclass unit number assignment to treat a pre-existing
: > device as 'taken' as well as one that just might be hinted at.
: > 
: > It has the nice side effect of obviating the need for device_set_unit,
: > which I added holding my nose a long time ago.  The reason I didn't go
: > with this approach was that at the time (4.x or maybe 3.x) there
: > wasn't the hints infrastructure we have today, and I never went back
: > to revisit this kludge to remove it.
: > 
: > Please let me know what you think of this.
: Well, I think perhaps you think my wiring stuff is just about serial
: ports,

No.  I absolutely do not.

: but it really would allow us to generically wire unit numbers
: based on properties of the device that the bus driver can verify
: (resources, location, etc.)

It does allow us to do that, but I don't see the point for PCI

: Basically, I want the bus driver to decide
: if it wants to "claim" a hint device.  That is, each time we go to probe
: a device, if there are any hint-enumerated devices for the child driver
: we are probing, we pass the device_t to the parent (bus) device_t and use
: a new bus_if.m method to ask the parent bus if it's ok for this device_t
: to "take over" the hint device (e.g. if the resources specified in the
: hint are a subset of the ACPI or PNPBIOS-enumerated resources).  Since
: each bus is free to implement whatever algorithm it wants, we can also
: add creative things like:
:"pci:0:4:0"  (a PCI bus/device/function)
: or
:"_SB_.PCI0.ISA0.FOO0"  (an ACPI device name)
: because the bus (and not the MI subr_bus.c code) is determines what the
: hints mean.

Can't use 'at' for this purpose.  'at' isn't a location, but a bus
specifier.  You'll need to invent something else.  I get that, so
don't go assuming that I don't.

You didn't answer my question: is the patch I posted good or not.  I
think it is absolutely necessary, reguardless of the outcome of this

Like I said, I've been doing a lot of thinking about how to accomplish
this.  Your proposal is way too complicated.  After thinking about it
all weekend, I'm sure that we can do all the wiring (to both a
location in a namespace, as well as to a resource "location") using
the patch I posted, plus the hints stuff I created for the iic/spi bus
stuff.  Upon reflection, it turns out to be a lot more general.


More information about the freebsd-acpi mailing list