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]
Date:   Wed, 13 Sep 2023 10:16:51 +0200
From:   AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>
To:     Frank Wunderlich <linux@...web.de>,
        linux-mediatek@...ts.infradead.org
Cc:     Frank Wunderlich <frank-w@...lic-files.de>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Amit Kucheria <amitk@...nel.org>,
        Zhang Rui <rui.zhang@...el.com>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        linux-pm@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        Daniel Golle <daniel@...rotopia.org>
Subject: Re: [RFC v1 3/3] thermal/drivers/mediatek/lvts_thermal: add mt7988
 support

Il 11/09/23 20:33, Frank Wunderlich ha scritto:
> From: Frank Wunderlich <frank-w@...lic-files.de>
> 
> Add Support for mediatek fologic 880/MT7988.
> 
> Signed-off-by: Frank Wunderlich <frank-w@...lic-files.de>
> ---
>   drivers/thermal/mediatek/lvts_thermal.c | 73 +++++++++++++++++++++++++
>   1 file changed, 73 insertions(+)
> 
> diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
> index c1004b4da3b6..48b257a3c80e 100644
> --- a/drivers/thermal/mediatek/lvts_thermal.c
> +++ b/drivers/thermal/mediatek/lvts_thermal.c
> @@ -82,6 +82,8 @@
>   #define LVTS_GOLDEN_TEMP_DEFAULT	50
>   #define LVTS_COEFF_A_MT8195			-250460
>   #define LVTS_COEFF_B_MT8195			250460
> +#define LVTS_COEFF_A_MT7988			-204650
> +#define LVTS_COEFF_B_MT7988			204650
>   
>   #define LVTS_MSR_IMMEDIATE_MODE		0
>   #define LVTS_MSR_FILTERED_MODE		1
> @@ -1272,6 +1274,67 @@ static int lvts_remove(struct platform_device *pdev)
>   	return 0;
>   }
>   
> +/*
> + * LVTS MT7988
> + */
> +#define LVTS_HW_SHUTDOWN_MT7988	117000

Are you sure that this chip's Tj is >117°C ?!

Looks a bit high... if it is exactly 117°C, I would suggest cutting earlier,
either at 110 (safe side) or 115: after all, this is a life-saver feature and
the chip is actually never meant to *constantly* work at 110°C (as it would
degrade fast and say goodbye earlier than "planned").

> +//enum mt7988_lvts_domain { MT7988_AP_DOMAIN, MT7988_NUM_DOMAIN };
> +
> +enum mt7988_lvts_sensor_enum {
> +	MT7988_TS3_0,
> +	MT7988_TS3_1,
> +	MT7988_TS3_2,
> +	MT7988_TS3_3,
> +	MT7988_TS4_0,
> +	MT7988_TS4_1,
> +	MT7988_TS4_2,
> +	MT7988_TS4_3,
> +	MT7988_NUM_TS
> +};

This enumeration should be definitions in bindings (mediatek,lvts-thermal.h).

Besides, the LVTS is about internal temperatures, so those TS3_x and 4_x can
be renamed like what was done for MT8192 and MT8195: this is because you will
never see TS3_2 being CPU2 on a board and CPU4 on another, being those - again -
internal to the SoC, hence unchangeable.

Another reason is that you'll anyway have to refer to those sensors in the
devicetree to configure thermal trips and such, so... :-)

Regards,
Angelo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ