- Disable the CPU PM notifier for OMAP4430 for suspend in order to

prevent wrong temperature leading to a critical shutdown (Peter
   Ujfalusi)
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEGn3N4YVz0WNVyHskqDIjiipP6E8FAl+2TDEACgkQqDIjiipP
 6E8QdAf+Oywmk7h/SuD3tCsZimVQui03OJ1uuhgz//xNsCLhLGYa9KMNydhgCT56
 hzecDbgH6Hmh1NC/PiMdAOUsZkJUkoFRX89RCm9JsQoCqzOVlCguLI+LdmU0IBLC
 phFnQPff/eWbezk03hilb+rKWpYt/NmiUH7suH7drXZzCCIEB1EET+td2qHL0rXZ
 A+a1sPHoO6cdRuNimFJSV/C9V7ICDZDVBKJGWoh1VXVIid7wfgLEARuLAl45us3l
 yOzgRtlihWnOQ45VLPEXy6yMMSC1PnOiYmcCY0Oal0rxEbLz8JzXoM6Ojl5OpS7n
 xcQcl7ja3zEjguV2jD9CYt/BCplEyA==
 =vpbm
 -----END PGP SIGNATURE-----

Merge tag 'thermal-v5.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux

Pull thermal fix from Daniel Lezcano:
 "Disable the CPU PM notifier for OMAP4430 for suspend in order to
  prevent wrong temperature leading to a critical shutdown (Peter
  Ujfalusi)"

* tag 'thermal-v5.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux:
  thermal: ti-soc-thermal: Disable the CPU PM notifier for OMAP4430
This commit is contained in:
Linus Torvalds 2020-11-19 10:49:35 -08:00
commit 841d6e9ec9

View File

@ -20,6 +20,7 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/sys_soc.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
@ -864,6 +865,17 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev)
return bgp; return bgp;
} }
/*
* List of SoCs on which the CPU PM notifier can cause erros on the DTEMP
* readout.
* Enabled notifier on these machines results in erroneous, random values which
* could trigger unexpected thermal shutdown.
*/
static const struct soc_device_attribute soc_no_cpu_notifier[] = {
{ .machine = "OMAP4430" },
{ /* sentinel */ },
};
/*** Device driver call backs ***/ /*** Device driver call backs ***/
static static
@ -1020,7 +1032,8 @@ int ti_bandgap_probe(struct platform_device *pdev)
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
bgp->nb.notifier_call = bandgap_omap_cpu_notifier; bgp->nb.notifier_call = bandgap_omap_cpu_notifier;
cpu_pm_register_notifier(&bgp->nb); if (!soc_device_match(soc_no_cpu_notifier))
cpu_pm_register_notifier(&bgp->nb);
#endif #endif
return 0; return 0;
@ -1056,7 +1069,8 @@ int ti_bandgap_remove(struct platform_device *pdev)
struct ti_bandgap *bgp = platform_get_drvdata(pdev); struct ti_bandgap *bgp = platform_get_drvdata(pdev);
int i; int i;
cpu_pm_unregister_notifier(&bgp->nb); if (!soc_device_match(soc_no_cpu_notifier))
cpu_pm_unregister_notifier(&bgp->nb);
/* Remove sensor interfaces */ /* Remove sensor interfaces */
for (i = 0; i < bgp->conf->sensor_count; i++) { for (i = 0; i < bgp->conf->sensor_count; i++) {