scmi clk id refcount vs real clock id
Created by: vingu-linaro
As part of the project that i'm working on to have a SCP-firmware running as a scmi backend for linux guest VM, I have tested how shared clocks are managed and found a strange behavior. My setup is :
SCMI have 3 internal clocks C0, C, C2 and there are 2 SCMI agents :
For agent A, the clocks are listed as below: scmi clk id 0 : clock C0 scmi clk id 1 : clock C1
For agent B, the clocks are listed as below: scmi clk id 0 : clock C2
agent A enables its scmi clk id 0 / clock C0 agent B wants to enable its scmi clk id 0 / clock C2 but SCMI server consider that it is already enable and doesn't do anything.
It seems that the server uses the scmi clk id to refcount the use of a clock but the same scmi clock id of 2 different agents can refer to 2 different HW clock.
Further tests show that there are problems even if the scmi clock agents refers to the same HW clock.
Moved from gitlab.arm.com to github.com