qcom_configure_capsule_updates() unconditionally calls scsi_scan(),
re-scanning all SCSI children even when an earlier boot stage has
already bound them. Skip the rescan when UCLASS_SCSI already has
devices, keeping it as a fallback if none are bound yet.

~34ms saved on Qcom SoC bootup time.

Signed-off-by: Aswin Murugan <[email protected]>
---
 arch/arm/mach-snapdragon/capsule_update.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-snapdragon/capsule_update.c 
b/arch/arm/mach-snapdragon/capsule_update.c
index 586682434b7..0e2da22afcf 100644
--- a/arch/arm/mach-snapdragon/capsule_update.c
+++ b/arch/arm/mach-snapdragon/capsule_update.c
@@ -296,8 +296,8 @@ void qcom_configure_capsule_updates(void)
        enum target_part_type target_part_type = 0;
        enum uclass_id dev_uclass;
 
-       if (IS_ENABLED(CONFIG_SCSI)) {
-               /* Scan for SCSI devices */
+       if (IS_ENABLED(CONFIG_SCSI) && !uclass_id_count(UCLASS_SCSI)) {
+               /* Scan for SCSI devices, unless already scanned earlier in 
boot */
                ret = scsi_scan(false);
                if (ret) {
                        debug("Failed to scan SCSI devices: %d\n", ret);
-- 
2.34.1

Reply via email to