From: Henrik Grimler <henrik@grimler.se>
To: �ս� <shin.son@samsung.com>
Cc: 'Bartlomiej Zolnierkiewicz' <bzolnier@gmail.com>,
'Krzysztof Kozlowski' <krzk@kernel.org>,
"'Rafael J . Wysocki'" <rafael@kernel.org>,
'Daniel Lezcano' <daniel.lezcano@linaro.org>,
'Zhang Rui' <rui.zhang@intel.com>,
'Lukasz Luba' <lukasz.luba@arm.com>,
'Rob Herring' <robh@kernel.org>,
'Conor Dooley' <conor+dt@kernel.org>,
'Alim Akhtar' <alim.akhtar@samsung.com>,
linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/3] thermal: exynos_tmu: Support new hardware and update TMU interface
Date: Wed, 24 Sep 2025 21:32:48 +0200 [thread overview]
Message-ID: <20250924193248.GA34040@l14.localdomain> (raw)
In-Reply-To: <000001dc2c24$8be7a090$a3b6e1b0$@samsung.com>
Hi Shin,
On Tue, Sep 23, 2025 at 09:53:53AM +0900, �ս� wrote:
> Hello Henrik Grimler
>
> > -----Original Message-----
> > From: Henrik Grimler [mailto:henrik@grimler.se]
> > Sent: Tuesday, September 23, 2025 5:05 AM
> > To: Shin Son <shin.son@samsung.com>
> > Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>; Krzysztof Kozlowski
> > <krzk@kernel.org>; Rafael J . Wysocki <rafael@kernel.org>; Daniel Lezcano
> > <daniel.lezcano@linaro.org>; Zhang Rui <rui.zhang@intel.com>; Lukasz Luba
> > <lukasz.luba@arm.com>; Rob Herring <robh@kernel.org>; Conor Dooley
> > <conor+dt@kernel.org>; Alim Akhtar <alim.akhtar@samsung.com>; linux-
> > pm@vger.kernel.org; linux-samsung-soc@vger.kernel.org;
> > devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-
> > kernel@vger.kernel.org
> > Subject: Re: [PATCH v4 2/3] thermal: exynos_tmu: Support new hardware and
> > update TMU interface
> >
> > Hi Shin,
> >
> > On Mon, Sep 22, 2025 at 01:18:56PM +0900, Shin Son wrote:
> > > The Exynos tmu driver's private data structure has been extended to
> > > support the exynosautov920 hardware, which requires per-sensor
> > > interrupt enablement and multiple-zone handling:
> > >
> > > - Add 'slope_comp' : compensation parameter below 25 degrees.
> > > - Add 'calib_temp' : stores the fused calibaration temperature.
> > > - Add 'sensor_count' : reflects the maximum sensor numbers.
> > > - Rename 'tzd' -> 'tzd_array' to register multiple thermal zones.
> > >
> > > Since splitting this patch causes runtime errors during temperature
> > > emulation or problems where the read temperature feature fails to
> > > retrieve values, I have submitted it as a single commit. To add
> > > support for the exynosautov920 to the exisiting TMU interface, the
> > > following changes are included:
> > >
> > > 1. Simplify "temp_to_code" and "code_to_temp" to one computation path
> > > by normalizing calib_temp.
> > > 2. Loop over 'sensor_count' in critical-point setup.
> > > 3. Introduce 'update_con_reg' for exynosautov920 control-register
> > updates.
> > > 4. Add exynosautov920-specific branch in 'exynos_tmu_update_temp'
> > function.
> > > 5. Skip high & low temperature threshold setup in exynosautov920.
> > > 6. Enable interrupts via sensor_count in exynosautov920.
> > > 7. Initialize all new members during 'exynosautov920_tmu_initialize'.
> > > 8. Clear IRQs by iterating the sensor_count in exynosautov920.
> > > 9. Register each zone with 'devm_thermal_of_zone_register()'
> > > based on 'sensor_count'.
> > >
> > > Signed-off-by: Shin Son <shin.son@samsung.com>
[ ... ]
> > > @@ -952,6 +1183,14 @@ static int exynos_map_dt_data(struct
> > > platform_device *pdev)
> > >
> > > data->cal_type = TYPE_ONE_POINT_TRIMMING;
> > >
> > > + if (data->soc == SOC_ARCH_EXYNOSAUTOV920) {
> > > + if (of_property_read_u32(pdev->dev.of_node,
> > "samsung,sensors",
> > > + &data->sensor_count)) {
> > > + dev_err(&pdev->dev, "failed to get sensor count\n");
> > > + return -ENODEV;
> > > + }
> > > + }
> >
> > Do we really need the `if (data->soc == SOC_ARCH_EXYNOSAUTOV920)` here, I
> > am sure there will be more socs that use samsung,sensors. Can't we simply
> > read samsung,sensors for all socs and use EXYNOS_DEFAULT_SENSOR_COUNT if
> > it fails, or would it be potentially dangerous if samsung,sensors is
> > missing for autov920 dtb and default value of 1 is used?
> >
> > Best regards,
> > Henrik Grimler
> >
>
> Yes. Incorrect remote-sensor settings can affect TMU operation. For
> example, when the sensor count is set to 1,
> The thermal zone doesn't function properly and the hardware trip doesn't
> assert on the v920 variant.
> I consider that configuration unsafe, so I added variant-specific handling
> for that SoC.
> Meanwhile, the other variant legitimately uses only a single sensor.
I see, thanks for the explanation!
Best regards,
Henrik Grimler
next prev parent reply other threads:[~2025-09-24 19:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20250922041901epcas2p2d3d164ea9421e57d9327f29782f955df@epcas2p2.samsung.com>
2025-09-22 4:18 ` [PATCH v4 0/3] Add exynosautov920 thermal support Shin Son
2025-09-22 4:18 ` [PATCH v4 1/3] dt-bindings: thermal: samsung: Adjust '#thermal-sensor-cells' to 1 Shin Son
2025-09-22 4:18 ` [PATCH v4 2/3] thermal: exynos_tmu: Support new hardware and update TMU interface Shin Son
2025-09-22 20:04 ` Henrik Grimler
2025-09-23 0:53 ` 손신
2025-09-24 19:32 ` Henrik Grimler [this message]
2025-09-22 4:18 ` [PATCH v4 3/3] arm64: dts: exynosautov920: Add multiple sensors Shin Son
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250924193248.GA34040@l14.localdomain \
--to=henrik@grimler.se \
--cc=alim.akhtar@samsung.com \
--cc=bzolnier@gmail.com \
--cc=conor+dt@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=rui.zhang@intel.com \
--cc=shin.son@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox