1
0
mirror of https://xff.cz/git/u-boot/ synced 2026-02-16 13:19:30 +01:00
Files
u-boot-megous/test/dm
Simon Glass 1e9ced28f1 dm: core: Don't allow uclass use before ready
At present it is possible to call uclass_get() before driver model is
inited. In fact this happens on x86 boards which use Intel FSPv1, since
mrccache_get_region() tries to get the SPI flash device very early
during init.

This has always been undefined behaviour. Previously it generally worked,
i.e. returned an error code without crashing, because gd->uclass_root_s
is zeroed and the uclass can be added despite driver model not being
ready, due to the way lists are implemented. With the change to use a
gd->uclass_root pointer, this no-longer works. For example, it causes a
hang on minnowmax.

Fix this by adding a check that driver model is ready when uclass_get() is
called. This function is called in the process of locating any device, so
it is a good place to add the check.

This fixes booting on minnowmax.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 8a715530bb ("dm: core: Allow the uclass list to move")
2021-08-08 11:27:27 -06:00
..
2020-07-17 14:32:24 +08:00
2021-07-21 10:27:35 -06:00
2021-01-12 10:58:04 +05:30
2021-01-30 14:25:41 -07:00
2020-07-01 15:01:21 +08:00
2020-10-08 11:42:36 -04:00
2021-02-26 15:30:55 +01:00
2021-06-28 16:22:13 -04:00
2021-05-26 17:26:07 -04:00
2021-03-27 15:04:31 +13:00
2021-05-04 07:57:18 -04:00
2020-11-05 09:11:30 -07:00
2021-02-16 11:48:20 -05:00
2020-10-22 09:54:53 -04:00