Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp863790lqc; Fri, 8 Mar 2024 14:09:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWnjEqgWXJD4OAeQyIx2mGKyqe1MLUjiz+hKv7Jd5kGAjhY/cIuO2pbQCQVfzTgCLLeAWHQp/MrXr8x+R7tE0JPueR2t5LpfybwLgn94g== X-Google-Smtp-Source: AGHT+IHoSlzGvVrbnN1gGiGXY4BhYzcGK+NEQ9u+QN6Ht+AaWVKl7g1DXzS7fKHgrcBGK/W1t9ZC X-Received: by 2002:ac5:c292:0:b0:4d1:3f59:5c79 with SMTP id h18-20020ac5c292000000b004d13f595c79mr522362vkk.15.1709935757153; Fri, 08 Mar 2024 14:09:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709935757; cv=pass; d=google.com; s=arc-20160816; b=eUk62/NbX+cSuNgeXpMZIndLgEyCDm5sx9VRbvQjP3D+c7sMkhuPFbDpWipDplKabi oFH0CyFOYYgGiP2bD6sBSpp+RdpjXDreGMq4n5KR3GbDW1Nij+xJz/1ReTrje8V3wxC2 i0VXBbKXXL/wkQd0QbCVhQR+M0I6z6UtHrdLnWzcidvGE6QafGvHcuhE6YiiA7oZXeGQ HUaApsTRbDdHSLHEKCG/5mGqVd0fIMYbQSaAH5jTO649TIzN44X1SUq3/5qicTkUb0nt /7/cGnf1XvkmVQtEPHfRw1aU6MvCUQQ5jkQ2RPC9R/E31L1hWrYLhhKOLnaF3pgH3F6J GxvA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=PwYLLPvl+vc8WoafYRVCdkEDCnelT/9QzPyhGkE8pJY=; fh=8idnzTd2CSx6YmKTNOkWGIO6S2hBWla+vkY+BV5DExU=; b=bxO39mO2i5hdjm56Pgi2sYhuL1wB0Vp/f6jbvmGoRyWL6qZkouklXe9i63atKJk9vC xB7veGcJTSk+mZ//LGpOhd5pnADGKH2apRIZBZhTOeEfJy0cCCiwRFINGZc0SabXz3V9 JnApwyeYqbmorCw4EpyloipVi3Ko64rYs3oh6CnXn9k9GawU7SUM2zoIKYbWr7z5myPC 9cXihdjnc3ybEfkDId83SeoKTfWxGL8cJcKF8estxeRzBDXxRRw6SXz3QdfXAkheVwqL 1f8WOHajPlhnzADanNCCYvwdSigOExUR7mlFm5rwnVFovgnSgqNbksRvMl82gu6o3uUu ++hA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YhyMJIXr; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-97622-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97622-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id kk30-20020a056214509e00b00690048af8b3si394620qvb.313.2024.03.08.14.09.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 14:09:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-97622-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YhyMJIXr; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-97622-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97622-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DCC241C20CFC for ; Fri, 8 Mar 2024 22:09:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 507E0605C1; Fri, 8 Mar 2024 22:08:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="YhyMJIXr" Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8236660259 for ; Fri, 8 Mar 2024 22:08:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709935717; cv=none; b=S69XtkAyENjp75u6UO93qkFSF6i1qsT+lJPAxEXxL8FK5sM3/5dE82Yr6y+ZVUC91H1bcnRxxPS6F1SZ4Ob7eGbNsOr6m7KlUtSgfmFN93GcTVG2eCMgbB69PP9c2p8k3SVUFuRb1LKN7yLsvnBEkXwBgjHu+7YpT/XkKLr+3z8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709935717; c=relaxed/simple; bh=eWOTmd2tsTLxXcstbYbn83ahKI+wXi5kjtikQvd8TmA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qRqPc6Vy5X1lnTkF2Io/lazZVHilMiJVHa9mFx8qfFQnh1RrkhPavNalzwn8eNOuVTbrhMUntLqxlZ5jy9iMrBvWZn8FaeBVNFoO0NX6RFGWcwY7LOXsnChVPSENN37UDu6ziiCGlOe1Fu4SZHKMHUGFavF3QbnJQrEWDo84MJs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=YhyMJIXr; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-51320ca689aso1684969e87.2 for ; Fri, 08 Mar 2024 14:08:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709935714; x=1710540514; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=PwYLLPvl+vc8WoafYRVCdkEDCnelT/9QzPyhGkE8pJY=; b=YhyMJIXrDBsTh70IwTXS3erwIly2laaNXDL6+KURz103rcq1FktJnemZ/zP79RhbHK DV52yJZvBWAtxkezYSA6BkP1tI8l1G+9uzySxjO1T/QPABlyXze7p5tpwFf1icqNL4i6 2P9WBZub056ZXwwjIO358O/4BIeen3CdnuuvFziRvFDnCVt098x+yrnXM9cDEsLhjJHs PP2V/VHQ1O3duIamdSdbpoIu/zvSoE1VJUkL3okmPthSDZ3NfCfNQsF9Rqg2jb78Oiup d5l+8w+Gqs1/65Jk0hpsTvc0J5pMYgQW9pkNr8+lCkDUHMk50mPatzNnNEbYOT66m6gy rTaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709935714; x=1710540514; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PwYLLPvl+vc8WoafYRVCdkEDCnelT/9QzPyhGkE8pJY=; b=mb/MJ/dYcD+PrRc+h3pmRUE1BlpXrZQF4kAGmynC3wm+nuORuGgLAVG1BQ4gbQ56JF tWGQh9tjXVFzfVJOgUhETHZABdwV5iASliQ87i7J6tqFPQrfQgcyIt+t9lwTTY7m+wVx PzD97Lzsz0jVFAhGE1Q9J7bL01usRP9+x7E+uQEVmn6yvavHecJozf+xZiqrbyRM8X4n 9gkYROcD04+Fvc/fb+WfVcXRRibP9hdxKH0P80lbmkcQH8qL+76euSX1jYJDaTQeBJF2 luZ1B05B2eY79KifIX0zaoZPZQKUKx4ZYSlQYbtUY5X3er1rlJGIbQlPJOYP1KVRNUHn 0u6A== X-Forwarded-Encrypted: i=1; AJvYcCVNtiME6TDsk7NHM1PBHo3jgVwsfVHyzYMI+tfMj/ZH3eT69WfYwpa0HybC/lFXyzkxfzbwZSm9jfiIoVLZzviT/g+xqiuiwMY13GXx X-Gm-Message-State: AOJu0Yyy+xxJFUoNM+0XJ7OiFEKYO6j82DDfWwPHKjuzkX6rnT3YhFbC EdFD23WQ31cAOoG2JqBf4um7mAgSwi10zgen7Tx6917f740Adf+1uXBF5lCzmwQ= X-Received: by 2002:ac2:5e78:0:b0:513:593e:12c3 with SMTP id a24-20020ac25e78000000b00513593e12c3mr155945lfr.50.1709935713679; Fri, 08 Mar 2024 14:08:33 -0800 (PST) Received: from [10.167.154.1] (078088045141.garwolin.vectranet.pl. [78.88.45.141]) by smtp.gmail.com with ESMTPSA id a14-20020a056512020e00b005130ff68b87sm78241lfo.109.2024.03.08.14.08.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 14:08:33 -0800 (PST) From: Konrad Dybcio Date: Fri, 08 Mar 2024 23:08:21 +0100 Subject: [PATCH 2/3] thermal: qcom: lmh: Check for SCM avaiability at probe Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240308-topic-rb1_lmh-v1-2-50c60ffe1130@linaro.org> References: <20240308-topic-rb1_lmh-v1-0-50c60ffe1130@linaro.org> In-Reply-To: <20240308-topic-rb1_lmh-v1-0-50c60ffe1130@linaro.org> To: Bjorn Andersson , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thara Gopinath , Amit Kucheria Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Dmitry Baryshkov , Konrad Dybcio , stable@vger.kernel.org X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709935708; l=887; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=eWOTmd2tsTLxXcstbYbn83ahKI+wXi5kjtikQvd8TmA=; b=401goTee880ks06op80EKYjIveyZC5BEA5EmmeGSyAwJsuAfi4ne5Vaa2dRdOt5Aq/UBeKmf9 xFVGDRm6yWuCBc2d54oDP6CUiP0MxtyBl/VnmgfIF62nr+BdmAcMdwZ X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Up until now, the necessary scm availability check has not been performed, leading to possible null pointer dereferences (which did happen for me on RB1). Fix that. Fixes: 53bca371cdf7 ("thermal/drivers/qcom: Add support for LMh driver") Cc: Signed-off-by: Konrad Dybcio --- drivers/thermal/qcom/lmh.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/thermal/qcom/lmh.c b/drivers/thermal/qcom/lmh.c index f6edb12ec004..5225b3621a56 100644 --- a/drivers/thermal/qcom/lmh.c +++ b/drivers/thermal/qcom/lmh.c @@ -95,6 +95,9 @@ static int lmh_probe(struct platform_device *pdev) unsigned int enable_alg; u32 node_id; + if (!qcom_scm_is_available()) + return -EPROBE_DEFER; + lmh_data = devm_kzalloc(dev, sizeof(*lmh_data), GFP_KERNEL); if (!lmh_data) return -ENOMEM; -- 2.44.0