bus_generic_get_property() forwards a request up the tree with the original
child, so acpi_bus_get_prop() can be reached with a child that is not its
own. It read that child's ivars as a struct acpi_device, which only holds
where the intervening bus went out of its way to make them one -- dpaa2_mc(4)
and memac_mdio(4) synthesise acpi_device ivars precisely so that forwarding
works. An ACPI-described i2c bus keeps its own layout, and a miibus PHY has
no ACPI ivars at all; reading either as ours faults.
Reach the child through acpi_get_handle() instead. That goes through
BUS_READ_IVAR, which every bus answers for its own children or declines --
and declining leaves the handle NULL, which is the right answer here.
Split the _DSD handling into evaluation, lookup and value conversion so both
paths can share it: acpi_device_get_prop() keeps using the copy cached in
struct acpi_device, while the handle-based path evaluates _DSD per call and
frees it again. A property whose value would be returned by reference into
that package -- a sub-package -- is therefore not served that way; nothing in
tree asks for one.
Also check that _DSD itself is a package of at least two elements before
indexing it, and take the address of the handle in the ACPI_TYPE_LOCAL_REFERENCE
case rather than copying from the namespace node it points at.
Depends on D60062