Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp999698rdb; Fri, 19 Jan 2024 05:26:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEg+SUcvbBBoQS3lUhE7AY48BmPlCvNnKYTCCsXY7rcCDCsSFwEWL2MdXMEfRuBG5+w6vfO X-Received: by 2002:a05:620a:28c7:b0:783:6601:a80d with SMTP id l7-20020a05620a28c700b007836601a80dmr1959227qkp.9.1705670762269; Fri, 19 Jan 2024 05:26:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705670762; cv=pass; d=google.com; s=arc-20160816; b=C0eGl8lBm0dX0m6SxPfSxEHPpdbbjZOHKyh0sejiTRFIdCysLjHaV9m5BifHmd3HVp C/d5HvvxYHZK7thJW6zjX2xFuvgtO6OadfxhmXVa+hpowCDt7kiPjUSiYcOFKr4or8kZ hN80LT4MQ02WuQUkN5XUCTM6wA7RlZ+tmalW+gGnjFWZGnNapLqICa5JXLT6fNNhJpCD glnErJqaXhhIsQG3GkgkV7ax4cgG4O6ADY/Yp8PEuKjr59w+PDSpm5oBUSQTFeO6k+4a nX94aB7XDN44jDxTtCGv0123TlglLGGIfHAaSYjq39uUEhAdZ7H8gIzaQvT7RktK2v7s 3C1Q== 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; bh=eHMosafIrihmBRfxcNW5hmD38fZFyPZI9Z5O/m10eEg=; fh=cTOyeHIiotxFveWD397Up69SLR8Dqpy9YboYIfW0A00=; b=o2S83ALHQ57yLf/szfZ0WZpcpCfHArMdUpBOauB6sT7vtBq1zkefJtSk8ylbJ3sBZH qi++fxQu1Bswe4Vfg2ZypwQfA/D8pqJkf1Z4AHLIPOMe6/icT18aQhIQ2SeguM1tuSac DyGXZrtChodYAW0G19j4EMJzRwsuCwkrIx1CsdpUqIbA5fhtxd+UDA+EUVgKy0fwiRpg jqVaPyDAyI0Pfbf98l5IflAhHSBURL2AZhZ4nbG4h94bWrF3drp42B71UWt2vRs/4S9S kCTkI7wuS6j7mHf4LxrD3bvy8AnTNZAdQLo3BJdRSHoBfx7A+gn+KnmWIAzdnYcQutUR GcKw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-31192-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31192-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bp33-20020a05620a45a100b00783484f3fedsi15895458qkb.348.2024.01.19.05.26.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 05:26:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31192-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-31192-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31192-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E64C71C2357E for ; Fri, 19 Jan 2024 13:26:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1698C537FC; Fri, 19 Jan 2024 13:25:41 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 4AAC2524D6 for ; Fri, 19 Jan 2024 13:25:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705670740; cv=none; b=IsuAVW3mClxcFJqP+yqSqHEEq1dCibsQcegJIOUSQNeqyLBjLcG8OYOVVc++HwSqpBxjNs8tmn/ySCbHYmY3DoFZ9HsS+au0dTPytTT+FIffZ8/QUYRluJASJ12cRSgBcioUzyc5NTCcGFD5DK/fnxbPA4XL2h4JhFL5IvPCFOA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705670740; c=relaxed/simple; bh=FG8+XP94f/Ig6ekDFdWhMR1QY436ISnaJd2Qe3LwG1s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DA5v9cl8Ha8ykqX1+A3hKT5tcfFZkAed+x3iVS5srL6za01dVBVzhE4q7vi+T0ZFHMD/1R9kg83Ro/8mwWkn6YMcXXdctHiro/SpuDmDxP7FVoNiMQ14GK9SJgumWzkwej7IEz6W/M/iHKq+dKJKmj/5BTNvy+vchxy80H8ebqg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rQos7-00074L-C1; Fri, 19 Jan 2024 14:25:23 +0100 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rQos6-000viS-AL; Fri, 19 Jan 2024 14:25:22 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rQos6-00F98h-0j; Fri, 19 Jan 2024 14:25:22 +0100 From: Oleksij Rempel To: Sebastian Reichel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Srinivas Kandagatla Cc: Oleksij Rempel , kernel@pengutronix.de, linux-kernel@vger.kernel.org, Liam Girdwood , Mark Brown , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, =?UTF-8?q?S=C3=B8ren=20Andersen?= Subject: [RFC PATCH v1 7/7] thermal: core: set Power State Change Reason before hw_protection_shutdown() Date: Fri, 19 Jan 2024 14:25:21 +0100 Message-Id: <20240119132521.3609945-8-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240119132521.3609945-1-o.rempel@pengutronix.de> References: <20240119132521.3609945-1-o.rempel@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Store the state change reason to some black box for later investigation. Signed-off-by: Oleksij Rempel --- drivers/thermal/thermal_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 9c17d35ccbbd..5ee3a59d7a0e 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -325,6 +326,7 @@ void thermal_zone_device_critical(struct thermal_zone_device *tz) dev_emerg(&tz->device, "%s: critical temperature reached, " "shutting down\n", tz->type); + set_power_state_change_reason(PSCR_OVERTEMPERATURE); hw_protection_shutdown("Temperature too high", poweroff_delay_ms); } EXPORT_SYMBOL(thermal_zone_device_critical); -- 2.39.2