wfi and wfe redundancy

Min Lee hn.min.lee at gmail.com
Sun Oct 9 21:34:45 PDT 2022


Hi Suzuki,

I am writing to ask you whether the code you wrote is including redundancy or not.
The commit is https://github.com/iamroot19/linux/commit/bb9052744f4b7ae11d0061ac9492dd2949981b49.
wfi has been added in __no_granule_support function through your commit. Thus, there are wfe and also wfi.
The function saves an error code into one of the memory spaces, then falls into an infinite loop. In the loop, wfe and wfi are used to save power.
There is no possibility that generates an event on the sequence, so wfe is enough to keep the core asleep. I think that's why the previous code used only wfe.
Interrupts can also wake up the core that is sleeping by wfe, but this is also not enough to explain why wfi is needed because only one, wfe or wfi, is needed for saving power.
Would you please tell me why both wfe and wfi are needed?

Best,
Min



More information about the linux-arm-kernel mailing list