qcom: Enable CONFIG_SKIP_EARLY_DM for Faster Boot
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.
Aswin Murugan (2):
configs: qcom_defconfig: Enable CONFIG_SKIP_EARLY_DM
serial: msm_geni: Fix clock enable on error pointer
configs/qcom_defconfig | 1 + drivers/serial/serial_msm_geni.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.34.1
PATCH RESEND 1/2 configs: qcom_defconfig: Enable CONFIG_SKIP_EARLY_DM
Enable CONFIG_SKIP_EARLY_DM to skip device model initialization during pre-relocation phase, improving boot time by around 50% by deferring device probing until after relocation.
--- configs/qcom_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/qcom_defconfig +1 -0
@@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_SKIP_LOWLEVEL_INIT=y +CONFIG_SKIP_EARLY_DM=y CONFIG_POSITION_INDEPENDENT=y CONFIG_SYS_INIT_SP_BSS_OFFSET=0x180000 CONFIG_ARCH_SNAPDRAGON=y
Signature · 1 line
2.34.1
Re: [PATCH RESEND v1 1/2] configs: qcom_defconfig: Enable CONFIG_SKIP_EARLY_DM
Quoted 15 lines · Aswin Murugan
Enable
CONFIG_SKIP_EARLY_DMto skip device model initialization during pre-relocation phase, improving boot time by around 50% by deferring device probing until after relocation.Reviewed-by Casey Connolly <[email protected]>Signed-off-by Aswin Murugan <[email protected]>--- configs/qcom_defconfig | 1 + 1 file changed, 1 insertion(+)configs/qcom_defconfig +0
-0
configs/qcom_defconfig line 6
Quoted 6 lines
configs/qcom_defconfig +1
-0@@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_SKIP_LOWLEVEL_INIT=y +CONFIG_SKIP_EARLY_DM=y CONFIG_POSITION_INDEPENDENT=y CONFIG_SYS_INIT_SP_BSS_OFFSET=0x180000 CONFIG_ARCH_SNAPDRAGON=y
Given the number of platforms which also build on top of this defconfig, is this safe to do everywhere? And since this was something introduced for Qualcomm platforms, you should be doing "default y if ..." in the Kconfig, or imply SKIP_EARLY_DM in arch/arm/mach-snapdragon/Kconfig instead.
Signature · 1 line
Tom
PATCH RESEND 2/2 serial: msm_geni: Fix clock enable on error pointer
In reply to Aswin MuruganWhen 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
@@ -527,7 +527,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