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

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


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

Affected driver:

Affected configs (boards):

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