Re: [PATCH v3 1/2] acpi: thermal: initialize tz_enabled to 1

From: Zhang Rui
Date: Mon Jul 03 2017 - 21:43:30 EST


On Mon, 2017-07-03 at 23:08 +0200, Rafael J. Wysocki wrote:
> On Mon, Jul 3, 2017 at 10:00 AM, Enric Balletbo i Serra
> <enric.balletbo@xxxxxxxxxxxxx> wrote:
> >
> > From: Sameer Nanda <snanda@xxxxxxxxxxxx>
> >
> > In the acpi_thermal_add path, acpi_thermal_get_info gets called
> > before
> > acpi_thermal_register_thermal_zone.ÂÂSince tz_enabled was getting
> > set to
> > 1 only in acpi_thermal_register_thermal_zone, acpi_thermal_get_info
> > ended up disabling thermal polling.
> >
> > Moved setting of tz_enabled to 1 into acpi_thermal_add itself.
> >
> > Signed-off-by: Sameer Nanda <snanda@xxxxxxxxxxxx>
> > Signed-off-by: Enric Balletbo i Serra <enric.balletbo@xxxxxxxxxxxxx
> > >
> > ---
> > Changes since v2:
> > Â- Zhang Rui:
> > ÂÂÂ- Make sure tz->tz_enabled is set properly before registering
> > the zone.
> >
> > Changes since v1:
> > Â- This patch is new from v1 [1]
> >
> > Â[1] https://patchwork.kernel.org/patch/9804229/
> >
> > Âdrivers/acpi/thermal.c | 3 +--
> > Â1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
> > index 1d0417b..cd0fe92 100644
> > --- a/drivers/acpi/thermal.c
> > +++ b/drivers/acpi/thermal.c
> > @@ -930,8 +930,6 @@ static int
> > acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
> > ÂÂÂÂÂÂÂÂif (ACPI_FAILURE(status))
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂreturn -ENODEV;
> >
> > -ÂÂÂÂÂÂÂtz->tz_enabled = 1;
> > -
> > ÂÂÂÂÂÂÂÂdev_info(&tz->device->dev, "registered as
> > thermal_zone%d\n",
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂtz->thermal_zone->id);
> > ÂÂÂÂÂÂÂÂreturn 0;
> > @@ -1088,6 +1086,7 @@ static int acpi_thermal_add(struct
> > acpi_device *device)
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂreturn -ENOMEM;
> >
> > ÂÂÂÂÂÂÂÂtz->device = device;
> > +ÂÂÂÂÂÂÂtz->tz_enabled = 1;
> > ÂÂÂÂÂÂÂÂstrcpy(tz->name, device->pnp.bus_id);
> > ÂÂÂÂÂÂÂÂstrcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME);
> > ÂÂÂÂÂÂÂÂstrcpy(acpi_device_class(device), ACPI_THERMAL_CLASS);
> > --
> Rui,
>
> Can I just apply this, or do I need to work for a thermal core
> update?
> ÂIn the latter case, can you take care of this one too, please?
>
Yes, I will take both of the patches.

thanks,
rui

> Thanks,
> Rafael