Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.49 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793804264; b=xZ5vXA6G5aISqB8fcrwkOp4HI2UgF+gAV8VcjnIR2YCOqTaR0PZKuywMl1Crhd3DFpMU zY2eWf1AAaxloTHXmHvDS9TDiFhPwiuRQE5qwUNVpw79Q2xyk7tlnGGE8FnWIbK3qLF+w Ltf6rITe8F0mHNCoGHGX4a1PZIQmtMmYTXON/jXXALgxB6pY/azTxyqCio4nLaVZqCTlZ vTFpqVsIzPpfx1WmYtlxOSdvK9Cb8awbUf6LJdwTCIO5x3In13rSafX9Rgr8xgwXFGLRi wIcF55YFcyS8hgZzbA9PIjCfv8d1VREKAT2DrhE8KmL5Tomj9en2fl2vkJ2ZD9adyWg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793804264; h=DMARC-Filter:Received:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=KUz2D34UCSVw+yqhvoh+RPWtDjdbKvsiINtzwSInBU8=; b=RFUbhUwbU5w3hvKkcr9LKSbPwygCoyby+1i8GptzoLkfqfptnsW7lrAZ0IAxZGJUPk2L ZPRa3MvZ+jcWkYvhArp1a7xI6KNKLVXEWhB+Od5Byf8mjoUHy5oYNV5B6uae4xeUMprWZ lCQi9ebx8j3cpOeh4gXNSl573NhZW0tGkI6g669vpeuUi5NQguXQkkLsrrXFyOwEYE9K8 i1rMR9CYsGsz98lsoRxxPRrVgo9Yu3SUiHfR8zrcvfEYEwbJDdUMAklpM4yKwiauGLg8L bIXzBKCG911ArrCNXbZIliXvJFtU+uUB90mKhucfu9HcAzehwRpg8ERekFZWBSixTSA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=grische.xyz; spf=pass smtp.mailfrom=grische.xyz; arc=none smtp.remote-ip=209.85.221.49 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78995606A32F for ; Wed, 4 Nov 2026 14:57:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 78995606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=grische.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=grische.xyz Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-48afbd2c386so581558f8f.3 for ; Wed, 04 Nov 2026 06:57:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793804263; x=1794409063; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=KUz2D34UCSVw+yqhvoh+RPWtDjdbKvsiINtzwSInBU8=; b=C2WO0jQpJhSBsaHvVAnJ/SEJpVJnduc6bcuA7FhdzUoUSBE/DyOc3sEY01Hf0uaBef eoGx1NSyQtq9FiBhjB8fFeH8mYqErw3Tn60IYZ4CX8pkzPJkC07d0mYNGgiIOG/6ejPC 6gAWPvw98AeL1BVjK+mBjorDeQtC3L0fHgZnEr1OWkrBUcbf/qhyc39Ki8vp0LFNIH70 j5GWrO6plnuG4rQVzSVVXyGZAj39u6ZjM4ACWNiSrUwS+EPVMu2+2eX165QCRbG05yxw qCEFogcGLbCi8K1hXDL6C/XGxYwhF0PLq/5+cCzlN10zH0cqqw4wM2VKqMWDHxrtzsBD vqUA== X-Forwarded-Encrypted: i=1; AKwUvBxP4alkVJhFcxOE7Vwzme/k7kUVFyJe+E6kuDCWBTPix1+gzzxY1PLm23w/mZHzW/113zzT7UijPFH3eQjS@vger.kernel.org X-Gm-Message-State: APuU4Z+F93L2mDvBF0aDllD79M0lvYKCRFDiWLSyn6q1x69PF9symJkW SS1wal5gwxzhkThn1ifIBZHTP4rqUveL9NWZnSYmQppR4lrLtXjEtswd2/cdQZ+CmRY= X-Gm-Gg: AYBFou1B47vEab/O+9+QrfOZjY2s1OEAD/wjQQpT6Iq6lrgBtIYU+MF8+87+TycDwBK kyo9ZNhRlytkOU/9LNrdLa7hmUXc+DCut1msAXq6lyl3hfaNke7YDpaPAywAajxWfNXtcUtZZbb S3+MvFxuUakMqK1CQCZWK4E3DB9arIvsSRoABrQmfLw52HhmctpmmWoeHi0nxqfRs4gHr/7ZdPK gB4c//jSd4Sx9eqyM3UTQS0YbszIf8kloW9BfyGC3z++r6I8HuNEyQmd1U9ED0gNpFncptQgcls 34c/H0vk77ChskcQ+rxuNjkvlkPoW7YWTFZAmJgd4ItGGckeHApUJ7XMnswdMkGNKGWb9bttr1K T+dptEkPz1JO/r7gutvZrkU6/OfYxlkytTf12/ypEnGPRD4NA3CxuYbsKvMGo3oZdVZuzysaT6y L6HBIzeSmTyp+wwRZFJUcHc48Ch8oCI+amRewrBS9AflnTSy4qYJmByyfQwGv20loxX2hlTpOPq LwLOcTbmCCtYtuFryFW1WlmrtNVAFt7KdRfOcwErgRnqBMa95jzCAqwVUoTNwfHVHlTvA0cPiCa /zqpOjSfL/a+R7PfCRBL31vZzWa2fd2q2hTJDANbTlVS08U= X-Received: by 2002:a05:6000:310f:b0:488:83f7:6352 with SMTP id ffacd0b85a97d-48e6e2c33admr32579809f8f.4.1793804262816; Wed, 04 Nov 2026 06:57:42 -0800 (PST) Received: from lake ([2a02:810d:d09:1b65:4366:70cb:bf82:f8ac]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48fecf8ef85sm4830051f8f.27.2026.11.04.06.57.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2026 06:57:42 -0800 (PST) From: Christian Schmidbauer To: Amit Kucheria , Thara Gopinath , "Rafael J. Wysocki" , Daniel Lezcano Cc: Zhang Rui , Lukasz Luba , Dmitry Baryshkov , Konrad Dybcio , AngeloGioacchino Del Regno , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Christian Schmidbauer Subject: [PATCH 1/2] thermal/drivers/qcom/tsens: Drop __init from init_common() Date: Wed, 4 Nov 2026 15:57:39 +0100 Message-ID: <20261104145740.2623473-2-opensource@grische.xyz> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261104145740.2623473-1-opensource@grische.xyz> References: <20261104145740.2623473-1-opensource@grische.xyz> X-Mailing-List: linux-arm-msm@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 Several tsens_ops instances store init_common() as their ->init callback, which tsens_probe() calls through priv->ops->init(). init_common() is marked __init, but tsens_probe() is a normal platform driver probe and can run after free_initmem(). This happens on IPQ8064 when CONFIG_IPQ_LCC_806X is disabled. In qcom-ipq8064.dtsi the tsens node is a child of gcc, which uses a clock from the LCC. Because no driver binds the LCC, fw_devlink defers the probe of gcc until deferred_probe_timeout_work_func() runs. deferred_probe_initcall() schedules that work to run CONFIG_DRIVER_DEFERRED_PROBE_TIMEOUT seconds later, when kernel_init() has already freed init memory. On an Aruba AP-325 the probe then crashes: Unable to handle kernel execution of memory at virtual address c0e1ffe0 Workqueue: events_unbound deferred_probe_work_func PC is at init_common+0x0/0x540 LR is at tsens_probe+0x138/0x4b4 With CONFIG_QCOM_TSENS=m the driver has the same problem, because the module loader frees __init code once the module's init function returns and a later bind then calls into freed memory. Removing __init from init_common() covers the ops that store it directly, but the per-SoC init functions that wrap it are also marked __init and need the same change. Tested on an Aruba AP-325. Fixes: 9066073c6c27 ("thermal: qcom: tsens: Add a skeletal TSENS drivers") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-5 Signed-off-by: Christian Schmidbauer --- drivers/thermal/qcom/tsens.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index 4d7013fc79d6..710c78aff8bc 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.54.0