On 5/18/26 14:07, Maarten Brock wrote:
Hello Michal,

-----Original Message-----
From: Michal Simek <[email protected]>
On 5/18/26 12:21, Maarten Brock wrote:

Although properly commented, I find the reset_reset_bulk() implementation
counterintuitive. Are we so certain that the Linux implementation is the right
and obvious one? I personally would prefer to have it assert all resets at the
same time. It is faster and prevents races if the resets are interdependent.

Why do you think that it is faster?

I expect you would like to do it like this right?

int reset_reset_bulk(struct reset_ctl_bulk *bulk, ulong delay_us)
{
        int ret;

        ret = reset_assert_bulk(bulk);
        if (ret) {
                dev_err(bus, "Failed to assert reset: %d\n", ret);
                return ret;
        }

        udelay(delay_us);

        /* Deassert all OSPI reset lines */
        ret = reset_deassert_bulk(bulk);
        if (ret) {
                dev_err(bus, "Failed to deassert reset: %d\n", ret);
                return ret;
        }

        return 0;
}

That is correct.
And a single delay of delay_us takes less time than N*delay_us (for N>1), so 
the total startup time is smaller (a.k.a. faster startup).

It really depends on other factors and delay time. In our case it is not just MMIO access. But it is SMC to TF-A and then seconding request over mailbox to another firmware to ack it first and then do it. And with above you would have to do twice compare to once.

I can do another optimization which is that if bulk->count is 1 then call reset_reset() directly and for others do what you see above.

What do you think?

Thanks,
Michal

Reply via email to