lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ca50f9b4-feb5-4365-927d-a2c931e268ed@oracle.com>
Date: Tue, 1 Apr 2025 23:53:55 +0530
From: ALOK TIWARI <alok.a.tiwari@...cle.com>
To: John Madieu <john.madieu.xa@...renesas.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 : [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.

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

>>> +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;
>>
>> Thanks,
>> Alok
> 
> Regards,
> John

Thanks,
Alok

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ