[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181002132502.287709813@linuxfoundation.org>
Date: Tue, 2 Oct 2018 06:22:23 -0700
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Jean-Christophe Dubois <jcd@...budubois.net>,
Fabio Estevam <fabio.estevam@....com>,
Eduardo Valentin <edubezval@...il.com>,
Sasha Levin <alexander.levin@...rosoft.com>
Subject: [PATCH 4.18 046/228] thermal: i.MX: Allow thermal probe to fail gracefully in case of bad calibration.
4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Christophe Dubois <jcd@...budubois.net>
[ Upstream commit be926ceeb4efc3bf44cb9b56f5c71aac9b1f8bbe ]
Without this fix, the thermal probe on i.MX6 might trigger a division
by zero exception later in the probe if the calibration does fail.
Note: This linux behavior (Division by zero in kernel) has been triggered
on a Qemu i.MX6 emulation where parameters in nvmem were not set. With this
fix the division by zero is not triggeed anymore as the thermal probe does
fail early.
Signed-off-by: Jean-Christophe Dubois <jcd@...budubois.net>
Reviewed-by: Fabio Estevam <fabio.estevam@....com>
Signed-off-by: Eduardo Valentin <edubezval@...il.com>
Signed-off-by: Sasha Levin <alexander.levin@...rosoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/thermal/imx_thermal.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -604,7 +604,10 @@ static int imx_init_from_nvmem_cells(str
ret = nvmem_cell_read_u32(&pdev->dev, "calib", &val);
if (ret)
return ret;
- imx_init_calib(pdev, val);
+
+ ret = imx_init_calib(pdev, val);
+ if (ret)
+ return ret;
ret = nvmem_cell_read_u32(&pdev->dev, "temp_grade", &val);
if (ret)
Powered by blists - more mailing lists