Skip to contentSkip to conversation

clk: imx: Add some delay before deassert the reset

PATCH Applied Jacky Bai 2 participants 2 messages Aug 1, 2025 – Nov 11, 2025

Subsystems (3)
lore
Share & tools
lore

Jacky Bai

author
#0 lore raw

PATCH v2 1/1 clk: imx: Add some delay before deassert the reset

Some of the PCCs on i.MX8ULP have a sw_rst bit to control the peripheral reset through SW method. For peripherals like GPU that need sync reset, some delay is necessary befere & after release the reset to make sure the HW is reset into a known status. So add some delay before & after release reset.

---
- v2 changes:
- refine the commit log at 75 char
- add a readl after write to make sure the write has been done in target register

---
 drivers/clk/imx/clk-composite-7ulp.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/clk/imx/clk-composite-7ulp.c +13 -0
index 8ed2e0ad2769..37d2fc197be6 100644
@@ -7,6 +7,7 @@
 
 #include <linux/bits.h>
 #include <linux/clk-provider.h>
+#include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/io.h>
 #include <linux/slab.h>
@@ -36,6 +37,9 @@ static int pcc_gate_enable(struct clk_hw *hw)
 	if (ret)
 		return ret;
 
+	/* Make sure the IP's clock is ready before release reset */
+	udelay(1);
+
 	spin_lock_irqsave(gate->lock, flags);
 	/*
 	 * release the sw reset for peripherals associated with
@@ -47,6 +51,15 @@ static int pcc_gate_enable(struct clk_hw *hw)
 
 	spin_unlock_irqrestore(gate->lock, flags);
 
+	/*
+	 * Read back the register to make sure the previous write has been
+	 * done in the target HW register. For IP like GPU, after deassert
+	 * the reset, need to wait for a while to make sure the sync reset
+	 * is done
+	 */
+	readl(gate->reg);
+	udelay(1);
+
 	return 0;
 }
 
Signature · 1 line
2.34.1
Applied
#1 lore raw
Quoted 8 lines · Jacky Bai

Some of the PCCs on i.MX8ULP have a sw_rst bit to control the peripheral reset through SW method. For peripherals like GPU that need sync reset, some delay is necessary befere & after release the reset to make sure the HW is reset into a known status. So add some delay before & after release reset.

[...]

Applied, thanks!

[1/1] clk: imx: Add some delay before deassert the reset

      commit: 25b47635f8729e9536d2652774bd509532eaa522

Best regards,

Signature · 1 line
Abel Vesa <[email protected]>