soc/tegra: pmc: Don't register sys-off handler for multi-socket devices
Jon Hunter
maintainerPATCH 1/1 soc/tegra: pmc: Don't register sys-off handler for multi-socket devices
The kernel does not permit a device to register multiple sys-off handlers for non-default priority levels. Hence, for multi-socket Tegra devices, registering the sys-off handler in the Tegra PMC driver (which uses the low priority level) more than once fails.
The Tegra PMC sys-off handler is supported for all current generations of the Tegra SoC, however, it is only used as a low priority handler if everything else fails. For example, on Tegra264 the EFI reboot handler is called to restart the device. Therefore, for multi-socket devices, skip the registering of the sys-off handler to because this is not critical.
--- drivers/soc/tegra/pmc.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
drivers/soc/tegra/pmc.c +12 -9
@@ -3074,15 +3074,18 @@ static int tegra_pmc_probe(struct platform_device *pdev) } } - err =devm_register_sys_off_handler (&pdev->dev, -SYS_OFF_MODE_RESTART , -SYS_OFF_PRIO_LOW , - tegra_pmc_restart_handler, - pmc); -if (err) { -dev_err (&pdev->dev,"failed to register sys-off handler: %d\n" , - err); -return err; +if (dev_to_node (&pdev->dev) ==NUMA_NO_NODE ) { + err =devm_register_sys_off_handler (&pdev->dev, +SYS_OFF_MODE_RESTART , +SYS_OFF_PRIO_LOW , + tegra_pmc_restart_handler, + pmc); +if (err) { +dev_err (&pdev->dev, +"failed to register sys-off handler: %d\n" , + err); +return err; + } }/*
Signature · 1 line
2.43.0
From: Thierry Reding <[email protected]>
Quoted 5 lines · Jon Hunter
The kernel does not permit a device to register multiple sys-off handlers for non-default priority levels. Hence, for multi-socket Tegra devices, registering the sys-off handler in the Tegra PMC driver (which uses the low priority level) more than once fails.
Quoted 8 lines
The Tegra PMC sys-off handler is supported for all current generations of the Tegra SoC, however, it is only used as a low priority handler if everything else fails. For example, on Tegra264 the EFI reboot handler is called to restart the device. Therefore, for multi-socket devices, skip the registering of the sys-off handler to because this is not critical.
[...]
Applied, thanks!
[1/1] soc/tegra: pmc: Don't register sys-off handler for multi-socket devices
commit: 74a161d20ef60bb8db333a5203284796429ecb99
Best regards,
Signature · 1 line
Thierry Reding <[email protected]>