[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHc4DNK2_=81j-q4+1vsM9uyWJJ89dH4y2u_H5ie671umyNWxg@mail.gmail.com>
Date: Tue, 8 Jul 2025 14:40:28 +0800
From: Hsin-Te Yuan <yuanhsinte@...omium.org>
To: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: Hsin-Te Yuan <yuanhsinte@...omium.org>, Daniel Lezcano <daniel.lezcano@...aro.org>,
Amit Kucheria <amitk@...nel.org>, Zhang Rui <rui.zhang@...el.com>, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH 6.6] thermal/of: Fix mask mismatch when no trips subnode
On Tue, Jul 8, 2025 at 12:57 AM Rafael J. Wysocki <rafael@...nel.org> wrote:
>
> On Mon, Jul 7, 2025 at 12:27 PM Hsin-Te Yuan <yuanhsinte@...omium.org> wrote:
> >
> > After commit 725f31f300e3 ("thermal/of: support thermal zones w/o trips
> > subnode") was backported on 6.6 stable branch as commit d3304dbc2d5f
> > ("thermal/of: support thermal zones w/o trips subnode"), thermal zones
> > w/o trips subnode still fail to register since `mask` argument is not
> > set correctly. When number of trips subnode is 0, `mask` must be 0 to
> > pass the check in `thermal_zone_device_register_with_trips()`.
> >
> > Set `mask` to 0 when there's no trips subnode.
> >
> > Signed-off-by: Hsin-Te Yuan <yuanhsinte@...omium.org>
> > ---
> > drivers/thermal/thermal_of.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
> > index 0f520cf923a1e684411a3077ad283551395eec11..97aeb869abf5179dfa512dd744725121ec7fd0d9 100644
> > --- a/drivers/thermal/thermal_of.c
> > +++ b/drivers/thermal/thermal_of.c
> > @@ -514,7 +514,7 @@ static struct thermal_zone_device *thermal_of_zone_register(struct device_node *
> > of_ops->bind = thermal_of_bind;
> > of_ops->unbind = thermal_of_unbind;
> >
> > - mask = GENMASK_ULL((ntrips) - 1, 0);
> > + mask = ntrips ? GENMASK_ULL((ntrips) - 1, 0) : 0;
> >
> > tz = thermal_zone_device_register_with_trips(np->name, trips, ntrips,
> > mask, data, of_ops, &tzp,
> >
> > ---
>
> If this issue is present in the mainline, it is not necessary to
> mention "stable" in the changelog.
>
> Just post a patch against the mainline with an appropriate Fixes: tag.
>
> Thanks!
`mask` has been removed from the mainline, so this patch is only
applicable on old branches.
Powered by blists - more mailing lists