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:   Sun, 12 Mar 2023 14:14:12 +0200
From:   Ido Schimmel <idosch@...sch.org>
To:     Daniel Lezcano <daniel.lezcano@...aro.org>
Cc:     rafael@...nel.org, linux-kernel@...r.kernel.org,
        linux-pm@...r.kernel.org, rui.zhang@...el.com,
        Raju Rangoju <rajur@...lsio.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Peter Kaestle <peter@...e.net>,
        Hans de Goede <hdegoede@...hat.com>,
        Mark Gross <markgross@...nel.org>,
        Miquel Raynal <miquel.raynal@...tlin.com>,
        Amit Kucheria <amitk@...nel.org>,
        Nicolas Saenz Julienne <nsaenz@...nel.org>,
        Broadcom Kernel Team <bcm-kernel-feedback-list@...adcom.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Ray Jui <rjui@...adcom.com>,
        Scott Branden <sbranden@...adcom.com>,
        Support Opensource <support.opensource@...semi.com>,
        Lukasz Luba <lukasz.luba@....com>,
        Shawn Guo <shawnguo@...nel.org>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        Fabio Estevam <festevam@...il.com>,
        NXP Linux Team <linux-imx@....com>,
        Thara Gopinath <thara.gopinath@...aro.org>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Niklas Söderlund 
        <niklas.soderlund@...natech.se>,
        Bartlomiej Zolnierkiewicz <bzolnier@...il.com>,
        Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        Alim Akhtar <alim.akhtar@...sung.com>,
        Thierry Reding <thierry.reding@...il.com>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Eduardo Valentin <edubezval@...il.com>,
        Keerthy <j-keerthy@...com>,
        Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Antoine Tenart <atenart@...nel.org>,
        Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
        Dmitry Osipenko <digetx@...il.com>, netdev@...r.kernel.org,
        platform-driver-x86@...r.kernel.org,
        linux-rpi-kernel@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-arm-msm@...r.kernel.org, linux-renesas-soc@...r.kernel.org,
        linux-samsung-soc@...r.kernel.org, linux-tegra@...r.kernel.org,
        linux-omap@...r.kernel.org,
        "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
        danieller@...dia.com, vadimp@...dia.com, petrm@...dia.com
Subject: Re: [PATCH v8 01/29] thermal/core: Add a generic
 thermal_zone_get_trip() function

On Mon, Oct 03, 2022 at 11:25:34AM +0200, Daniel Lezcano wrote:
> @@ -1252,9 +1319,10 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t
>  		goto release_device;
>  
>  	for (count = 0; count < num_trips; count++) {
> -		if (tz->ops->get_trip_type(tz, count, &trip_type) ||
> -		    tz->ops->get_trip_temp(tz, count, &trip_temp) ||
> -		    !trip_temp)
> +		struct thermal_trip trip;
> +
> +		result = thermal_zone_get_trip(tz, count, &trip);
> +		if (result)
>  			set_bit(count, &tz->trips_disabled);
>  	}

Daniel, this change makes it so that trip points with a temperature of
zero are no longer disabled. This behavior was originally added in
commit 81ad4276b505 ("Thermal: Ignore invalid trip points"). The mlxsw
driver relies on this behavior - see mlxsw_thermal_module_trips_reset()
- and with this change I see that the thermal subsystem tries to
repeatedly set the state of the associated cooling devices to the
maximum state. Other drivers might also be affected by this.

Following patch solves the problem for me:

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 55679fd86505..b50931f84aaa 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -1309,7 +1309,7 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t
                struct thermal_trip trip;
 
                result = thermal_zone_get_trip(tz, count, &trip);
-               if (result)
+               if (result || !trip.temperature)
                        set_bit(count, &tz->trips_disabled);
        }

Should I submit it or do you have a better idea?

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ