On Sun, Jul 27, 2025 at 11:14 PM Peng Fan (OSS) <peng....@oss.nxp.com> wrote:
> diff --git a/drivers/ddr/imx/imx9/ddr_init.c b/drivers/ddr/imx/imx9/ddr_init.c > index > 5b0ad773875da9f6a57faa8c618b232056d1e702..7bade70bd0a1ca4d205ff4fb8525511188cb504f > 100644 > --- a/drivers/ddr/imx/imx9/ddr_init.c > +++ b/drivers/ddr/imx/imx9/ddr_init.c > @@ -291,6 +291,8 @@ void ddrc_mrs(u32 cs_sel, u32 opcode, u32 mr) > regval = (cs_sel << 28) | (opcode << 6) | (mr); > writel(regval, REG_DDR_SDRAM_MD_CNTL); > setbits_le32(REG_DDR_SDRAM_MD_CNTL, BIT(31)); > + while ((readl(REG_DDR_SDRAM_MD_CNTL) & 0x80000000) == 0x80000000) > + ; If this condition is not met, the system will hang forever. Better use readl_poll_timeout() instead.