[PATCH] simplebus child device probe order control via FDT (motivated by BeagleBone Black)

Warner Losh imp at bsdimp.com
Mon Mar 3 02:38:11 UTC 2014





On Mar 2, 2014, at 4:56 PM, Patrick Kelsey <kelsey at ieee.org> wrote:

> Hi,
> 
> The attached patch (fdt_probe_order_control.patch) allows control over the
> probe order of simplebus child devices by using a "probe-order" property in
> simplebus child nodes in the .dts file

Where is the probe-order property defined? I can’t seem to find it in the bindings.
Also, I don’t think it is necessary. This is a software construct, so doesn’t really
belong in the dts file. I’d really like to avoid FreeBSD specific hacks in the DTS
files.

> This was motivated by booting FreeBSD from the eMMC on a BeagleBone Black,
> which has a pluggable microSD card slot in addition to the eMMC.  The order
> that the mmc units are defined in sys/boot/fdt/dts/am335x.dtsi causes the
> pluggable slot to be probed/attached first, so the device name assigned to
> the eMMC soldered to the board changes depending on whether there is a card
> in the pluggable slot, which makes establishing appropriate /etc/fstab
> contents less than convenient.

Sounds like you’d like to have some sort of name to instance mapping.
The typical way this is solved is by naming the partitions so that ordering
doesn’t matter. Even if you don’t handle this at the filesystem level, which
is how others cope, you’d want this to be more of a direct binding rather than an
ordering so that you get the effect you want (constant name) directly, rather
than as a side-effect of ordering.

If you insist on that, then having a something more like “freesbd,unit-number”
property would also accomplish this. But that would only wire the controller unit
number, and not the resulting mmcsdX device.

> By using the "probe-order" property in
> sys/boot/fdt/dts/beaglebone-black.dts (see attached
> beaglebone_black_mmc_probe_order.patch), I am able to swap the order in
> which the mmc units are probed/attached for that board.  This avoids
> inappropriate hacking of the mmc definition order in am335x.dtsi, which is
> shared among multiple boards.
> 
> This is not a general solution to the problem of wanting stable device
> names for hard-wired MMC devices when pluggable slots are present in the
> system.  There could, for example, be a multi-slot MMC controller with a
> mixture of hard-wired and pluggable devices attached, and this would not
> address that case.  However, it does address the needs of BeagleBone Black,
> and the mechanism may be of use for similar issues on other platforms.

As it isn’t a generic solution, I’d be biased against adopting it. What’s wrong
with using glabel to accomplish this (either with a label specific property, or
by using a ufs label and mounting /dev/ufs/foo).

Warner

> Both patches were generated against 10-STABLE, r262447.
> 
> -Patrick
> <fdt_probe_order_control.patch><beaglebone_black_probe_order.patch>_______________________________________________
> freebsd-arm at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "freebsd-arm-unsubscribe at freebsd.org"



More information about the freebsd-arm mailing list