drivers: clk: stm32h7: Endless loop of dead in driver probe function

Johannes (krjdev) Krottmayer krjdev at gmail.com
Wed Mar 2 18:00:27 CET 2022


Hi,

Some IMHO fatal issues in the the clock driver for the
STM32H7 series driver.

Affected driver:
drivers/clk/clk_stm32h7.c

Affected configs (boards):
configs/stm32h750-art-pi_defconfig
configs/stm32h743-disco_defconfig
configs/stm32h743-eval_defconfig

Description:
The driver currently requires a external working clock source
(HSE). No issues in the circuit are accepted by the current
implementation. Also a fixed (defined) frequency of the external
clock source.

In the probe function stm32_clk_probe() from the driver there
will be configure_clocks() called. Here are the issues.

As code snippet from configure_clocks():

/* Switch on HSE */
setbits_le32(&regs->cr, RCC_CR_HSEON);
while (!(readl(&regs->cr) & RCC_CR_HSERDY))
	;

RCC_CR_HSERDY will here never set, when there is no external
clock source or an issue in the circuit. -> Endless loop of dead.

My possible fixes:
At a timeout when reading the register and if the timeout is
elapsed, print an error message and return with ETIMEDOUT, so
the dm manger can call the hang() function.

Johannes K.



More information about the U-Boot mailing list