Skip to contentSkip to conversation

qcom: Enable CONFIG_SKIP_EARLY_DM for Faster Boot

PATCH In review Aswin Murugan 2 participants 4 messages Nov 6 – Nov 26 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

v2 cover qcom: Enable CONFIG_SKIP_EARLY_DM for Faster Boot

Enable CONFIG_SKIP_EARLY_DM on Qualcomm platforms to improve boot time by approximately 50%. Address a serial driver crash seen with CONFIG_SKIP_EARLY_DM enabled by properly handling error pointers returned from clock operations during early boot.

Changes in v2:
- Move CONFIG_SKIP_EARLY_DM from qcom_defconfig to an imply on ARCH_SNAPDRAGON in Kconfig

Link to v1: https://lore.kernel.org/u-boot/[email protected]/#t

Aswin Murugan (2):
mach-snapdragon: Kconfig: imply SKIP_EARLY_DM for ARCH_SNAPDRAGON
serial: msm_geni: Fix clock enable on error pointer

 arch/arm/Kconfig                 | 1 +
 drivers/serial/serial_msm_geni.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/2 mach-snapdragon: Kconfig: imply SKIP_EARLY_DM for ARCH_SNAPDRAGON

Imply CONFIG_SKIP_EARLY_DM for ARCH_SNAPDRAGON to skip device model initialization during the pre-relocation phase, improving boot time by around 50% by deferring device probing until after relocation.

---
 arch/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/Kconfig +1 -0
index 3e9f3b51031..e9068d0d589 100644
@@ -1156,6 +1156,7 @@ config ARCH_SNAPDRAGON
 	select SUPPORT_SPL
 
 	select OF_LIVE
+	imply SKIP_EARLY_DM
 	select SPL_OF_LIVE if SPL
 	select ARMV8_SPL_EXCEPTION_VECTORS if SPL
 	select ENABLE_ARM_SOC_BOOT0_HOOK if SPL
Signature · 1 line
2.34.1
#2 lore raw

PATCH v2 2/2 serial: msm_geni: Fix clock enable on error pointer

In reply to Aswin Murugan

When CONFIG_SKIP_EARLY_DM is enabled and no clock driver is available during early serial init, devm_clk_get_optional() returns an error pointer. The original code attempted to enable this error pointer, causing a crash.

Fix by checking for both error pointers and NULL before calling clk_enable(), using IS_ERR_OR_NULL() to handle all cases properly.

---
 drivers/serial/serial_msm_geni.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/serial/serial_msm_geni.c +2 -1
index 30dab2c0cb8..94c37183855 100644
@@ -571,7 +571,8 @@ static int msm_serial_probe(struct udevice *dev)
 		priv->se = clk;
 
 	/* Try enable clock */
-	clk_enable(clk);
+	if (!IS_ERR_OR_NULL(clk))
+		clk_enable(clk);
 
 	/* Check if firmware loading is needed (BT UART) */
 	proto = readl(priv->base + GENI_FW_REVISION_RO);
Signature · 1 line
2.34.1
Reviewed-by on the v2 series
#3 lore raw
In reply to Aswin Murugan
Quoted 10 lines · Aswin Murugan

Enable CONFIG_SKIP_EARLY_DM on Qualcomm platforms to improve boot time by approximately 50%. Address a serial driver crash seen with CONFIG_SKIP_EARLY_DM enabled by properly handling error pointers returned from clock operations during early boot.

Changes in v2:
- Move CONFIG_SKIP_EARLY_DM from qcom_defconfig to an imply on ARCH_SNAPDRAGON in Kconfig

Quoted 5 lines

Link to v1: https://lore.kernel.org/u-boot/[email protected]/#t

Aswin Murugan (2):
mach-snapdragon: Kconfig: imply SKIP_EARLY_DM for ARCH_SNAPDRAGON
serial: msm_geni: Fix clock enable on error pointer

For the series:

-Sumit

Quoted 9 lines
 arch/arm/Kconfig                 | 1 +
 drivers/serial/serial_msm_geni.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.34.1