On 11/7/25 1:16 PM, Peng Fan wrote:

Hello Peng,

On Fri, Nov 07, 2025 at 04:01:26AM +0100, Marek Vasut wrote:
Instead of resolving clock control flags using SCMI_CLOCK_ATTRIBUTES
during probe for each and every clock, resolve the clock control
flags using SCMI_CLOCK_ATTRIBUTES when the clock control flags are
first used. Because most clock are never used by U-Boot, this allows
reducing the amount of SCMI_CLOCK_ATTRIBUTES considerably, and this
improve probe time of the scmi clock driver and U-Boot start up time.

On Renesas X5H, with 1700+ SCMI clock, the boot time improved by 1.7s .


static int scmi_clk_get_ctrl_flags(struct clk *clk, u32 *ctrl_flags)
{
+       struct udevice *dev = clk->dev->parent;

I will change this to "clk->dev", otherwise there is CI failure.

What kind of CI failure ?

No need to use clk->dev->parent here. The core code will
find out the scmi root device.

No need send v3, I could patch it in tree if no objections.
This change would be wrong, so please do not do that. Apply this patch:

"
diff --git a/drivers/clk/clk_scmi.c b/drivers/clk/clk_scmi.c
index 4e8e5a262c8..99fd9679634 100644
--- a/drivers/clk/clk_scmi.c
+++ b/drivers/clk/clk_scmi.c
@@ -168,6 +168,7 @@ static int scmi_clk_gate(struct clk *clk, int enable)
 static int scmi_clk_get_ctrl_flags(struct clk *clk, u32 *ctrl_flags)
 {
        struct udevice *dev = clk->dev->parent;
+printf("clk->dev->name=%s clk->dev->parent->name=%s\n", clk->dev->name, clk->dev->parent->name);
        struct clk_scmi *clkscmi;
        u32 attributes;
        struct clk *c;
"

When U-Boot starts, the output looks this way:

"
clk->dev->name=scmi-325 clk->dev->parent->name=protocol@14
"

Notice "clk->dev->parent->name=protocol@14" , which is correct, therefore the clk->dev->parent is correct.

With the "clk->dev" change applied, the wrong device is used and the system starts producing failures:

"
scmi-over-mailbox scmi: Buffer too small: hdr->length:32, out_msg_sz:24
"

What kind of CI failure do you observe ?

Reply via email to