Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1542950rwd; Thu, 25 May 2023 14:18:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6LifY4gJ1O8Ih17hArtHaBxCK4yQ37pLjDrDBIZo/zzryqJASBd3JET1ATzeG35DIIk+bC X-Received: by 2002:a05:6a20:9385:b0:10f:1d52:93c2 with SMTP id x5-20020a056a20938500b0010f1d5293c2mr3835703pzh.28.1685049537139; Thu, 25 May 2023 14:18:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685049537; cv=none; d=google.com; s=arc-20160816; b=JrMLcVWXgSb8uYRpsavgO8dBD/MSvgnjDpC+xsY/IPLDWtGTShD+xzqkwcd7ZoFhoF /YKP/EaaOrLLxvbuN8XX/wnqZdyrYiN9ZXDD8KwMLTP9APTWW6j2HRo8S4l1l5SSq7xR wlNNAErNHriD/v+QOWFvsAxUqOh7uZqvYjz4aV4TjawwNGyChPZh6n+VTmjk3zK8lf8f UJ4z8AqKwrJtksIBrHDG1C0dMAPTzDeUEI3+2kwMxoxP9dvHIiDJ/kJo52ZhhonL88Dt ZcySsY2trCgpU4ImS4AfiWT5jwizzhoqQsmTB+vnATwOFwmPImPPxWaeHeCN6hQ4mMeC Y41Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xBMEZ8HhmIRaUHSk9k6hWNfYYoMqYYMFJDNJXP0SW+Q=; b=ynJJd3J0w4/cQMZPnzYiGGCfSz2jRvcLN2i+ZexSA9S3fiTtB41hZNXZqp/DNdtRwZ 6xUlitiL+xSly2vMhj98JJ5kTdhg6g3ITbAXsfIxuPlUZqk06q/iEdj7UDW+OcrmNMYl hebH4Fdv7Ldjxsz96vM9tn2qCpp50AtqoMNccglJmzlGaEO9Qxp3t2xO2dvNqpy4FWLd h6Ae+gQ9hKlSSsZyRIf/H7O/7SNMr7i5N+VDL9jw3VtX+JNy35EmHFKPmQl6rH/tajlB Wn5myda2R4IhkjJXq9V9qx9njywmcqIoeTgi9IelfHST7H75DUGbKjO6KHTH9yTbpJJx IXlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dsBOLATf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 201-20020a6303d2000000b0053f23442f29si2035718pgd.528.2023.05.25.14.18.44; Thu, 25 May 2023 14:18:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dsBOLATf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239074AbjEYVRR (ORCPT + 99 others); Thu, 25 May 2023 17:17:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235747AbjEYVRQ (ORCPT ); Thu, 25 May 2023 17:17:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58112198; Thu, 25 May 2023 14:17:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DEE0464B2D; Thu, 25 May 2023 21:17:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 084DCC433D2; Thu, 25 May 2023 21:17:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685049434; bh=+BQpgA/b2ao3wMNuPjBRBOPHdCtlI4INTxsSIyFtPTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dsBOLATfz/A+zYQ4T2Ms2FFPQ1PDBD40nWF5l0+hpk5LXR5PL33HsALvmL/lJi2pO i3r55klIrE96/DKSwIEYyyNBQncZXBsm9Ho/aFd6gYoY9Ui+sNz8Iw2nUXMnvGFRtT Djb488i7WWHH2AnwtNA6Uh1/+IjxE3+hHUHMfkRugQ6Gn2wHG+6CnZIBSPm5Vg48/g zbOqhK+Xq5EM58bxyHQKv/KOnegaXl2+MrMJ+fVI8qbM/mJWmR42IrTeJz7sHDNPSh 3YaJfTG0eqNbEORzg+krT5od6bYcm5BQGe2vEEQSjbZl5qpq/AJl5lAy3KhzZP85ha d5IHzB9XUspHg== From: Eduardo Valentin To: daniel.lezcano@linaro.org, rafael@kernel.org, linux-pm@vger.kernel.org Cc: Eduardo Valentin , Amit Kucheria , Zhang Rui , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] thermal: core: introduce governor .reboot_prepare() Date: Thu, 25 May 2023 14:16:53 -0700 Message-Id: <20230525211655.627415-2-evalenti@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230525211655.627415-1-evalenti@kernel.org> References: <20230525211655.627415-1-evalenti@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Eduardo Valentin This callback is used to notify the governors that reboot is coming up. Upon this event, this callback gives governors the opportunity to leave the thermal zones in a sane state prior to reboot. Cc: "Rafael J. Wysocki" (supporter:THERMAL) Cc: Daniel Lezcano (supporter:THERMAL) Cc: Amit Kucheria (reviewer:THERMAL) Cc: Zhang Rui (reviewer:THERMAL) Cc: Jonathan Corbet (maintainer:DOCUMENTATION) Cc: linux-pm@vger.kernel.org (open list:THERMAL) Cc: linux-doc@vger.kernel.org (open list:DOCUMENTATION) Cc: linux-kernel@vger.kernel.org (open list) Signed-off-by: Eduardo Valentin --- include/linux/thermal.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 82c8e09a63e0..d3c8af928522 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -201,6 +201,9 @@ struct thermal_zone_device { * below the trip point temperature * @check_error: callback called whenever temperature updates fail. * Opportunity for the governor to react on errors. + * @reboot_prepare: callback called upon system restart. + * Opportunity for the governor to tear down zones or at least + * leave them in a safe state. * @governor_list: node in thermal_governor_list (in thermal_core.c) */ struct thermal_governor { @@ -209,6 +212,7 @@ struct thermal_governor { void (*unbind_from_tz)(struct thermal_zone_device *tz); int (*throttle)(struct thermal_zone_device *tz, int trip); void (*check_error)(struct thermal_zone_device *tz, int error); + void (*reboot_prepare)(struct thermal_zone_device *tz); struct list_head governor_list; }; -- 2.34.1