Commit Graph
6 Commits
Author SHA1 Message Date
Dan Carpenter 6c29e29e4d PM / devfreq: mediatek: unlock on error in mtk_ccifreq_target()
Call mutex_unlock(&drv->reg_lock) before returning the error code.

Link: https://lore.kernel.org/all/[email protected]/
Fixes: d280560198 ("PM / devfreq: mediatek: protect oop in critical session")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
2023-10-17 17:54:01 +09:00
Mark Tseng d280560198 PM / devfreq: mediatek: protect oop in critical session
mtk_ccifreq_opp_notifier is reenter function when policy0 / policy6
change freq, so mutex_lock should protect all OPP event.

Link: https://lore.kernel.org/lkml/[email protected]/T/
Signed-off-by: Mark Tseng <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
2023-10-09 07:28:50 +09:00
Rob Herring 9027f2e797 PM / devfreq: Explicitly include correct DT includes
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
2023-07-24 05:19:26 +09:00
Sukrut Bellary a83bfdca8b PM / devfreq: mtk-cci: Fix variable deferencing before NULL check
smatch warning:
drivers/devfreq/mtk-cci-devfreq.c:135 mtk_ccifreq_target()
warn: variable dereferenced before check 'drv' (see line 130)

This is based on static analysis only. Compilation tested.

Signed-off-by: Sukrut Bellary <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
2023-05-29 23:25:31 +09:00
AngeloGioacchino Del Regno e09bd5757b PM / devfreq: mtk-cci: Handle sram regulator probe deferral
If the regulator_get_optional()	call for the SRAM regulator returns
a probe deferral, we must bail out and retry probing later: failing
to do this will	produce	unstabilities on platforms requiring the
handling for this regulator.

Fixes: b615b00c42da ("PM / devfreq: mediatek: Introduce MediaTek CCI devfreq driver")
Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
2022-09-26 03:59:12 +09:00
Johnson Wang 86d231b1db PM / devfreq: mediatek: Introduce MediaTek CCI devfreq driver
We introduce a devfreq driver for the MediaTek Cache Coherent Interconnect
(CCI) used by some MediaTek SoCs.

In this driver, we use the passive devfreq driver to get target frequencies
and adjust voltages accordingly. In MT8183 and MT8186, the MediaTek CCI
is supplied by the same regulators with the little core CPUs.

Signed-off-by: Jia-Wei Chang <[email protected]>
Signed-off-by: Johnson Wang <[email protected]>
Acked-by: Chanwoo Choi <[email protected]>
Tested-by: Kevin Hilman <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
2022-07-15 11:40:08 +09:00