Skip to content

Commit 841d6e9

Browse files
committed
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
2 parents c2e7554 + b98467f commit 841d6e9

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

drivers/thermal/ti-soc-thermal/ti-bandgap.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/err.h>
2121
#include <linux/types.h>
2222
#include <linux/spinlock.h>
23+
#include <linux/sys_soc.h>
2324
#include <linux/reboot.h>
2425
#include <linux/of_device.h>
2526
#include <linux/of_platform.h>
@@ -864,6 +865,17 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev)
864865
return bgp;
865866
}
866867

868+
/*
869+
* List of SoCs on which the CPU PM notifier can cause erros on the DTEMP
870+
* readout.
871+
* Enabled notifier on these machines results in erroneous, random values which
872+
* could trigger unexpected thermal shutdown.
873+
*/
874+
static const struct soc_device_attribute soc_no_cpu_notifier[] = {
875+
{ .machine = "OMAP4430" },
876+
{ /* sentinel */ },
877+
};
878+
867879
/*** Device driver call backs ***/
868880

869881
static
@@ -1020,7 +1032,8 @@ int ti_bandgap_probe(struct platform_device *pdev)
10201032

10211033
#ifdef CONFIG_PM_SLEEP
10221034
bgp->nb.notifier_call = bandgap_omap_cpu_notifier;
1023-
cpu_pm_register_notifier(&bgp->nb);
1035+
if (!soc_device_match(soc_no_cpu_notifier))
1036+
cpu_pm_register_notifier(&bgp->nb);
10241037
#endif
10251038

10261039
return 0;
@@ -1056,7 +1069,8 @@ int ti_bandgap_remove(struct platform_device *pdev)
10561069
struct ti_bandgap *bgp = platform_get_drvdata(pdev);
10571070
int i;
10581071

1059-
cpu_pm_unregister_notifier(&bgp->nb);
1072+
if (!soc_device_match(soc_no_cpu_notifier))
1073+
cpu_pm_unregister_notifier(&bgp->nb);
10601074

10611075
/* Remove sensor interfaces */
10621076
for (i = 0; i < bgp->conf->sensor_count; i++) {

0 commit comments

Comments
 (0)