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=1795934841; b=vk4V83Nnn1cZvLllUz6A4CH4nQDetD+S9aNF0dZrX9yv0gETYxpcG5r4rYsfkJ68LAQf EVpJXYma8s+yBOdKTec8dvVAj5iExSD9/ZAjYs1qgQ3b+yugIag9uHrBRAZMO8CBPv1mI 858J/Mf7Mc0zZST9eLnmuUlKHOXBA82vjl1sXacapx7RNUmzmWMiYMasWiEAYw54ijQYS N5nknaOiD+AWcIYhNdCVnl6eWFxA6T/0NFXoSWnzQMCqFdUnSM2KFY+Qae2KJK+jxEA03 M83lbohVyqz7m+RKG7ZFxeISkdNkvheLVGybGMsnLzyaRPg8qnePAXcLrNs1AeSuWfQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795934841; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=XUtyos5cz405p6M7B74ilVAI4rl7lzD5p9VYwHwOmS8=; b=s/rBylxKpVhVJjtFb53pXpsoaJOn2WT+GK4GQFcmqM7TgbFAbMe94voiuUre48rX5scy FJ9VRNEWI0IWJHXZfk7j6X2W2eScVPp0/t4VlKbvJReXrah+uSf/whyH1uwySYVvqiMAr X1Ks8rq6SN7AWgPhHQtZM4zDecx3p8Ghk9T7dYtjJOJvKE3szDKmhCpdITkJCxHru6llH O+iE0RmI9BPWYGjoWRQWrj7TTGVCN4kfEjrlfTrH4fFoK0esfurLIRcdCczgFNRmeCnBM iiF4B5XqUUIOTXZ9EBdJg+C/yLsiWM6DXrn1/cmIhANiG6Kq9lOufpcu84fIVhFHL7w== 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=iK7kGe5s; 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 0AAFE606A31C for ; Sun, 29 Nov 2026 06:47:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=iK7kGe5s Received: by smtp.kernel.org (Postfix) with ESMTPSA id 729F31F00896; Sun, 29 Nov 2026 06:47:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795934840; bh=XUtyos5cz405p6M7B74ilVAI4rl7lzD5p9VYwHwOmS8=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=iK7kGe5smlRlalociVPvb+hIQ6XjXjnTbzNpzTV1FnlohUkGSCfczSgpTSKZTKtY8 ku749eHV9cP+KzH9N5jPQIymLltU2hP0EEMsPO/mYZpj/LiO2KKVCZUPpFnBnnyIb7 dQASqbUtGm2MXaxq0IMspB9ifD6vkRjSy04FN4XeaF1hdSO/E/8m9OKMUKKriILbfM VWW/E4mkNuTMmgfgnvbG0Wd89zh7J5EvmfIema2OvRmwcW9L+EuxUJPGh7QxMlFeN5 cl5oi758T+Nbt1PXqerimQdt79aTxRoAULeAtq2hDTcY+Cs3G5481nTmkQ0/GS9An+ +cR0v6IAI/BJA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] thermal/drivers/imx: drop the runtime PM reference on early error returns Reply-To: sashiko-reviews@lists.linux.dev To: "Cong Nguyen" Cc: imx@lists.linux.dev, Frank.Li@kernel.org In-Reply-To: <20261129064412.2874472-1-congnt264@gmail.com> References: <20261129064412.2874472-1-congnt264@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 29 Nov 2026 06:47:19 +0000 X-Mailing-List: imx@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found no new issues in this patch, but noticed 1 related pre-existing issue it does not introduce: - [High] thermal/imx: double pm_runtime_put() in imx_thermal_probe() [1] -- commit 7763b771c159bce40eb214229e69123499779dca Author: Cong Nguyen thermal/drivers/imx: drop the runtime PM reference on early error returns This commit drops the runtime PM reference on data->dev before returning ea= rly on error in imx_get_temp() and imx_set_trip_temp(). > diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c > index 1a57aa9dc9001..3529b4a4cce1e 100644 > --- a/drivers/thermal/imx_thermal.c > +++ b/drivers/thermal/imx_thermal.c > @@ -266,8 +266,10 @@ static int imx_get_temp(struct thermal_zone_device *= tz, int *temp) > =20 > regmap_read(map, soc_data->temp_data, &val); > =20 > - if ((val & soc_data->temp_valid_mask) =3D=3D 0) > + if ((val & soc_data->temp_valid_mask) =3D=3D 0) { > + pm_runtime_put(data->dev); > return -EAGAIN; > + } > =20 > n_meas =3D (val & soc_data->temp_value_mask) > >> soc_data->temp_value_shift; > @@ -342,8 +344,10 @@ static int imx_set_trip_temp(struct thermal_zone_dev= ice *tz, > return ret; > =20 > /* do not allow passive to be set higher than critical */ > - if (temp < 0 || temp > trips[IMX_TRIP_CRITICAL].temperature) > + if (temp < 0 || temp > trips[IMX_TRIP_CRITICAL].temperature) { > + pm_runtime_put(data->dev); > return -EINVAL; > + } > =20 > imx_set_alarm_temp(data, temp); > trips[IMX_TRIP_PASSIVE].temperature =3D temp; [Severity: High] This problem wasn't introduced by this patch, but can imx_thermal_probe() underflow the runtime PM usage counter on data->dev [1] if pm_runtime_resume_and_get() fails? drivers/thermal/imx_thermal.c:imx_thermal_probe() { ... ret =3D pm_runtime_resume_and_get(data->dev); if (ret < 0) goto disable_runtime_pm; ... disable_runtime_pm: pm_runtime_put_noidle(data->dev); pm_runtime_disable(data->dev); ... } pm_runtime_resume_and_get() already drops its usage reference on failure, so jumping to disable_runtime_pm decrements the usage counter a second time. [1] https://sashiko.dev/#/bug/linux-2ad226fd-def3-4ce1-8261-087d5f0a6696 --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261129064412.2874= 472-1-congnt264@gmail.com?part=3D1