[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<OSBPR01MB2775B41C98F595C162E8924BFFAF2@OSBPR01MB2775.jpnprd01.prod.outlook.com>
Date: Wed, 2 Apr 2025 19:22:44 +0000
From: John Madieu <john.madieu.xa@...renesas.com>
To: ALOK TIWARI <alok.a.tiwari@...cle.com>, "geert+renesas@...der.be"
<geert+renesas@...der.be>, "conor+dt@...nel.org" <conor+dt@...nel.org>,
"krzk+dt@...nel.org" <krzk+dt@...nel.org>, "robh@...nel.org"
<robh@...nel.org>, "rafael@...nel.org" <rafael@...nel.org>,
"daniel.lezcano@...aro.org" <daniel.lezcano@...aro.org>
CC: "magnus.damm@...il.com" <magnus.damm@...il.com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"john.madieu@...il.com" <john.madieu@...il.com>, "rui.zhang@...el.com"
<rui.zhang@...el.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "linux-renesas-soc@...r.kernel.org"
<linux-renesas-soc@...r.kernel.org>, "sboyd@...nel.org" <sboyd@...nel.org>,
Biju Das <biju.das.jz@...renesas.com>, "linux-pm@...r.kernel.org"
<linux-pm@...r.kernel.org>, "lukasz.luba@....com" <lukasz.luba@....com>
Subject: RE: Re : [PATCH v5 3/5] thermal: renesas: rzg3e: Add thermal driver
for the Renesas RZ/G3E SoC
Hi Alok,
> -----Original Message-----
> From: ALOK TIWARI <alok.a.tiwari@...cle.com>
> Sent: Tuesday, April 1, 2025 8:24 PM
> To: John Madieu <john.madieu.xa@...renesas.com>; geert+renesas@...der.be;
> conor+dt@...nel.org; krzk+dt@...nel.org; robh@...nel.org;
> rafael@...nel.org; daniel.lezcano@...aro.org
> Subject: Re : [PATCH v5 3/5] thermal: renesas: rzg3e: Add thermal driver
> for the Renesas RZ/G3E SoC
>
> Hi John,
>
> Thanks for your reply.
>
> On 01-04-2025 17:35, John Madieu wrote:
> > Hi Alok,
> >
> > Thanks for your feedback.
> >
> >> -----Original Message-----
> >> From: ALOK TIWARI <alok.a.tiwari@...cle.com>
> >> Sent: Monday, March 31, 2025 8:11 PM
> >> To: John Madieu <john.madieu.xa@...renesas.com>;
> >> geert+renesas@...der.be;
> >> conor+dt@...nel.org; krzk+dt@...nel.org; robh@...nel.org;
> >> rafael@...nel.org; daniel.lezcano@...aro.org
> >> Subject: Re : [PATCH v5 3/5] thermal: renesas: rzg3e: Add thermal
> >> driver for the Renesas RZ/G3E SoC
> >>
> >>
> >>
> >> On 31-03-2025 03:19, John Madieu wrote:
> >>> The RZ/G3E SoC integrates a Temperature Sensor Unit (TSU) block
>
> >>> +static int rzg3e_thermal_change_mode(struct thermal_zone_device *tz,
> >>> + enum thermal_device_mode mode) {
> >>> + struct rzg3e_thermal_priv *priv = thermal_zone_device_priv(tz);
> >>> +
> >>> + if (mode == THERMAL_DEVICE_DISABLED)
> >>> + rzg3e_thermal_hw_disable(priv);
> >>> + else
> >>> + rzg3e_thermal_hw_enable(priv);
> >>> +
> >>> + priv->mode = mode;
> >>> + return 0;
> >>> +}
> >>> +
> >> always return 0 here ? what, if (!priv) return -EINVAL; ?
> >
> > priv cannot be NULL here, guaranteed from probe().
> > Returning 0 here is expected by the thermal framework to notify ops
> > success.
> >
>
> I agreed. priv cannot be NULL.
> It appears that return 0 is deliberate in this case. can we add Meaningful
> comment which help to code readability.
>
This is a standard tzd ops, which expects 0 to be returned
for disabling/enabling success. This is how it's implemented
in every Thermal driver I've gone through in the -next tree.
> not sure if user call ioctl(fd, THERMAL_IOC_SET_MODE, 2) and it returns
> 0 with thermal enable.
> that create possibility to thermal_core call thermal_notify_tz_disable if
> any case
>
Am I missing something ?
> >>> +static const struct thermal_zone_device_ops rzg3e_tz_ops = {
> >>> + .get_temp = rzg3e_thermal_get_temp,
> >>> + .set_trips = rzg3e_thermal_set_trips,
> >>> + .change_mode = rzg3e_thermal_change_mode, };
> >> other renesas driver defined as rzg2l_tz_of_ops, can be used similar
> >> one rzg3e_tz_of_ops for consistency!
> >
> > Thanks for pointing it out. Makes sense. Will double check and update
> > accordingly.
> >
> >>> +
> >>> +static int rzg3e_thermal_probe(struct platform_device *pdev) {
> >>> + struct device *dev = &pdev->dev;
> >>> + struct rzg3e_thermal_priv *priv;
> >>> + struct reset_control *rstc;
> >>
Regards,
John
Powered by blists - more mailing lists