From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>,
Thara Gopinath <thara.gopinath@linaro.org>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
Sasha Levin <sashal@kernel.org>,
rafael@kernel.org, daniel.lezcano@linaro.org,
linux-pm@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 09/15] thermal: core: Reset previous low and high trip during thermal zone init
Date: Thu, 25 Nov 2021 21:35:27 -0500 [thread overview]
Message-ID: <20211126023533.442895-9-sashal@kernel.org> (raw)
In-Reply-To: <20211126023533.442895-1-sashal@kernel.org>
From: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
[ Upstream commit 99b63316c39988039965693f5f43d8b4ccb1c86c ]
During the suspend is in process, thermal_zone_device_update bails out
thermal zone re-evaluation for any sensor trip violation without
setting next valid trip to that sensor. It assumes during resume
it will re-evaluate same thermal zone and update trip. But when it is
in suspend temperature goes down and on resume path while updating
thermal zone if temperature is less than previously violated trip,
thermal zone set trip function evaluates the same previous high and
previous low trip as new high and low trip. Since there is no change
in high/low trip, it bails out from thermal zone set trip API without
setting any trip. It leads to a case where sensor high trip or low
trip is disabled forever even though thermal zone has a valid high
or low trip.
During thermal zone device init, reset thermal zone previous high
and low trip. It resolves above mentioned scenario.
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Reviewed-by: Thara Gopinath <thara.gopinath@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
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 ae60599c462b9..6c7825c581b5f 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -454,6 +454,8 @@ static void thermal_zone_device_init(struct thermal_zone_device *tz)
{
struct thermal_instance *pos;
tz->temperature = THERMAL_TEMP_INVALID;
+ tz->prev_low_trip = -INT_MAX;
+ tz->prev_high_trip = INT_MAX;
list_for_each_entry(pos, &tz->thermal_instances, tz_node)
pos->initialized = false;
}
--
2.33.0
next prev parent reply other threads:[~2021-11-26 2:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-26 2:35 [PATCH AUTOSEL 4.19 01/15] gfs2: Fix length of holes reported at end-of-file Sasha Levin
2021-11-26 2:35 ` [PATCH AUTOSEL 4.19 02/15] tun: fix bonding active backup with arp monitoring Sasha Levin
2021-11-26 2:35 ` [PATCH AUTOSEL 4.19 03/15] atlantic: Fix OOB read and write in hw_atl_utils_fw_rpc_wait Sasha Levin
2021-11-26 2:35 ` [PATCH AUTOSEL 4.19 04/15] net: return correct error code Sasha Levin
2021-11-26 2:35 ` [PATCH AUTOSEL 4.19 05/15] pinctrl: amd: Fix wakeups when IRQ is shared with SCI Sasha Levin
2021-11-26 2:35 ` [PATCH AUTOSEL 4.19 06/15] platform/x86: thinkpad_acpi: Fix WWAN device disabled issue after S3 deep Sasha Levin
2021-11-26 2:35 ` [PATCH AUTOSEL 4.19 07/15] s390/setup: avoid using memblock_enforce_memory_limit Sasha Levin
2021-11-26 2:35 ` [PATCH AUTOSEL 4.19 08/15] btrfs: check-integrity: fix a warning on write caching disabled disk Sasha Levin
2021-11-26 2:35 ` Sasha Levin [this message]
2021-11-26 2:35 ` [PATCH AUTOSEL 4.19 10/15] scsi: iscsi: Unblock session then wake up error handler Sasha Levin
2021-11-26 2:35 ` [PATCH AUTOSEL 4.19 11/15] ata: ahci: Add Green Sardine vendor ID as board_ahci_mobile Sasha Levin
2021-11-26 2:35 ` [PATCH AUTOSEL 4.19 12/15] ethernet: hisilicon: hns: hns_dsaf_misc: fix a possible array overflow in hns_dsaf_ge_srst_by_port() Sasha Levin
2021-11-26 2:35 ` [PATCH AUTOSEL 4.19 13/15] net: tulip: de4x5: fix the problem that the array 'lp->phy[8]' may be out of bound Sasha Levin
2021-11-26 2:35 ` [PATCH AUTOSEL 4.19 14/15] net: ethernet: dec: tulip: de4x5: fix possible array overflows in type3_infoblock() Sasha Levin
2021-11-26 2:35 ` [PATCH AUTOSEL 4.19 15/15] perf hist: Fix memory leak of a perf_hpp_fmt Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211126023533.442895-9-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=manafm@codeaurora.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=stable@vger.kernel.org \
--cc=thara.gopinath@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox