MMRM clients may set a clock rate which is greater than max supported
rate for the clock. To perform peak power calculations, round the rate
with clk_round_rate() to get the rounded (max supported) value. Use the
client-set value to set the rate to clock driver, which internally
rounds the rate to the supported value also.
Change-Id: Ie9b4f5077244c8f43a2f7de2f9d6b284843091f1
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
Add support for clock clients managed by CRM (CESTA Resource Manager):
-Introduce structures to register CRM clock clients.
-Introduce changes in MMRM set_value API to support the new clock set_rate
API for SW/HW CRM clients.
-Modify peak current calculation to consider the maximum rate from all
SW and HW DRV instances of a clock client.
Change-Id: Iaddc835223f3dc3b43c443f99bb8a34e9b7e4498
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
Use TARGET_KERNEL_DLKM_DISABLE and TARGET_KERNEL_DLKM_MMRM_OVERRIDE
to compile MMRM driver.
Change-Id: I3156d696f372a9c178356aead7c3c8813980641e
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
Moving peak-current threshold to DT to ensure that it'll get configured correctly on different targets.
Change-Id: I7c1a7f8dd6ba818f7a1ee14de735729fb6f3abcb
Signed-off-by: Mark Bao <quic_mbao@quicinc.com>
QMAA dependency is causing dlkm compilation along with incorrect
copy of mmrm ko to vendor_dlkm.
Change-Id: If03359a70af0e64ce8f2bbba468d68ef15ae053b
Signed-off-by: Shivendra Kakrania <shiven@codeaurora.org>
Some of targets doesn't need MMRM but need binary compatibility
with targets which support MMRM.
A new api is added to support such scenarios & to ensure that
MMRM is disabled & MM clients can fall back to clk api.
Change-Id: I72514889bffc48174c18e1e764751d2f4595570e
Signed-off-by: Shivendra Kakrania <shiven@codeaurora.org>
While adjusting the voltage corner for all clients, number of
hw instances in not included. Also when calculating the old
current of a client number of hw blocks is not included.
Fixed the calculations to project the correct current calculation
when either overall voltage corner is adjested or corner is adjusted
for a client.
Change-Id: I4ee9bb02275fda61c72dce99f41dbf73b4cf8fc5
Signed-off-by: Shivendra Kakrania <shiven@codeaurora.org>
Print enabled mmrm client info during runtime.
This will be a helpful debugging feature to identy the
enabled clients, corresponding power info & aggregated numbers.
Change-Id: I01734843d28e7a21c622dcb1ff6263aa1c2c156c
Signed-off-by: mbao <mbao@codeaurora.org>
Updating the supported number of hw blocks as per HSR guidance.
Change-Id: I3f7f465aa28c35c112f51925beb7e945eb0c84a9
Signed-off-by: Shivendra Kakrania <shiven@codeaurora.org>
Don't check num hw block parameter, when set clk rate to 0.
Change-Id: I7f94a6413487f11156c5d1ec10467cd016a8700b
Signed-off-by: mbao <mbao@codeaurora.org>
Ensure to remove throttled client only when
reentry is possible. Not doing so caused
throttled client removed from link list without
throttled client reentered.
Print the notifier processing time & check if
its taking more than expected.
Change-Id: Iee97cba0ee68713e7f17d4afae2ba327f7c6b8ea
Signed-off-by: Mahesh Kumar Sharma <smahesh@codeaurora.org>
Update delta current correctly after client
was throttled.
Change-Id: I3b51f8eb7f94d3659dea5dde6e16537fbc0de87d
Signed-off-by: Mahesh Kumar Sharma <smahesh@codeaurora.org>
Add number of hw blocks support for peak current calculation.
With this support multiple blocks of same clock can be accounted
for peak current.
Change-Id: I277636cedc4cda731fc845dcba3e742e840446d4
Signed-off-by: mbao <mbao@codeaurora.org>
As voltage corners are shared among the clients
ranging from low to high priority. In order to
accomodate power requirement of high priority clients,
MMRM driver may throttle a client which is lower priority.
Added logic to bookkeep these clients and try to
reinstate them at later point of time.
Signed-off-by: Mahesh Kumar Sharma <smahesh@codeaurora.org>
Dump current state of all registered clients when low
prority clients request can't be entertained.
Signed-off-by: Mahesh Kumar Sharma <smahesh@codeaurora.org>
In order to improve debugging of mmrm
issues, add support of MMRM power print and
remove some unnecessary logging or decrease
priority to low.
Signed-off-by: Mahesh Kumar Sharma <smahesh@codeaurora.org>
Ensure to calculate correct adjusted level
when reuested level is lower than aggregate level.
Signed-off-by: Mahesh Kumar Sharma <smahesh@codeaurora.org>
Add support of low priority voltage corners lowsvs and
svs in mmrm driver.
This logic maintains a list of clients which are to be
proritize to be throtlled to low power in order to satisfy
high priority client's power requiretment.
Change-Id: Ia7f912e41bbcff057c0732cc7c2b16e327c59fd8
Signed-off-by: Mahesh Kumar Sharma <smahesh@codeaurora.org>
if mmrm client was registered, client register will output dyn_pwr,
leak_pwr total pwr, and current Max for mmrm-test-module
Change-Id: I34aeef778f42f106780b72543a3458627ce09935
Signed-off-by: mbao <mbao@codeaurora.org>
Enable or disable throttling feature by writing
correct value to msm_mmrm debugfs.
Change-Id: If2b06e061ddd102c42d0f5517d3c0be4fc9f6669
Signed-off-by: Mahesh Kumar Sharma <smahesh@codeaurora.org>
Throttle low priority client to handle the resource request
of high priority clients. During peak overshoot due to HIGH priority
MMRM driver, identify the low priority victim core to be throttled to
honor high prority client request.
Change-Id: I30aa2793f2c36063cf3096ef86ed21cb87e1179f
Signed-off-by: "Mahesh Kumar Sharma <smahesh@codeaurora.org>"
For error cases, updating only client register related entries.
Change-Id: I78703f15f7436aa28d280a2b753655681a4f13eb
Signed-off-by: mbao <mbao@codeaurora.org>
Added support to allow multiple register of same client so that mmrm
test app can be used after device is booted up.
This will also allow to test multiple concurrencies as well as
throttling feature.
Depends-on: 3630372
Change-Id: I19a2838f536d36db0629d9d64c962aba57c92d28