Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1366768rdh; Mon, 25 Sep 2023 10:26:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELUUlemixy9PB5jCMxmhumAufTNoab4adF8GyvByZEtfopeC+xWpvnzI1A94uY47tf+wMP X-Received: by 2002:a05:6a21:6da5:b0:15d:721e:44d8 with SMTP id wl37-20020a056a216da500b0015d721e44d8mr10315463pzb.4.1695662788649; Mon, 25 Sep 2023 10:26:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695662788; cv=none; d=google.com; s=arc-20160816; b=BdOVcRd72Q29rxy8aDNNUZuEs+dzyA+6WWuiUM6jMjg14sKsXTlOp8pi11MFmiOWI8 Bo0HITJv8iXCniJj2jZrSVCs3j4mNOV3HdD/omLF8rLHihHMz0McBY729X+TLazOqSUK XsdxC2uX8Kn5KFX076/amGmgWoKFwu5pQA3XtUCiftPodXwDef8k8fceEd1J0vEgPr/8 TZhzeWt3HsunzT6m770CvfH1RKJKFGf/lOWdujGFOLvo79qnpGG+R6pBbGv1R1YIcbCl d8n1Ysi3A44iitzJfI98An0Ji5ORfgamF1vh89B9k6jsUDWIbTOnQsrfBJokQTMYHdMz VyyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=CLIDfBju6YfVNr/wF5yXi3gjgyIpUvuSuD4QMPwrbs8=; fh=FZY01B02n9qvCmdlLlIofR92095q4TbTuzhU+6yUbGA=; b=Q/ln/mk7uLDwPujkMcsqhmnzebYzyeLkGamv57HxYuh1kztTGN+vxLeWsd1D3lnSFx /CtHY9l+UE8peWSl492Rp/QWwjIc99emqX1S8UkXujQ82jpkRjRwQEY+09OB61TSDFBt SST6jdzjSKbli57ZTAOg/xihDWwYXFtdqKT4HNDoyj+Oug1smetzfR1Y5UGhlxjtx0Oh nqryj4rqlrA7XJMkj5MkvmdCBA7pkXJrgRyWDX26TSPM3+t66zkqaocLIqIoNfYpoE0G HT4junhr/dxoIhIFKMy9lexN7bOt+jB6YbyJq2crZwAlaXkcBOl+vO6BhLz/yW9SCh7a raTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id l15-20020a170902f68f00b001c572ccd45bsi11562345plg.391.2023.09.25.10.26.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 10:26:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id F2BB380FA9DB; Mon, 25 Sep 2023 10:13:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232741AbjIYRNL convert rfc822-to-8bit (ORCPT + 99 others); Mon, 25 Sep 2023 13:13:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229584AbjIYRNK (ORCPT ); Mon, 25 Sep 2023 13:13:10 -0400 Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com [209.85.161.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5245FBC; Mon, 25 Sep 2023 10:13:04 -0700 (PDT) Received: by mail-oo1-f42.google.com with SMTP id 006d021491bc7-57bb41f5937so357349eaf.1; Mon, 25 Sep 2023 10:13:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695661983; x=1696266783; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z9DtViKcadvsCwKJmf4sI2t1Y1EYW1bA3Q/3dmceKgo=; b=p7rGfOMDCHUs0GxEmHVzwc2dv/luspuDAtUe66ir8E0gRxe8IhC6rAXCRUW8sd7yWS y+w3VZn59/sUpISmmc/H4sdXLjLfrOzL0sr9vi7WypBm8XVhn9LwsswhW9dHOASy5qMS JbmreRzAJVfWfW7F23ukd8V4kNDj16LdBzb9DS8dfLOztN3ZtWPm8fgLnsMcae61DpV5 mEc62PK++iYoe9Mr+vVXenByGY7uvru2uyBMPTy5svLcUomHhZUUlalEJ8Go146ds7Gx UeW3YmWHXvFLBdHxf+2JAbF/hBdeAXhpYv4ujil9Z9iIOXzpyS790Z7/oBdsI8bUNw1q iTYw== X-Gm-Message-State: AOJu0YwvoUtyvXy1e/aLrgyEocnsSFdtub/UV9ez1Ws54kEABqqMrwMX x2y1kCLyBNkc5OdyZq8a8KSBjm1O6ZSBEdK/Cpw= X-Received: by 2002:a4a:c91a:0:b0:57b:94b7:c6ba with SMTP id v26-20020a4ac91a000000b0057b94b7c6bamr6356508ooq.0.1695661983592; Mon, 25 Sep 2023 10:13:03 -0700 (PDT) MIME-Version: 1.0 References: <5708760.DvuYhMxLoT@kreacher> <4858652.31r3eYUQgx@kreacher> In-Reply-To: From: "Rafael J. Wysocki" Date: Mon, 25 Sep 2023 19:12:52 +0200 Message-ID: Subject: Re: [PATCH v1 1/9] ACPI: thermal: Simplify initialization of critical and hot trips To: Daniel Lezcano Cc: "Rafael J. Wysocki" , Linux ACPI , LKML , Linux PM , Zhang Rui , Srinivas Pandruvada Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 25 Sep 2023 10:13:09 -0700 (PDT) On Mon, Sep 25, 2023 at 5:20 PM Daniel Lezcano wrote: > > On 12/09/2023 20:35, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki > > > > Use the observation that the critical and hot trip points are never > > updated by the ACPI thermal driver, because the flags passed from > > acpi_thermal_notify() to acpi_thermal_trips_update() do not include > > ACPI_TRIPS_CRITICAL or ACPI_TRIPS_HOT, to move the initialization > > of those trip points directly into acpi_thermal_get_trip_points() and > > reduce the size of __acpi_thermal_trips_update(). > > > > Also make the critical and hot trip points initialization code more > > straightforward and drop the flags that are not needed any more. > > > > Signed-off-by: Rafael J. Wysocki > > --- > > [ ... ] > > > +static void acpi_thermal_get_critical_trip(struct acpi_thermal *tz) > > +{ > > + unsigned long long tmp; > > + acpi_status status; > > + > > + if (crt > 0) { > > + tmp = celsius_to_deci_kelvin(crt); > > + goto set; > > + } > > + if (crt == -1) { > > + acpi_handle_debug(tz->device->handle, "Critical threshold disabled\n"); > > + goto fail; > > + } > > + > > + status = acpi_evaluate_integer(tz->device->handle, "_CRT", NULL, &tmp); > > + if (ACPI_FAILURE(status)) { > > + acpi_handle_debug(tz->device->handle, "No critical threshold\n"); > > + goto fail; > > + } > > + if (tmp <= 2732) { > > + /* > > + * Below zero (Celsius) values clearly aren't right for sure, > > + * so discard them as invalid. > > + */ > > + pr_info(FW_BUG "Invalid critical threshold (%llu)\n", tmp); > > + goto fail; > > + } > > + > > +set: > > + tz->trips.critical.valid = true; > > + tz->trips.critical.temperature = tmp; > > + acpi_handle_debug(tz->device->handle, "Critical threshold [%lu]\n", > > + tz->trips.critical.temperature); > > + return; > > + > > +fail: > > nit: 'notset' may be more adequate Well, this is a bit moot, because the label goes away in one of the later patches anyway. > > + tz->trips.critical.valid = false; > > + tz->trips.critical.temperature = THERMAL_TEMP_INVALID; > > +} > > Other than that, > > Reviewed-by: Daniel Lezcano Thanks!