mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] thermal/drivers/qcom/tsens: Drop __init from the ->init callbacks
@ 2026-11-04 14:57 Christian Schmidbauer
  2026-11-04 14:57 ` [PATCH 1/2] thermal/drivers/qcom/tsens: Drop __init from init_common() Christian Schmidbauer
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Christian Schmidbauer @ 2026-11-04 14:57 UTC (permalink / raw)
  To: Amit Kucheria, Thara Gopinath, Rafael J. Wysocki, Daniel Lezcano
  Cc: Zhang Rui, Lukasz Luba, Dmitry Baryshkov, Konrad Dybcio,
	AngeloGioacchino Del Regno, linux-pm, linux-arm-msm,
	linux-kernel, Christian Schmidbauer

Every function that tsens_probe() calls through priv->ops->init() is
marked __init, so a probe after free_initmem() jumps into freed memory.
On IPQ8064 with CONFIG_IPQ_LCC_806X disabled, fw_devlink defers the
probe of gcc and its tsens child until the deferred probe timeout,
which expires after init memory is freed.  On an Aruba AP-325 the probe
then crashes in init_common().  With CONFIG_QCOM_TSENS=m the driver has
the same problem once the module's init function has returned.

Patch 1 drops __init from init_common() in a one-line change that
applies to every stable tree.  Patch 2 drops it from the eight per-SoC
callbacks.

Patch 1 was tested on an Aruba AP-325 on a v7.2-rc7 based tree.

Not tested:
- Patch 2 on hardware.  None of msm8226, msm8909, msm8939, msm8952,
  msm8956, mdm9607, ipq5018, ipq5332 or ipq5424 was available, so patch
  2 is only compile-tested.
- CONFIG_QCOM_TSENS=m on hardware.

Christian Schmidbauer (2):
  thermal/drivers/qcom/tsens: Drop __init from init_common()
  thermal/drivers/qcom/tsens: Drop __init from the per-SoC ->init
    callbacks

 drivers/thermal/qcom/tsens-v0_1.c | 9 +++++----
 drivers/thermal/qcom/tsens-v1.c   | 7 ++++---
 drivers/thermal/qcom/tsens-v2.c   | 2 +-
 drivers/thermal/qcom/tsens.c      | 2 +-
 4 files changed, 11 insertions(+), 9 deletions(-)


base-commit: 2dc1f296b5754dd2441fc8b6613a362a47f6b98f
-- 
2.54.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-04 15:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 14:57 [PATCH 0/2] thermal/drivers/qcom/tsens: Drop __init from the ->init callbacks Christian Schmidbauer
2026-11-04 14:57 ` [PATCH 1/2] thermal/drivers/qcom/tsens: Drop __init from init_common() Christian Schmidbauer
2026-11-04 14:57 ` [PATCH 2/2] thermal/drivers/qcom/tsens: Drop __init from the per-SoC ->init callbacks Christian Schmidbauer
2026-11-04 15:33 ` [PATCH 0/2] thermal/drivers/qcom/tsens: Drop __init from the " Daniel Lezcano

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®