Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2132098lqa; Tue, 30 Apr 2024 08:56:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWP7IDsNdVt4IxSexWirPPN4YaMGXikLFPMGu82Q4R9H5kivo8/jn9wXXRmEBiRjfS5av5TRrZEHoflDbfoENIvYaq3wg/A0fAKhmzyyA== X-Google-Smtp-Source: AGHT+IEFe9TqGeaESXwY66TkFJ+u1jEYAyzZ8wb1pgEBaNs4vaLWkzW96uCJuEqmGJq6Xet0Vmzh X-Received: by 2002:a05:6a20:43a2:b0:1a7:5e8f:8707 with SMTP id i34-20020a056a2043a200b001a75e8f8707mr318495pzl.26.1714492591032; Tue, 30 Apr 2024 08:56:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714492591; cv=pass; d=google.com; s=arc-20160816; b=gYnUvgvikqZgOleDLgxMUGdwwNyMZohq9drsPPT6tmF7nwXdnggXRmzPZHrWiHdOD5 dMPzpvuQSTovyFf7PAya3JuXK+rE2ujcKcsbOMtviWH5H1YzHi4tp4h/Zyox9lP0qzWG edPnPBZf7+UxqoGTUJm6E6156FvsZNkqspFE+IDHndDax+YGR8EXV+Bei5R8dLNEPUsH bUpzJkbM/PIoVam+POrfzMd43cWKYuU7knsEAsYwFfp0JFrZoVMHfCPTtskWxQJkKE83 iSqgkEkDQN3RhTjJdPFdtaSBCjqlpaoLQPG2ghsLPzcAkft6FE4tDPzVjDE0U4smSalR +rSg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/dgs5ptB9JsatxJ/rRWggRiXBGd9IL6znoy3AXzw03s=; fh=jLVvFrrAlOgFbwZBgcima8zCp3xvo3y7JsCl+txlddc=; b=nt2Zk9/CTfEMm2/yn0meSSzKEkhFUE+pNoDlYgVRfMKi7xDi6AqFmqZBGmda19FCfP EBn0kanRnfh++/ZzVQ2C7705s7IBu9yLepOmdquOhinhxTof9VHuFY30ZCHLXEXYNZiv IiXNPbVIG3ITRbWn+hYj8GqCLVIWSLOD9k0+4JAlQ4g/32sb78rz5/shA20pe2OGgP+U 0rNMdh7Ch67U5v4o4jwNK/Uq7A6a3YqJBohUykYJkVn8L0taJihHkT3SeyVlVWOaONDY 5XAFmMtlOOuOIfEWeY4l6UfpxJwX3NRuIstuF+F/vV9B7/201540alYS8fQgoO3vIHFP C6kA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@rjwysocki.net header.s=dkim header.b=YOrPW0Ji; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-164323-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164323-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u11-20020a056a00098b00b006ee1d680d44si17729858pfg.395.2024.04.30.08.56.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 08:56:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164323-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=fail header.i=@rjwysocki.net header.s=dkim header.b=YOrPW0Ji; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-164323-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164323-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2D19D28233E for ; Tue, 30 Apr 2024 15:55:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0067217BB08; Tue, 30 Apr 2024 15:53:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=rjwysocki.net header.i=@rjwysocki.net header.b="YOrPW0Ji" Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E860F175551; Tue, 30 Apr 2024 15:53:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.96.170.134 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714492394; cv=none; b=JzXV8Gbdb51uvQ8pMk0/Yx/v9ZxmlVbkFnJoSIxLwducwtAS+G2rQSnqhqBSy7SWZNeqlNp9hNjBpSFN4LdtZ/uKZC3YMxy6T6fz0JKj5Ke74QvFnxZTSztJ+hs4Zb8qaBHXlzJcntKTiLPs7RYkZsMc60AvLUXycqNfeqt9Xsw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714492394; c=relaxed/simple; bh=5l2heTlDRdh8TNuc+FkR1nWVng8KhgGpiI1+RYy0rFA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tOBoFiKEschEWqCphxzIb2/9bnF4PkpOaxamGnMNs/pUXPk4SwMre9E5rFI9iVnrFlUgEA9AnBSyYODT0TmN3ckHi/EtvM17awP6LMEq/c/E1j5YNC4bQN/q8kc3r0rp4cgHm2Bn9Zgpb+gWplGAGEyIhA+dBiw8IHNR2dEYpN4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net; spf=pass smtp.mailfrom=rjwysocki.net; dkim=fail (2048-bit key) header.d=rjwysocki.net header.i=@rjwysocki.net header.b=YOrPW0Ji reason="signature verification failed"; arc=none smtp.client-ip=79.96.170.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rjwysocki.net Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 6.0.0) id 81ba361248e88355; Tue, 30 Apr 2024 17:53:04 +0200 Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cloudserver094114.home.pl (Postfix) with ESMTPSA id 795F566E643; Tue, 30 Apr 2024 17:53:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rjwysocki.net; s=dkim; t=1714492383; bh=5l2heTlDRdh8TNuc+FkR1nWVng8KhgGpiI1+RYy0rFA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YOrPW0JieFZdQhvZEClSjpagZsfdXO87Xq/8vZJ40qdyv+urA3lQC6Z2asE4DvOty WoIKlVT0x325wYNZAMT83kw+Wh7DWFruBt8NdqPIx9gimm2M6KQCMY41pkNUqy8UAQ 6/V12lsG/WIJBlvybai0mfK1xuV9A7rzT7XycricBiE1tLvbBJCeORrJ0be5p7HW1a chiI5S1b267iZLAr6KxevVHZlO2tw6q0bpqrQfu+a2hWIvVdfn9TJji/jDtTGo9kJV doEngK9yhoXgLg1sMs5J1fl0ykJMSGrnvhMl7+Mx63elmDlUfjykiA6bgA0vhF5Lj9 w+zZVTqkgqGcA== From: "Rafael J. Wysocki" To: Linux PM , Lukasz Luba Cc: Daniel Lezcano , LKML , "Rafael J. Wysocki" Subject: [PATCH v2 1/2] thermal: core: Do not call handle_thermal_trip() if zone temperature is invalid Date: Tue, 30 Apr 2024 17:45:55 +0200 Message-ID: <4902888.GXAFRqVoOG@kreacher> In-Reply-To: <5790995.DvuYhMxLoT@kreacher> References: <5790995.DvuYhMxLoT@kreacher> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvddufedgledvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohephedprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehluhhkrghsiidrlhhusggrsegrrhhmrdgtohhmpdhrtghpthhtohepuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehrrghf rggvlheskhgvrhhnvghlrdhorhhg X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 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;