[PATCH 17/17] ARM: i.MX Phytec physom: Add deep-probe support

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Apr 26 10:36:11 BST 2021


Hi,

On 26.04.21 11:20, Marco Felsch wrote:
>> How about changing BAREBOX_DEEP_PROBE_ENABLE so BAREBOX_DEEP_PROBE_ENABLE(physom_imx6_match);
>> works? Updated boards should be using board drivers anyway, so make it easier for them to
>> enable deep probe.
> 
> Hi Ahmad,
> 
> Why do I need to chnage it to board drivers if I only wanna fix a probe
> order issue? But you're right adding the _match table should be possible
> to :)

Either you have board code at a single init level and changing to a board driver
will be very straight-forward. Or you have multiple initcalls, which expect
drivers at prior initcall levels to have probed a device, which will be broken
by a move to deep probe.

>> I'd go even further and require board drivers by having it take a driver_d * as argument
>> and introduce deep_probe_board_driver() that expands to postcore_platform_driver and
>> BAREBOX_DEEP_PROBE_ENABLE.
> 
> How about this:
>  1st) adding a probe_enum like kernel and introduce PROBE_PREFER_DEEP
>  2nd) adding a deep_probe_enable_board() function to common/deep_probe.c
>  3th) checking during register_driver() if the flag is set and call the
>       deep_probe_enable_board().
> 
> This allows use to still use the macro mechanism and the boards already
> converted to the board driver style can use this simple enum to mark all
> boards as deep-probable.

I don't see how that would work. deep_probe_is_supported() is called on oftree
registration, which is prior to the board driver's register_driver.
I thought that's the point of the linker array: You need the info too early
to be able to dynamically register a board.

Cheers,
Ahmad

> 
> Regards,
>   Marco
> 
>> This would prevent having a board driver that's deep probe incompatible in the
>> first place, because it will likely not find the resources it requires that early
>> if it doesn't deep probe.
>>
>> Cheers,
>> Ahmad
>>
>> -- 
>> Pengutronix e.K.                           |                             |
>> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
>> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
>> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
>>
>> _______________________________________________
>> barebox mailing list
>> barebox at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/barebox
>>
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list