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: 8a715530bb1 ("dm: core: Allow the uclass list to move")
2021-08-08 11:27:27 -06:00
..
2021-06-17 09:40:57 +08:00
2021-07-23 13:36:20 -04:00
2021-01-15 14:36:12 -05:00
2021-01-25 21:52:00 +00:00
2021-01-25 21:52:00 +00:00
2021-07-21 10:27:35 -06:00
2021-01-12 10:58:04 +05:30
2020-12-26 12:37:28 +01:00
2021-07-23 13:36:20 -04:00
2021-01-30 14:25:42 -07:00
2021-06-18 10:09:41 +02:00
2021-04-10 12:00:24 +02:00
2021-04-16 17:32:34 -04:00
2021-07-07 19:52:22 -04:00
2021-04-10 08:04:42 -04:00
2021-02-10 10:00:51 +01:00
2020-10-30 10:56:11 -04:00
2021-08-06 08:26:48 -04:00
2021-06-11 16:34:52 +05:30
2021-06-07 10:48:40 -04:00
2021-06-23 08:45:03 -04:00
2021-07-07 19:52:24 -04:00
2021-06-24 11:54:07 +05:30
2021-07-06 05:22:41 +03:00
2021-07-07 19:52:24 -04:00
2021-04-12 17:44:55 -04:00
2021-03-27 15:04:31 +13:00
2021-01-05 16:20:26 -05:00
2021-08-01 09:05:24 -06:00
2021-01-27 17:03:16 -05:00
2021-01-15 14:36:12 -05:00