From 63f7efc3196dda659cdad1e628d42f214ca971cb Mon Sep 17 00:00:00 2001 From: Thomas Makin Date: Mon, 12 Oct 2026 16:50:55 -0500 Subject: [PATCH] soc: tegra: add t21x panic handler --- drivers/soc/tegra/pmc.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 53cb04cb3743..5ffddf19f857 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -419,6 +419,8 @@ struct tegra_pmc_soc { bool has_usb_sleepwalk; bool supports_core_domain; bool has_single_mmio_aperture; + + bool cboot_panic_notifier; }; /** @@ -505,6 +507,7 @@ struct tegra_pmc { unsigned long *wake_cntrl_level_map; struct notifier_block reboot_notifier; + struct notifier_block panic_notifier; struct syscore syscore; /* Pending wake IRQ processing */ @@ -3199,6 +3202,20 @@ static int tegra_pmc_probe(struct platform_device *pdev) } } + if (pmc->soc->cboot_panic_notifier) { + pmc->panic_notifier.notifier_call = tegra_pmc_panic_handler; + pmc->panic_notifier.priority = INT_MAX-1; + + err = atomic_notifier_chain_register(&panic_notifier_list, + &pmc->panic_notifier); + if (err) { + dev_err(&pdev->dev, + "unable to register panic notifier, %d\n", + err); + return err; + } + } + err = devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_RESTART, SYS_OFF_PRIO_LOW, @@ -4018,6 +4035,7 @@ static const struct tegra_pmc_soc tegra210_pmc_soc = { .has_blink_output = true, .has_usb_sleepwalk = true, .has_single_mmio_aperture = true, + .cboot_panic_notifier = true, }; static const char * const tegra210b01_powergates[] = { @@ -4079,6 +4097,7 @@ static const struct tegra_pmc_soc tegra210b01_pmc_soc = { .has_blink_output = true, .has_usb_sleepwalk = true, .has_single_mmio_aperture = true, + .cboot_panic_notifier = true, }; static const struct tegra_io_pad_soc tegra186_io_pads[] = {