[PATCH v6 0/4] Exynos Thermal code improvement

Anand Moon linux.amoon at gmail.com
Thu May 15 04:10:27 PDT 2025


Hi Daniel,

On Wed, 14 May 2025 at 16:53, Daniel Lezcano <daniel.lezcano at linaro.org> wrote:
>
> On Wed, Apr 30, 2025 at 06:02:56PM +0530, Anand Moon wrote:
> > Hi All,
>
> Hi Anand,
>
> if the goal of the changes is to do cleanups, I recommend to rework
> how the code is organized. Instead of having the data->soc check all
> around the functions, write per platform functions and store them in
> struct of_device_id data field instead of the soc version.
>
> Basically get rid of exynos_map_dt_data by settings the different ops
> in a per platform structure.
>
> Then the initialization routine would be simpler to clean.
>

Thanks, I had previously attempted this approach.
The goal is to split the exynos_tmu_data structure to accommodate
SoC-specific callbacks for initialization and configuration.

In my earlier attempt, I tried to refactor the code to achieve this.
However, the main challenge I encountered was that the
exynos_sensor_ops weren’t being correctly mapped for each SoC.

Some SoC have multiple sensor
exynos4x12
                    tmu: tmu at 100c0000
exynos5420
                tmu_cpu0: tmu at 10060000
                tmu_cpu1: tmu at 10064000
                tmu_cpu2: tmu at 10068000
                tmu_cpu3: tmu at 1006c000
                tmu_gpu: tmu at 100a0000
 exynos5433
                tmu_atlas0: tmu at 10060000
                tmu_atlas1: tmu at 10068000
                tmu_g3d: tmu at 10070000
exynos7
                tmu at 10060000

It could be a design issue of the structure.or some DTS issue.
So what I found in debugging it is not working correctly.

static const struct thermal_zone_device_ops exynos_sensor_ops = {
        .get_temp = exynos_get_temp,
        .set_emul_temp = exynos_tmu_set_emulation,
        .set_trips = exynos_set_trips,
};

The sensor callback will not return a valid pointer and soc id for the get_temp.

Here is my earlier version of local changes.
[1] https://pastebin.com/bbEP04Zh exynos_tmu.c
[2] https://pastebin.com/PzNz5yve Odroid U3 dmesg.log
[3] https://pastebin.com/4Yjt2d2u    Odroid Xu4 dmesg.log

I want to re-model the structure to improve the code.
Once Its working condition I will send this for review.

If you have some suggestions please let me know.

Thanks
-Anand



More information about the linux-arm-kernel mailing list