qcom: Enable CONFIG_SKIP_EARLY_DM for Faster Boot
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
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
@@ -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
PATCH v2 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
@@ -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
Quoted 10 lines · Aswin Murugan
Enable
CONFIG_SKIP_EARLY_DMon Qualcomm platforms to improve boot time by approximately 50%. Address a serial driver crash seen withCONFIG_SKIP_EARLY_DMenabled by properly handling error pointers returned from clock operations during early boot.Changes in v2:
- MoveCONFIG_SKIP_EARLY_DMfromqcom_defconfigto an imply onARCH_SNAPDRAGONinKconfig
Quoted 5 lines
Link to v1: https://lore.kernel.org/u-boot/[email protected]/#t
Aswin Murugan (2):
mach-snapdragon:Kconfig: implySKIP_EARLY_DMforARCH_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