U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* drivers: clk: stm32h7: Endless loop of dead in driver probe function
@ 2022-03-02 17:00 Johannes (krjdev) Krottmayer
  2022-03-08  9:00 ` Patrick DELAUNAY
  0 siblings, 1 reply; 8+ messages in thread
From: Johannes (krjdev) Krottmayer @ 2022-03-02 17:00 UTC (permalink / raw)
  To: u-boot, dillon.minfei, patrice.chotard

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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-03-10  8:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-02 17:00 drivers: clk: stm32h7: Endless loop of dead in driver probe function Johannes (krjdev) Krottmayer
2022-03-08  9:00 ` Patrick DELAUNAY
2022-03-09  7:24   ` Johannes (krjdev) Krottmayer
2022-03-09  7:43     ` Patrice CHOTARD
2022-03-09  8:02       ` Johannes (krjdev) Krottmayer
2022-03-09  8:08         ` Patrice CHOTARD
2022-03-09 11:38           ` Johannes (krjdev) Krottmayer
2022-03-10  8:04             ` Patrice CHOTARD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox