Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1479065rdh; Mon, 25 Sep 2023 14:14:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMAEEO9tsS5YmcAeHhcD64ZhSUrFPSV472d4W/lMwPpThUeoaYWGaiqCrVxxi4jwlJwAWI X-Received: by 2002:a17:90b:2388:b0:268:4c01:eb56 with SMTP id mr8-20020a17090b238800b002684c01eb56mr5778949pjb.2.1695676446986; Mon, 25 Sep 2023 14:14:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695676446; cv=none; d=google.com; s=arc-20160816; b=mJd6pgVYFVvhlo09yzMNmjdHmI2ko8pb/2RX4lXBBuLv58R8pOH8YtvT+Jrb/zkrUQ 2ViARDmVzpM+w00VCC3BwooAcKxZLwEhDAWj0O113bNvVi4NjvXv5sXZFJRE7/eSZg5M 9sAd2m76E0L1JL5ouD4ojGLNHsJCEdBTqasE0b33cVi67df1Jf/OqKAzPwysuvGAi0NW H/5XD0/QOznpZpAjL754efDOX9xh3XCEqIM/fathjgeA5Tnw5e430KrDLTDMEuCWLhdi ykNnv7b+nYqY5jmfT+h+aaPi5ZXJcGeBONz8ND17CsIeaaVgXLr8H7OACtYkWm3fyaLb EZ3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=WwdRv5aVN9xU2mSH7g7d6aBuPnLFDsHKoLa5WhXFbCE=; fh=ZvXsIZrxryzDvS3iPCUWtyWq+2pr1UhX/tZ0585ToNk=; b=D4EWoT2LeIyPRd8eg2EMS3IOszjq/4Slh02/rtxlpbJSScr+r9cxJxA1aDQe76gpdf 3wKxLvi1P5naikB9G4aGZC7Fu3/SPL8q7xD8DhlaTOTi0WtJdA6e3zm8nCYAWpIDjKkM gwb4Ft/OAxzDhvd/aO84COhAr9EvH26fJy31hyIswa2hJZGA8GUL9SYLbQMhLS9d6ZKv LrMukjlLW72eImbt7qmmOv3n3lrAdt+u/+8cSr+2dgDR5dbqnCDmPUB3HCaT3pcN0RhC ZWFcZ5HQX4ps0dHZlMRC+gDbIY1VHt9iReBIc/casFmWImpYmLshpFc7HcY3MUv1GogX ppEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y7od0ohr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id i190-20020a639dc7000000b0057c2f61474asi9997038pgd.290.2023.09.25.14.14.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 14:14:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y7od0ohr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id E01588082DE8; Mon, 25 Sep 2023 08:20:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230076AbjIYPUg (ORCPT + 99 others); Mon, 25 Sep 2023 11:20:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231577AbjIYPUe (ORCPT ); Mon, 25 Sep 2023 11:20:34 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5F70101 for ; Mon, 25 Sep 2023 08:20:26 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-405361bb9f7so65599765e9.2 for ; Mon, 25 Sep 2023 08:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695655225; x=1696260025; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=WwdRv5aVN9xU2mSH7g7d6aBuPnLFDsHKoLa5WhXFbCE=; b=y7od0ohrht64GM+Ikt4PU16+Ju+V0IVLfMk+6AXwo7X8swsMOeBFfmK1cWM2okF1Rj MM9SQd+wmSw+vwH7F7K1C4RwuDv8VS/VNCGG0b5KfRv9fKBqZA0CTQVABR44S65KbBJ6 oyPgfEUbsB7iTv5ZXGQgdrESOcydTrRO+If3UyBReF/6IJ4Cm39Q/zcKbsKj47r/dfl7 wv+ly9vGKAhMltZ0hLNVkY+2oOdWvn1OUW9gP9m1F8EeO9Z9dkhpZ4MCstPm4ZE2lrSy GDX2wyjqqZcG0QTn/9uZn/DI3kmRxWmFpl7fFpHzcTMdTvYSQaFRjlKUps0eU1s2FFtr 31jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695655225; x=1696260025; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WwdRv5aVN9xU2mSH7g7d6aBuPnLFDsHKoLa5WhXFbCE=; b=kXp+H3yJ4KMu48RlzcQvJO9a2lx/VTOptfBX3dyVJe1GbPC3rzlUbj2GPtQLXKSE27 Bq5/syfiD8MdkPXDFMqufQNXA7tXcPl32lkOQPwLryLj6hflrkwcL0y6CmocTf4pVeHF KoWnojVDLYNCphtXZ4uXrtYTnEdGjFzLCp+leOdtK8/Emqwblm6wDnyVh98X6qihn/WZ RB3Wd8wibJeqSGVet2A2LLG9uV92hqN1/0HZio/CPytpu/HKAatdhoy8Pj+GteC+LtYJ xSbTiKSRMFkHn5pK4Ii9SuxDAYUr+40Asa9oGUoD6cEuFWGEkFHQ2omXCOJToxAEPOwF PP1g== X-Gm-Message-State: AOJu0YxjY2KxY/ziCm2Hfym0FQLJPTVKYd2LBHFH0ijstn1M/6Y7gp9m 6EUZOgwG9C5TeG8S3PXb/rDRkGg61nI9HrOOPrs= X-Received: by 2002:a05:6000:1048:b0:31f:e980:df87 with SMTP id c8-20020a056000104800b0031fe980df87mr5715145wrx.38.1695655225062; Mon, 25 Sep 2023 08:20:25 -0700 (PDT) Received: from ?IPV6:2a05:6e02:1041:c10:c0e1:63ab:648b:6287? ([2a05:6e02:1041:c10:c0e1:63ab:648b:6287]) by smtp.googlemail.com with ESMTPSA id w12-20020a5d608c000000b003179d5aee67sm12152132wrt.94.2023.09.25.08.20.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Sep 2023 08:20:24 -0700 (PDT) Message-ID: Date: Mon, 25 Sep 2023 17:20:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v1 1/9] ACPI: thermal: Simplify initialization of critical and hot trips Content-Language: en-US To: "Rafael J. Wysocki" , Linux ACPI Cc: LKML , Linux PM , Zhang Rui , Srinivas Pandruvada References: <5708760.DvuYhMxLoT@kreacher> <4858652.31r3eYUQgx@kreacher> From: Daniel Lezcano In-Reply-To: <4858652.31r3eYUQgx@kreacher> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Mon, 25 Sep 2023 08:20:38 -0700 (PDT) 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 > + tz->trips.critical.valid = false; > + tz->trips.critical.temperature = THERMAL_TEMP_INVALID; > +} Other than that, Reviewed-by: Daniel Lezcano -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog