From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796327818; b=aZJ20HrpeNhZXff/YwY4qp0Efl+9OEfdCTBysExwhNVq+UypyCS/abNUcESDUV20yjAE q3Wr6KMSWkv8evw/kP9qpCFW+SJVzUhg30bmeuObRDk5Lmgom9GV98oxsDtczNNdRy4oO dQa3wa7TeKHA0TTLOmC5G4qKD4t9t511vBPCXn6sX/FLMscR9w3AFKdue+P2qVtDsm4sC iXSPtDnI4T8E9utRHj5e0kpqDc4p1y7tPe2A4HQ1+TCQnJAHnGohwAFhGGkYSik02Sp7m w9gF/aLgzA4q/Ry3kO6+r1SuHGeDXA2jqNi0c4QkWrBo5h4/bRpem5srF/jqRDZlhKw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796327818; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=eARiYhkZp7o5Ta+qkceR86NpZXYQntytcwQ0vOlIjSY=; b=3ETi0Oq0fltPzeIcDR6sXG8SM0UAI5dyxn8ZkdmheFkpb3ylbI2tHCmfYCg7RNrH+d7z 5YB9jkTUyJO7qSgRUceNvt9JZRxhXEe+g+jpPV+cpr5bSQtL5bssirnIgIC3vu3uYBTuc qfwlQ5OIzTD5KmaX+M3I8wAumfueU102gU3UXzPv/CDbTV0mNDZeQoWs/Z1leYAYvCuPO sV9cF0JLjQqD6hGr91R6wGv97azn8efSIAonLhn+/eRDBcQhxePYtGpFI/JqKZiQIOCBi wb/VcR3wjJonUsVY7akgoJuEMR54ws7hNiSUPZiVEoCoe3dkcSLyTvlDkJ8GnV2ZM6Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=cz45Sjru; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5330F606A322; Thu, 3 Dec 2026 19:56:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=cz45Sjru Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82FEA1F0092B; Thu, 3 Dec 2026 19:56:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796327817; bh=eARiYhkZp7o5Ta+qkceR86NpZXYQntytcwQ0vOlIjSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cz45SjruRPb5UnesXZHPhqslgGIijpxIB6qKGXfgvj18UQbzBzcHS3MrK4XMBIfpX v4rSCTCZADd3kR5ARRVhXo5BATpzJU0maNRZvGs0EJDMXG1Zk4M94tT90+1WzAOMC0 8jr/IjwSdR4T1zHsdATAk4TWUxbgGVIDFcYP4LbT6WHJL3ntjJl5QF+XgtCGewTtG6 u02EeruTgzAUQv3XvjHqUmCSKxKBe5cOO1XdNEOU+o1A7Fw6BDYYauYJdhoM9XWtB5 XPPvVrllMqlJjsqQ0I0Qqsxqy9MtYG1kTQRCejtp7MvrIe1tybKq55V41JZ8cFbftp 7cYZZEtYmSWeA== From: Lee Jones To: lee@kernel.org, Amit Kucheria , Thara Gopinath , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Priyansh Jain , Lina Iyer , Eduardo Valentin , Rajendra Nayak , 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 Message-ID: <20261203195529.3063246-10-lee@kernel.org> X-Mailer: git-send-email 2.56.1.915.g69d5ec7298-goog In-Reply-To: <20261203195529.3063246-1-lee@kernel.org> References: <20261203195529.3063246-1-lee@kernel.org> X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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