[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Zrs0n6oLSbG3MzMs@shredder.mtl.com>
Date: Tue, 13 Aug 2024 13:25:35 +0300
From: Ido Schimmel <idosch@...dia.com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: Linux PM <linux-pm@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Lukasz Luba <lukasz.luba@....com>, Zhang Rui <rui.zhang@...el.com>,
Petr Machata <petrm@...dia.com>, netdev@...r.kernel.org
Subject: Re: [PATCH v2 13/17] mlxsw: core_thermal: Use the .should_bind()
thermal zone callback
On Mon, Aug 12, 2024 at 04:23:38PM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> Make the mlxsw core_thermal driver use the .should_bind() thermal zone
> callback to provide the thermal core with the information on whether or
> not to bind the given cooling device to the given trip point in the
> given thermal zone. If it returns 'true', the thermal core will bind
> the cooling device to the trip and the corresponding unbinding will be
> taken care of automatically by the core on the removal of the involved
> thermal zone or cooling device.
>
> It replaces the .bind() and .unbind() thermal zone callbacks (in 3
> places) which assumed the same trip points ordering in the driver
> and in the thermal core (that may not be true any more in the
> future). The .bind() callbacks used loops over trip point indices
> to call thermal_zone_bind_cooling_device() for the same cdev (once
> it had been verified) and all of the trip points, but they passed
> different 'upper' and 'lower' values to it for each trip.
>
> To retain the original functionality, the .should_bind() callbacks
> need to use the same 'upper' and 'lower' values that would be used
> by the corresponding .bind() callbacks when they are about to return
> 'true'. To that end, the 'priv' field of each trip is set during the
> thermal zone initialization to point to the corresponding 'state'
> object containing the maximum and minimum cooling states of the
> cooling device.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
Reviewed-by: Ido Schimmel <idosch@...dia.com>
Powered by blists - more mailing lists