Skip to contentSkip to conversation

rockchip: spl-boot-order: Defer probe of boot device

PATCH In review Jonas Karlman 2 participants 3 messages Aug 4, 2025 – Nov 1, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 rockchip: spl-boot-order: Defer probe of boot device

Boot devices are being probed when SPL boot order is determined, this may unnecessarily delay boot slightly.

Instead defer probe of the boot device until SPL try to load image from the boot device by using uclass_find_device_by_of_offset() instead of the get variant.

---
v2: Update commit message

---
 arch/arm/mach-rockchip/spl-boot-order.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-rockchip/spl-boot-order.c +2 -2
index 3dce9b30898d..6b1b84dc86d1 100644
@@ -40,7 +40,7 @@ static int spl_node_to_boot_device(int node)
 	 * aware of the block-device layer.  Until then (and to avoid unneeded
 	 * delays in getting this feature out), it lives at the board-level.
 	 */
-	if (!uclass_get_device_by_of_offset(UCLASS_MMC, node, &parent)) {
+	if (!uclass_find_device_by_of_offset(UCLASS_MMC, node, &parent)) {
 		struct udevice *dev;
 		struct blk_desc *desc = NULL;
 
@@ -72,7 +72,7 @@ static int spl_node_to_boot_device(int node)
 	 * extended with awareness of the BLK layer (and matching OF_CONTROL)
 	 * soon.
 	 */
-	if (!uclass_get_device_by_of_offset(UCLASS_SPI_FLASH, node, &parent))
+	if (!uclass_find_device_by_of_offset(UCLASS_SPI_FLASH, node, &parent))
 		return BOOT_DEVICE_SPI;
 
 	return -1;
Signature · 1 line
2.50.1
#1 lore raw

Hi Kever,

Please consider this patch for v2026.01.

Also found at https://patchwork.ozlabs.org/patch/2118921/

Regards,
Jonas

Quoted 36 lines · Jonas Karlman

Boot devices are being probed when SPL boot order is determined, this may unnecessarily delay boot slightly.

Instead defer probe of the boot device until SPL try to load image from the boot device by using uclass_find_device_by_of_offset() instead of the get variant.

---
v2: Update commit message

---
 arch/arm/mach-rockchip/spl-boot-order.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-rockchip/spl-boot-order.c +2 -2
index 3dce9b30898d..6b1b84dc86d1 100644
@@ -40,7 +40,7 @@ static int spl_node_to_boot_device(int node)
 	 * aware of the block-device layer.  Until then (and to avoid unneeded
 	 * delays in getting this feature out), it lives at the board-level.
 	 */
-	if (!uclass_get_device_by_of_offset(UCLASS_MMC, node, &parent)) {
+	if (!uclass_find_device_by_of_offset(UCLASS_MMC, node, &parent)) {
 		struct udevice *dev;
 		struct blk_desc *desc = NULL;
 
@@ -72,7 +72,7 @@ static int spl_node_to_boot_device(int node)
 	 * extended with awareness of the BLK layer (and matching OF_CONTROL)
 	 * soon.
 	 */
-	if (!uclass_get_device_by_of_offset(UCLASS_SPI_FLASH, node, &parent))
+	if (!uclass_find_device_by_of_offset(UCLASS_SPI_FLASH, node, &parent))
 		return BOOT_DEVICE_SPI;
 
 	return -1;
Reviewed-by on v2 1/1
#2 lore raw
In reply to Jonas Karlman
Quoted 8 lines · Jonas Karlman

Boot devices are being probed when SPL boot order is determined, this may unnecessarily delay boot slightly.

Instead defer probe of the boot device until SPL try to load image from the boot device by using uclass_find_device_by_of_offset() instead of the get variant.

Thanks,
- Kever

Quoted 28 lines

---
v2: Update commit message

---
  arch/arm/mach-rockchip/spl-boot-order.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-rockchip/spl-boot-order.c +2 -2
index 3dce9b30898d..6b1b84dc86d1 100644
@@ -40,7 +40,7 @@ static int spl_node_to_boot_device(int node)
  	 * aware of the block-device layer.  Until then (and to avoid unneeded
  	 * delays in getting this feature out), it lives at the board-level.
  	 */
-	if (!uclass_get_device_by_of_offset(UCLASS_MMC, node, &parent)) {
+	if (!uclass_find_device_by_of_offset(UCLASS_MMC, node, &parent)) {
  		struct udevice *dev;
  		struct blk_desc *desc = NULL;
 
@@ -72,7 +72,7 @@ static int spl_node_to_boot_device(int node)
  	 * extended with awareness of the BLK layer (and matching OF_CONTROL)
  	 * soon.
  	 */
-	if (!uclass_get_device_by_of_offset(UCLASS_SPI_FLASH, node, &parent))
+	if (!uclass_find_device_by_of_offset(UCLASS_SPI_FLASH, node, &parent))
  		return BOOT_DEVICE_SPI;
 
  	return -1;