14.04.2020 17:54, Thierry Reding пишет: ... >> I'd suggest to check how much time invocation of ktime_get() takes, at >> least it came to a surprise to me in a case of the tegra-cpuidle driver. >> >> It may be well over the emc->clkchange_delay. > > I assume that at least each invocation would take roughly the same > amount of time? Not sure. > Since we only use the value to compute the time since > the last clock change the result should always be valid. In the worst > case if ktime_get() really takes that long we may be waiting longer > than we need to, but that wouldn't be all that bad either. Changing > the EMC clock rate isn't something that you want to do a lot. Then probably should be cleaner and simpler to have a constant delay in the code?