Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp892280lqs; Fri, 14 Jun 2024 08:31:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXtmhSE1v/H/8UIPyDjhHVKHu7ZgNVhQnriWATe38SHpt64E+t5VEwXREf/2qqJ+dIa6/kKJgn9doPdu+4gP798++k0vXQ5vk6BI5HJwg== X-Google-Smtp-Source: AGHT+IFxBKSKjVO5l+eIh/UxfP62d2B2uaKgblQt2VhgCKAeq84bMujdVfzhtT+c7EKCIp41cRMn X-Received: by 2002:a05:6a20:7fa7:b0:1b6:3dfa:cc09 with SMTP id adf61e73a8af0-1bae7f147b3mr3888274637.35.1718379106268; Fri, 14 Jun 2024 08:31:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718379106; cv=pass; d=google.com; s=arc-20160816; b=Q6BrEXd1EBExQJJ+ZxiepUFMYQqOFEVzlso5Bx2DG7bpQQKGIT1SyPpdWDi8CT1jB9 AjJnquHnlFLEKH6OsWQ8Pat46nR4gg9I6hzCv8rkDv/cwMiP0SPJDfwiXE1QNGT+I7ot K1BV9cQoKG0nb16SgM/kfzObBEqPRd6ramLsr5DBQJd9GYag64IHw8PZG97YLpsRWBFG Jc64+soPYIdoXpaVav9iKdES6RGMBzfZ1fqSFlyE+HZZoG5BKqOz/Yt/avLsNp2pRm+6 /QGn/+f2C40wiIyUx5bpdzPmBiy91fJ3brXH4qygyXtM8dnS1NOH7gmw1xKbwX2Gennb uBIA== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=Ys1OVAwdH+f74w4EFfqNLKOwU5KebeVbztm9DGDrqWw=; fh=+a0QzGkPBx8jJuuInEHHAi6T+uFNyt8QXxX8cst7vEA=; b=tZVRNfpMpI/UNKJXt7lak2rKsvgPxJ7DD7gB9qkM3rCB+Rg6/nnnaGJzwvkCLBgB5T 575npefytZG2T8lq1CzI6DQPkQmmmCMk/QkwGZS0bxZbmGvniLyuRnU/CaPiSnsymH/i LzZfJkUSWb1iQmkXVIQOGXFVvsK/r5ft6PGdvO1l0xIOEl8QjwRFNjVgFAaf8y0qnFVd /dOMH+43+0WqZnNWbvm5E08ojCy9Kj8EACbM+kwEXkANtVVMoG4KdMNLsBGt9l2u3zOX WvZg+ePLHYlJA2A1DBfhS3pA8F+QQHGepbY5dRY3eUZ6/qkR2qigTyi8m5OlXMSJm7IX Vk4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@rjwysocki.net header.s=dkim header.b=Peoyu2Ei; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-215145-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215145-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 98e67ed59e1d1-2c4c4600277si3978562a91.38.2024.06.14.08.31.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 08:31:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215145-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=Peoyu2Ei; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-215145-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215145-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 40969283092 for ; Fri, 14 Jun 2024 15:27:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3268516F0EB; Fri, 14 Jun 2024 15:26:43 +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="Peoyu2Ei" 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 D8FBAF9D9; Fri, 14 Jun 2024 15:26:39 +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=1718378802; cv=none; b=t0nsfj4uz5/H5wI4Al4zYrWheOs/iQDC0Qg7OJAbZEM7ivnQHla+zthm32R2kNPXzn03vJ+rYAT56xD2BumhDa8AyQHeidv62ZClxIB1Z+/z8wgzj9qP4ALtmApwl0lpGcBZVtqQU6RQ2cqDc1ziYa04Sl84Se/vQ+pOXBbOnuk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718378802; c=relaxed/simple; bh=48UjPWTNXZzkXecEqeMbmgt02fHt9UfpMcTHgiKpMqA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=rdB5+/ZtcPVew1k62mTpSFFJPZ1suC9yL+617vDQGJwXp5ZfBaWRSTRD1dnUvSWBRcB8eHIZB7Jnsxm1Y6OwPxZfjhcFwNvExs00JO9OTSe3qOiNcDDvvrykObAjs0HbMwBa6LqzlTgnr9VxSFWG50rYiyXBcU2f+IdwbBdRUHQ= 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=Peoyu2Ei 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.2.0) id c4c5bc8300185fbc; Fri, 14 Jun 2024 17:26:37 +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 0E1E96A7417; Fri, 14 Jun 2024 17:26:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rjwysocki.net; s=dkim; t=1718378797; bh=48UjPWTNXZzkXecEqeMbmgt02fHt9UfpMcTHgiKpMqA=; h=From:To:Cc:Subject:Date; b=Peoyu2Ei8EuvhGittu8N1N6Po2ZhU5XK4tOihcv43NPFlqDY6lJ+AnmXS10VKYJmV 17/gqR53BWY3YwtW3OfPZbNsLAZ9TvIzWf/9EqiwyqAUydOZilzfiq5J296w/9jnnu siQ9CmatT0ycdI8DeLcq5q82NTKRXFaARpQZFUkE9lrBDixU4XNqu8FdpCvE+fmAB0 ygm+FLCl1Ox7cboCLeCshKilXBbvwx0eAvquaWx4viw1eK3jku1m6CqrhvmkXlCL6H nls1YiydeoCRyz/pn+NyfrTRvdLhLhZro2NUR4aBoS+VTNz0tI649/EG8R+Gqwjt3u icuoC3uYwhvhQ== From: "Rafael J. Wysocki" To: Linux PM Cc: Daniel Lezcano , LKML , Lukasz Luba , Srinivas Pandruvada , Zhang Rui Subject: [PATCH v1 0/2] thermal: core: Fix two issues related to thermal zone resume Date: Fri, 14 Jun 2024 17:17:35 +0200 Message-ID: <6070114.lOV4Wx5bFT@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: gggruggvucftvghtrhhoucdtuddrgedvledrfeduledgkeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepffffffekgfehheffleetieevfeefvefhleetjedvvdeijeejledvieehueevueffnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepiedprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegurghnihgvlhdrlhgviigtrghnoheslhhinhgrrhhordhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhukhgrshiirdhluhgsrgesrghrmhdrtghomhdprhgtphhtthhopehsrhhinhhi vhgrshdrphgrnhgurhhuvhgruggrsehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtoheprhhuihdriihhrghnghesihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=6 Fuz1=6 Fuz2=6 Hi Everyone, There are two issues resulting from asynchronous suspend of thermal zones. One of them is platform-specific and related to some firmware issue (I think) causing battery readings to become invalid after a system resume due to interference between ACPI battery resume and a thermal zone update. This can be addressed by running the thermal PM notifier after all of the other PM notifiers (including the ACPI battery one) which is done by patch [2/2]. The other one is mostly theoretical, but I couldn't convince myself that it cannot happen. Namely, a leftover thermal zone resume running during the next system suspend (if it is carried out back-to-back with the previous suspend-resume cycle) can accidentally reset tz->suspended set for a thermal zone by the thermal pre-suspend PM notifier. This is addressed by patch [1/2] (which goes before the second one because the latter increases the likelihood of the issue slightly). Thanks!