Skip to content

thermal/drivers/qcom/tsens: Drop __init from the ->init callbacks

Christian Schmidbauer linux-arm-msm linux-pm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2thermal/drivers/qcom/tsens: Drop __init from init_common()drivers/thermal/qcom/tsens.c+1 -10 replies
2/2thermal/drivers/qcom/tsens: Drop __init from the per-SoC ->init callbacksdrivers/thermal/qcom/tsens-v0_1.c drivers/thermal/qcom/tsens-v1.c drivers/thermal/qcom/tsens-v2.c+10 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] thermal/drivers/qcom/tsens: Drop __init from the ->init callbacks

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

Signature · 1 line
2.54.0