History log of /linux-master/drivers/devfreq/exynos-bus.c
Revision Date Author Comments
# ccb69e22 18-May-2023 Marek Szyprowski <m.szyprowski@samsung.com>

PM / devfreq: exynos: add Exynos PPMU as a soft module dependency

Commit adf8238ef403 ("ARM: dts: exynos: move exynos-bus nodes out of soc
in Exynos4412") changed the order of the exynos-bus nodes, what results
in different probe order of the Exynos Bus devices. Although the driver
properly handles the deferred probe and all devices seems to be finally
properly registered, this change revealed some kind of a bug related to
PPMU counters registration and passive governor operation. Usually in 1
of 10 boots this results in complete board freeze during loading of the
kernel modules.

To avoid that freeze, ensure that the Exynos PPMU driver is already
loaded before the Exynos Bus driver starts probing.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>


# b7405e3f 10-Mar-2023 Rob Herring <robh@kernel.org>

PM / devfreq: exynos: Use of_property_present() for testing DT property presence

It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties. As
part of this, convert of_get_property/of_find_property calls to the
recently added of_property_present() helper when we just want to test
for presence of a property and nothing more.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>


# f9d0393a 11-Mar-2023 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

PM / devfreq: exyos-bus: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).

drivers/devfreq/exynos-bus.c:504:34: error: ‘exynos_bus_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>


# b0ec0942 04-Jul-2022 Viresh Kumar <viresh.kumar@linaro.org>

OPP: Migrate set-regulators API to use set-config helpers

Now that we have a central API to handle all OPP table configurations,
migrate the set-regulators family of helpers to use the new
infrastructure.

The return type and parameter to the APIs change a bit due to this,
update the current users as well in the same commit in order to avoid
breaking builds.

Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>


# 87686cc8 04-Jul-2022 Viresh Kumar <viresh.kumar@linaro.org>

OPP: Make dev_pm_opp_set_regulators() accept NULL terminated list

Make dev_pm_opp_set_regulators() accept a NULL terminated list of names
instead of making the callers keep the two parameters in sync, which
creates an opportunity for bugs to get in.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Steven Price <steven.price@arm.com> # panfrost
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>


# c8934e4e 01-Jul-2022 Christian Marangi <ansuelsmth@gmail.com>

PM / devfreq: exynos-bus: Fix NULL pointer dereference

Fix exynos-bus NULL pointer dereference by correctly using the local
generated freq_table to output the debug values instead of using the
profile freq_table that is not used in the driver.

Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Fixes: b5d281f6c16d ("PM / devfreq: Rework freq_table to be local to devfreq struct")
Cc: stable@vger.kernel.org
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>


# 81456872 05-Nov-2020 Viresh Kumar <viresh.kumar@linaro.org>

PM / devfreq: exynos: dev_pm_opp_put_*() accepts NULL argument

The dev_pm_opp_put_*() APIs now accepts a NULL opp_table pointer and so
there is no need for us to carry the extra check. Drop them.

Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>


# 404d59c5 12-Nov-2020 Sylwester Nawrocki <s.nawrocki@samsung.com>

PM / devfreq: exynos-bus: Add registration of interconnect child device

This patch adds registration of a child platform device for the exynos
interconnect driver. It is assumed that the interconnect provider will
only be needed when #interconnect-cells property is present in the bus
DT node, hence the child device will be created only when such a property
is present.

Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>


# 02bdbf7d 08-Sep-2020 Chanwoo Choi <cw00.choi@samsung.com>

PM / devfreq: event: Change prototype of devfreq_event_get_edev_by_phandle function

Previously, devfreq core support 'devfreq-events' property in order to get
the devfreq-event device by phandle. But, 'devfreq-events' property name is
not proper on devicetree binding because this name doesn't mean
the any h/w attribute.

The devfreq-event core hand over the rights to decide the property name
for getting the devfreq-event device on devicetree. Each devfreq-event driver
will decide the property name on devicetree binding and then pass
the their own property name to devfreq_event_get_edev_by_phandle function.

And change the prototype of devfreq_event_get_edev_count function
because of used deprecated 'devfreq-events' property.

Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>


# 86d90fd9 08-Sep-2020 Chanwoo Choi <cw00.choi@samsung.com>

PM / devfreq: Change prototype of devfreq_get_devfreq_by_phandle function

Previously, devfreq core support 'devfreq' property in order to get
the devfreq device by phandle. But, 'devfreq' property name is not proper
on devicetree binding because this name doesn't mean the any h/w attribute.

The devfreq core hand over the right to decide the property name
for getting the devfreq device on devicetree. Each devfreq driver
will decide the property name on devicetree binding and pass
the their own property name to devfreq_get_devfreq_by_phandle function.

Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>


# 28135762 24-Dec-2019 Yangtao Li <tiny.windzz@gmail.com>

PM / devfreq: exynos-bus: Add error log when fail to get devfreq-event

Adding an error log makes it easier to trace the function's error path.
Because the error code may be rewritten on return, print error code here.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>


# 6c315d8f 22-Dec-2019 Yangtao Li <tiny.windzz@gmail.com>

PM / devfreq: exynos-bus: Disable devfreq-event device when fails

The exynos_bus_profile_init process may fail, but the devfreq event device
remains enabled. Call devfreq_event_disable_edev on the error return path.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>


# a4408921 16-Dec-2019 Artur Świgoń <a.swigon@samsung.com>

PM / devfreq: exynos-bus: Reduce goto statements and remove unused headers

Improve code readability by changing the goto statements
as well as eliminating a few more goto statements (related to return
paths). Moreover, remove unused header file and adds a missing <linux/of.h>.

Signed-off-by: Artur Świgoń <a.swigon@samsung.com>
[cw00.choi: Edit patch title and description]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>


# a05bb963 09-Dec-2019 Artur Świgoń <a.swigon@samsung.com>

PM / devfreq: exynos-bus: Extract exynos_bus_profile_init_passive()

This patch adds a new exynos_bus_profile_init_passive()
extracted from exynos_bus_probe() for devfreq device using passive governor.

Signed-off-by: Artur Świgoń <a.swigon@samsung.com>
[cw00.choi: Edit description to indicate that function is for devfreq device
using passive governor]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>


# a47a97ec 09-Dec-2019 Artur Świgoń <a.swigon@samsung.com>

PM / devfreq: exynos-bus: Extract exynos_bus_profile_init()

This patch adds a new exynos_bus_profile_init() extracted
from exynos_bus_probe() for devfreq device using simple_ondemand governor
like parent devfreq device.

Signed-off-by: Artur Świgoń <a.swigon@samsung.com>
[cw00.choi: Edit description to indicate that new function is
for parent devfreq device]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>


# 4294a779 07-Aug-2019 Kamil Konieczny <k.konieczny@samsung.com>

PM / devfreq: exynos-bus: Convert to use dev_pm_opp_set_rate()

Reuse opp core code for setting bus clock and voltage. As a side
effect this allow usage of coupled regulators feature (required
for boards using Exynos5422/5800 SoCs) because dev_pm_opp_set_rate()
uses regulator_set_voltage_triplet() for setting regulator voltage
while the old code used regulator_set_voltage_tol() with fixed
tolerance. This patch also removes no longer needed parsing of DT
property "exynos,voltage-tolerance" (no Exynos devfreq DT node uses
it). After applying changes both functions exynos_bus_passive_target()
and exynos_bus_target() have the same code, so remove
exynos_bus_passive_target(). In exynos_bus_probe() replace it with
exynos_bus_target.

Signed-off-by: Kamil Konieczny <k.konieczny@partner.samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>


# 2c2b20e0 07-Aug-2019 Kamil Konieczny <k.konieczny@samsung.com>

PM / devfreq: exynos-bus: Correct clock enable sequence

Regulators should be enabled before clocks to avoid h/w hang. This
require change in exynos_bus_probe() to move exynos_bus_parse_of()
after exynos_bus_parent_parse_of() and change in error handling.
Similar change is needed in exynos_bus_exit() where clock should be
disabled before regulators.

Signed-off-by: Kamil Konieczny <k.konieczny@partner.samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>


# d2912cb1 04-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500

Based on 2 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Enrico Weigelt <info@metux.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# fbb9c3c9 21-Mar-2019 Marek Szyprowski <m.szyprowski@samsung.com>

PM / devfreq: exynos-bus: Suspend all devices on system shutdown

Force all Exynos buses to safe operation points before doing the system
reboot operation. There are board on which some aggressive power saving
operation points are behind the capabilities of the bootloader to properly
reset the hardware and boot the board. This way one can avoid board crash
early after reboot.

This fixes reboot issue on OdroidU3 board both with eMMC and SD boot.

Reported-by: Markus Reichl <m.reichl@fivetechno.de>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>


# aa7c352f 22-Oct-2017 Chanwoo Choi <cw00.choi@samsung.com>

PM / devfreq: Define the constant governor name

Prior to that, the devfreq device uses the governor name when adding
the itself. In order to prevent the mistake used the wrong governor name,
this patch defines the governor name as a constant and then uses them
instead of using the string directly.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org


# 7b70246c 01-Dec-2016 Chanwoo Choi <cw00.choi@samsung.com>

PM / devfreq: exynos-bus: Print the real clock rate of bus

This patch shows the real clock rate after calling clk_set_rate()
to debug it.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>


# 8a31d9d9 22-Jan-2017 Viresh Kumar <viresh.kumar@linaro.org>

PM / OPP: Update OPP users to put reference

This patch updates dev_pm_opp_find_freq_*() routines to get a reference
to the OPPs returned by them.

Also updates the users of dev_pm_opp_find_freq_*() routines to call
dev_pm_opp_put() after they are done using the OPPs.

As it is guaranteed the that OPPs wouldn't get freed while being used,
the RCU read side locking present with the users isn't required anymore.
Drop it as well.

This patch also updates all users of devfreq_recommended_opp() which was
returning an OPP received from the OPP core.

Note that some of the OPP core routines have gained
rcu_read_{lock|unlock}() calls, as those still use RCU specific APIs
within them.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> [Devfreq]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 32dd7731 28-Dec-2016 Chanwoo Choi <cw00.choi@samsung.com>

PM / devfreq: exynos-bus: Fix the wrong return value

This patch fixes the wrong return value. If devfreq driver requires the wrong
and non-available governor, it is fail. So, this patch returns the error
insead of -EPROBE_DEFER.

Fixes: 403e0689d2a9 (PM / devfreq: exynos: Add support of bus frequency of sub-blocks using passive governor)
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# c8ce82b9 01-Dec-2016 Viresh Kumar <viresh.kumar@linaro.org>

devfreq: exynos: Don't use OPP structures outside of RCU locks

The OPP structures are abused to the best here, without understanding
how the OPP core and RCU locks work.

In short, the OPP pointer saved 'struct exynos_bus' can become invalid
under your nose, as the OPP core may free it.

Fix various abuses around OPP structures and calls.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# d8150d14 01-Jul-2016 Peter Chen <peter.chen@nxp.com>

PM / devfreq: exynos-bus: add missing of_node_put after calling of_parse_phandle

of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.

[Commit updated to fix an error by MyungJoo]

Cc: Chanwoo Choi <cw00.choi@samsung.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>


# c07e074b 28-Jun-2016 Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

PM / devfreq: exynos: fix error path in exynos_bus_probe()

In case of exynos_bus_parse_of() failure the code shouldn't
try to remove the OPP table and disable+unprepare bus->clk
as it has been already handled in exynos_bus_parse_of().

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>


# 83cb0e4d 29-Apr-2016 MyungJoo Ham <myungjoo.ham@samsung.com>

PM / devfreq: style/typo fixes

- Typo in comments fixed
- Unnecessary return statement removed

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>


# 403e0689 05-Nov-2015 Chanwoo Choi <cw00.choi@samsung.com>

PM / devfreq: exynos: Add support of bus frequency of sub-blocks using passive governor

This patch adds the support of bus frequency feature for sub-blocks which share
the one power line. If each bus depends on the power line, each bus is not able
to change the voltage by oneself. To optimize the power-consumption on runtime,
some buses using the same power line should change the source clock and
regulator at the same time. So, this patch uses the passive governor to support
the bus frequency for all buses which sharing the one power line.

For example,

Exynos3250 include the two power line for AXI buses as following:
: VDD_MIF : MIF (Memory Interface) provide the DMC (Dynamic Memory Controller)
with the power (regulator).
: VDD_INT : INT (Internal) provide the various sub-blocks with the power
(regulator).

Each bus is included in as follwoing block. In the case of VDD_MIF, only DMC bus
use the power line. So, there is no any depencency between buese. But, in the
case of VDD_INT, various buses share the one power line of VDD_INT. We need to
make the depenency between buses. When using passive governor, there is no
problem to support the bus frequency as DVFS for all buses. One bus should be
operated as the parent bus device which gathering the current load of INT block
and then decides the new frequency with some governors except of passive
governor. After deciding the new frequency by the parent bus device, the rest
bus devices will change the each source clock according to new frequency of the
parent bus device.

- MIF (Memory Interface) block
: VDD_MIF |--- DMC

- INT (Internal) block
: VDD_INT |--- LEFTBUS (parent)
|--- PERIL
|--- MFC
|--- G3D
|--- RIGHTBUS
|--- FSYS
|--- LCD0
|--- PERIR
|--- ISP
|--- CAM

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
[tjakobi: Reported debugfs error during booting and cw00.choi fix it.]
Reported-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>


# 0722249a 03-Nov-2015 Chanwoo Choi <cw00.choi@samsung.com>

PM / devfreq: exynos: Add generic exynos bus frequency driver

This patch adds the generic exynos bus frequency driver for AMBA AXI bus
of sub-blocks in exynos SoC with DEVFREQ framework. The Samsung Exynos SoC
have the common architecture for bus between DRAM and sub-blocks in SoC.
This driver can support the generic bus frequency driver for Exynos SoCs.

In devicetree, Each bus block has a bus clock, regulator, operation-point
and devfreq-event devices which measure the utilization of each bus block.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
[m.reichl and linux.amoon: Tested it on exynos4412-odroidu3 board]
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>