Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2173921lqa; Tue, 30 Apr 2024 09:57:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXKJCrTz1Q5vQByY5mDfHsDgk1+6gN57tJRoEgpKZgmdVbJ9r8DxeoRFIagCsyL+XEmJwabjpbZdtEMZzU/XRccyxKOZl68L0VEgcqFbQ== X-Google-Smtp-Source: AGHT+IEm5Wk5H4+gAozZcNjYgF2w/6tZQ6EU6KulDibZPsMizn+WkCqutI17bHnWVpyBvfKsHW6h X-Received: by 2002:a05:6830:1608:b0:6eb:9497:5d46 with SMTP id g8-20020a056830160800b006eb94975d46mr39498otr.7.1714496232311; Tue, 30 Apr 2024 09:57:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714496232; cv=pass; d=google.com; s=arc-20160816; b=luQwU2LERG09QJ/16NrFqgJqQRZGdjFkETRnIWz+OoN+BSTA3bAFUMc6F8h+eAm8lX apLL5f5fUezfFFuI1kAyDrPkAqTfMhBF4y6KOfsm2orRPRNPLKPLacIk5oJmW34YGZot ggUAAyltszi24YMuPoqjDBqPNI4xsfXn2i8k+0WzdqLHh5yy5esRrCxBvVKMVBGHXmDA GT7IkSxzUK20ad/FGGJHUYk9kW5zvA6EKe/HT83T7p5+MY2Vmsx7WOnUAkGoMb1Gnbec 8RrzFIv3fmY+kCL4CxhadHNqFKyFwcLmMN6yZdi3pkBXlo1ZwzzVbDNc0BI/Lp2VyEHI f3KA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=ElJOKEMFNbGHXb18tiMG/N9WdhPC2c2hyyOWw06A4bs=; fh=6LuF8pOH5gIstDf8P0xU+AnYBf2QVLqtZI2OieTOns8=; b=j2EurdbVt835yguro14uSJAINj0qBc8XbzYqBvSwGoaYtRR6ELnqv9j7RetTdi8wJa Sz2kND0MFUoyZo6aTxMSSN9s451GH+eWxx5N51gBJU+k3UqqSFqCCySaPYNPFHL+ICGW mQUUPwRioHeXKOB4/oxfiO8FjzyGQtcABzIYyXEfB5ZabQDCJvIhYxwb64C8Dli5mlsX qTuT9XfuB+3wlra/+l7lZd51I9cd3/A/JzJIM+X5Z7BDn8RQLF32FzcXRBI1G6JwbjEu I0L0YHwbXmU8UEXDw2e3itTjbFAUw2TFpFgACntlQRq1G2/jaj/gJL6lfOvr2vd/XejC VZXA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-164409-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164409-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id s18-20020a63af52000000b005d8b8c6f94csi21763332pgo.565.2024.04.30.09.57.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 09:57:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164409-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-164409-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164409-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 56CF1B239EE for ; Tue, 30 Apr 2024 16:44:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 02E5B179654; Tue, 30 Apr 2024 16:44:04 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A56D12C7FA; Tue, 30 Apr 2024 16:44:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714495443; cv=none; b=akTsRgtKfxlgWlAiLYlwJoxbJ0kjkn96W5hOMdVgcTj2Ah9WO/XqqoQVrvAohkoOGaqQDidHW20kPnELbjGiHd0/CvpRNZTeAtG3lUol+3KaIblHk+b6bY0lXAawM4PDipsloMFO8pQl3NllXnwZghnK6Msvfs8hZLq2YXKFIJM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714495443; c=relaxed/simple; bh=v8K8vEmJ0RqXAC0tJopsQxCRVo5OmqZhLNA/uVb5msA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=rpPAC8u2iWdrF5oSu28nRoiq/EYsDn7d/BMwTJsTBu5bY1wUmh/5arCM8yeuVWjiv7va9iBElGM8ctpI0akixS1NuQt1HLJZNajFOMFsaEEBITAClau6f5cnqgVojaUVAluexPjU8FO8OKB4hSm7inlEnE27WJgurm64V6vROVE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4989D2F4; Tue, 30 Apr 2024 09:44:27 -0700 (PDT) Received: from [10.57.65.13] (unknown [10.57.65.13]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F022C3F762; Tue, 30 Apr 2024 09:43:59 -0700 (PDT) Message-ID: <4f5efb62-b490-4295-bce6-58f63d1287a1@arm.com> Date: Tue, 30 Apr 2024 17:43:58 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/2] thermal: core: Do not call handle_thermal_trip() if zone temperature is invalid To: "Rafael J. Wysocki" Cc: Daniel Lezcano , Linux PM , LKML , "Rafael J. Wysocki" References: <5790995.DvuYhMxLoT@kreacher> <4902888.GXAFRqVoOG@kreacher> Content-Language: en-US From: Lukasz Luba In-Reply-To: <4902888.GXAFRqVoOG@kreacher> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/30/24 16:45, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > Make __thermal_zone_device_update() bail out if update_temperature() > fails to update the zone temperature because __thermal_zone_get_temp() > has returned an error and the current zone temperature is > THERMAL_TEMP_INVALID (user space receiving netlink thermal messages, > thermal debug code and thermal governors may get confused otherwise). > > Fixes: 9ad18043fb35 ("thermal: core: Send trip crossing notifications at init time if needed") > Signed-off-by: Rafael J. Wysocki > --- > > New patch in v2. > > --- > drivers/thermal/thermal_core.c | 3 +++ > 1 file changed, 3 insertions(+) > > Index: linux-pm/drivers/thermal/thermal_core.c > =================================================================== > --- linux-pm.orig/drivers/thermal/thermal_core.c > +++ linux-pm/drivers/thermal/thermal_core.c > @@ -487,6 +487,9 @@ void __thermal_zone_device_update(struct > > update_temperature(tz); > > + if (tz->temperature == THERMAL_TEMP_INVALID) > + return; > + > __thermal_zone_set_trips(tz); > > tz->notify_event = event; > > > Reviewed-by: Lukasz Luba