From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: m.szyprowski@samsung.com
Cc: rafael@kernel.org, krzk@kernel.org, rui.zhang@intel.com,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
amitk@kernel.org, linux-samsung-soc@vger.kernel.org
Subject: [PATCH] thermal/core: Fix lockdep_assert() warning
Date: Fri, 12 Aug 2022 15:12:02 +0200 [thread overview]
Message-ID: <20220812131202.1331238-1-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <f1fb1d84-85de-f3c5-0212-fcf0e9c0ccd2@samsung.com>
The function thermal_zone_device_is_enabled() must be called with the
thermal zone lock held. In the resume path, it is called without.
As the thermal_zone_device_is_enabled() is also checked in
thermal_zone_device_update(), do the check in resume() function is
pointless, except for saving an extra initialization which does not
hurt if it is done in all the cases.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/thermal/thermal_core.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 50814009339d..dc8ff6a84df1 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -1438,9 +1438,6 @@ static int thermal_pm_notify(struct notifier_block *nb,
case PM_POST_SUSPEND:
atomic_set(&in_suspend, 0);
list_for_each_entry(tz, &thermal_tz_list, node) {
- if (!thermal_zone_device_is_enabled(tz))
- continue;
-
thermal_zone_device_init(tz);
thermal_zone_device_update(tz,
THERMAL_EVENT_UNSPECIFIED);
--
2.34.1
next prev parent reply other threads:[~2022-08-12 13:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-05 15:38 [PATCH 1/5] thermal/core: Rearm the monitoring only one time Daniel Lezcano
2022-08-05 15:38 ` [PATCH 2/5] thermal/core: Rework the monitoring a bit Daniel Lezcano
2022-08-05 15:38 ` [PATCH 3/5] thermal/governors: Group the thermal zone lock inside the throttle function Daniel Lezcano
2022-08-05 15:38 ` [PATCH 4/5] thermal/core: Move the thermal zone lock out of the governors Daniel Lezcano
2022-10-04 14:14 ` Guenter Roeck
2022-10-04 14:21 ` Daniel Lezcano
2022-08-05 15:38 ` [PATCH 5/5] thermal/core: Move the mutex inside the thermal_zone_device_update() function Daniel Lezcano
[not found] ` <CGME20220812103956eucas1p1849443855b3537c3f5be2891fa50a50b@eucas1p1.samsung.com>
2022-08-12 10:39 ` Marek Szyprowski
2022-08-12 13:12 ` Daniel Lezcano [this message]
2022-08-12 13:34 ` [PATCH] thermal/core: Fix lockdep_assert() warning Marek Szyprowski
2022-08-12 13:54 ` Daniel Lezcano
2022-08-20 11:57 ` Rafael J. Wysocki
2022-08-12 13:17 ` [PATCH 5/5] thermal/core: Move the mutex inside the thermal_zone_device_update() function Daniel Lezcano
2022-08-05 16:29 ` [PATCH 1/5] thermal/core: Rearm the monitoring only one time Rafael J. Wysocki
2022-08-05 16:37 ` Daniel Lezcano
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=20220812131202.1331238-1-daniel.lezcano@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=amitk@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
/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
all inboxes | Powered by JetHome®