From: Lee Jones <lee@kernel.org>
To: lee@kernel.org, Amit Kucheria <amitk@kernel.org>,
Thara Gopinath <thara.gopinath@gmail.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Daniel Lezcano <daniel.lezcano@kernel.org>,
Zhang Rui <rui.zhang@intel.com>,
Lukasz Luba <lukasz.luba@arm.com>,
Priyansh Jain <priyansh.jain@oss.qualcomm.com>,
Lina Iyer <lina.iyer@linaro.org>,
Eduardo Valentin <edubezval@gmail.com>,
Rajendra Nayak <quic_rjendra@quicinc.com>,
linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH 09/10] thermal/drivers/qcom/tsens: Drop __init from ops init callbacks
Date: Thu, 3 Dec 2026 19:54:20 +0000 [thread overview]
Message-ID: <20261203195529.3063246-10-lee@kernel.org> (raw)
In-Reply-To: <20261203195529.3063246-1-lee@kernel.org>
The TSENS ops init callbacks (init_common and the per-SoC init helpers)
are annotated with __init even though they are stored in const struct
tsens_ops tables and invoked from non-__init tsens_probe(). When built
into the kernel, deferred probe or driver rebind after free_initmem()
jumps into freed init text.
Remove __init from all nine init callbacks.
Fixes: 9066073c6c27 ("thermal: qcom: tsens: Add a skeletal TSENS drivers")
Closes: https://sashiko.dev/#/bug/linux-efcbd818-b857-4c2b-831f-3fe62a3050ee
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/thermal/qcom/tsens-v0_1.c | 8 ++++----
drivers/thermal/qcom/tsens-v1.c | 6 +++---
drivers/thermal/qcom/tsens-v2.c | 2 +-
drivers/thermal/qcom/tsens.c | 2 +-
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/thermal/qcom/tsens-v0_1.c b/drivers/thermal/qcom/tsens-v0_1.c
index 468da9e513e2..bcd3c0bf49dd 100644
--- a/drivers/thermal/qcom/tsens-v0_1.c
+++ b/drivers/thermal/qcom/tsens-v0_1.c
@@ -207,7 +207,7 @@ static int calibrate_8974(struct tsens_priv *priv)
return 0;
}
-static int __init init_8226(struct tsens_priv *priv)
+static int init_8226(struct tsens_priv *priv)
{
static const u32 slopes[] = { 2901, 2846, 3038, 2955, 2901, 2846 };
@@ -217,7 +217,7 @@ static int __init init_8226(struct tsens_priv *priv)
return init_common(priv);
}
-static int __init init_8909(struct tsens_priv *priv)
+static int init_8909(struct tsens_priv *priv)
{
static const int p1_offsets[] = { 0, -10, 0, -9, -8 };
static const int p2_offsets[] = { 0, -6, 0, -9, -10 };
@@ -233,7 +233,7 @@ static int __init init_8909(struct tsens_priv *priv)
return init_common(priv);
}
-static int __init init_8939(struct tsens_priv *priv)
+static int init_8939(struct tsens_priv *priv)
{
static const u32 slopes[] = {
2911, 2789, 2906, 2763, 2922, 2867, 2833, 2838, 2840,
@@ -245,7 +245,7 @@ static int __init init_8939(struct tsens_priv *priv)
return init_common(priv);
}
-static int __init init_9607(struct tsens_priv *priv)
+static int init_9607(struct tsens_priv *priv)
{
static const int p1_offsets[] = { 1, -4, 4, -3, -4 };
static const int p2_offsets[] = { 1, -2, 8, -5, -4 };
diff --git a/drivers/thermal/qcom/tsens-v1.c b/drivers/thermal/qcom/tsens-v1.c
index a43ccc4bda86..14c6c6c2c0d6 100644
--- a/drivers/thermal/qcom/tsens-v1.c
+++ b/drivers/thermal/qcom/tsens-v1.c
@@ -148,7 +148,7 @@ static const struct reg_field tsens_v1_regfields[MAX_REGFIELDS] = {
[TRDY] = REG_FIELD(TM_TRDY_OFF, 0, 0),
};
-static int __init init_8952(struct tsens_priv *priv)
+static int init_8952(struct tsens_priv *priv)
{
static const int p1_offsets[] = { 2, -4, 4, 1, 2, -1, 0, 3, 2, 0, -3 };
static const int p2_offsets[] = { -1, -4, 5, 1, 3, -1, -1, 4, 4, 0, -2 };
@@ -161,7 +161,7 @@ static int __init init_8952(struct tsens_priv *priv)
return init_common(priv);
}
-static int __init init_8956(struct tsens_priv *priv)
+static int init_8956(struct tsens_priv *priv)
{
static const u32 slopes[] = {
3313, 3275, 3320, 3246, 3279, 3257, 3234, 3269, 3255, 3239, 3286,
@@ -173,7 +173,7 @@ static int __init init_8956(struct tsens_priv *priv)
return init_common(priv);
}
-static int __init init_tsens_v1_no_rpm(struct tsens_priv *priv)
+static int init_tsens_v1_no_rpm(struct tsens_priv *priv)
{
int i, ret;
u32 mask = 0;
diff --git a/drivers/thermal/qcom/tsens-v2.c b/drivers/thermal/qcom/tsens-v2.c
index 843dd29fad2e..22284973bb61 100644
--- a/drivers/thermal/qcom/tsens-v2.c
+++ b/drivers/thermal/qcom/tsens-v2.c
@@ -220,7 +220,7 @@ static int tsens_v2_calibration(struct tsens_priv *priv)
return 0;
}
-static int __init init_tsens_v2_no_rpm(struct tsens_priv *priv)
+static int init_tsens_v2_no_rpm(struct tsens_priv *priv)
{
struct device *dev = priv->dev;
int i, ret;
diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index ff7c573c6a21..6ea0581e9161 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -929,7 +929,7 @@ static const struct regmap_config tsens_srot_config = {
.reg_stride = 4,
};
-int __init init_common(struct tsens_priv *priv)
+int init_common(struct tsens_priv *priv)
{
void __iomem *tm_base, *srot_base;
struct device *dev = priv->dev;
--
2.56.1.911.g883d8bcb20-goog
next prev parent reply other threads:[~2026-12-03 19:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 19:54 [PATCH 00/10] thermal: Fix Critical and High issues reported by Sashiko Lee Jones
2026-12-03 19:54 ` [PATCH 01/10] thermal: intel: hfi: Pass byte size to alloc_pages_exact() and free_pages_exact() Lee Jones
2026-12-03 19:54 ` [PATCH 02/10] thermal: intel: hfi: Publish hfi_instance only after successful initialisation Lee Jones
2026-12-03 19:54 ` [PATCH 03/10] thermal: int3400: Clean up ODVP attributes after unregistering thermal zone Lee Jones
2026-12-03 19:54 ` [PATCH 04/10] thermal/drivers/qcom/tsens-v1: Validate sensor count before legacy calibration Lee Jones
2026-12-03 19:54 ` [PATCH 05/10] thermal/drivers/qcom/tsens: Bound sensor initialisation by num_sensors Lee Jones
2026-12-03 19:54 ` [PATCH 06/10] thermal/drivers/rcar: Free IRQs before cancelling delayed work on remove Lee Jones
2026-12-03 19:54 ` [PATCH 07/10] thermal/drivers/imx91: Acquire runtime PM reference in imx91_tmu_get_temp() Lee Jones
2026-12-03 19:54 ` [PATCH 08/10] tools/thermal/tmon: Open log file with O_NOFOLLOW before validating and truncating Lee Jones
2026-12-03 19:54 ` Lee Jones [this message]
2026-12-03 19:54 ` [PATCH 10/10] thermal/drivers/imx91: Use pm_runtime_resume_and_get() in imx91_tmu_change_mode() Lee Jones
2026-12-03 20:21 ` Frank Li
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=20261203195529.3063246-10-lee@kernel.org \
--to=lee@kernel.org \
--cc=amitk@kernel.org \
--cc=daniel.lezcano@kernel.org \
--cc=edubezval@gmail.com \
--cc=lina.iyer@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=priyansh.jain@oss.qualcomm.com \
--cc=quic_rjendra@quicinc.com \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
--cc=stable@vger.kernel.org \
--cc=thara.gopinath@gmail.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