Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soc: bcm: brcmstb: Document panic notifier action and remove useless header

The panic notifier of this driver is very simple code-wise, just a
memory write to a special position with some numeric code. But this
is not clear from the semantic point-of-view, and there is no public
documentation about that either.

After discussing this in the mailing-lists [0] and having Florian
explained it very well, document that in the code for the future
generations asking the same questions. Also, while at it, remove
a useless header.

[0] https://lore.kernel.org/lkml/781cafb0-8d06-8b56-907a-5175c2da196a@gmail.com

Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Doug Berger <opendmb@gmail.com>
Cc: Justin Chen <justinpopo6@gmail.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Markus Mayer <mmayer@broadcom.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Link: https://lore.kernel.org/r/20220719195325.402745-5-gpiccoli@igalia.com
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

authored by

Guilherme G. Piccoli and committed by
Florian Fainelli
751c3e19 568035b0

+14 -2
+14 -2
drivers/soc/bcm/brcmstb/pm/pm-arm.c
··· 25 25 #include <linux/kernel.h> 26 26 #include <linux/memblock.h> 27 27 #include <linux/module.h> 28 - #include <linux/notifier.h> 29 28 #include <linux/of.h> 30 29 #include <linux/of_address.h> 31 30 #include <linux/panic_notifier.h> ··· 663 664 664 665 return of_io_request_and_map(dn, index, dn->full_name); 665 666 } 666 - 667 + /* 668 + * The AON is a small domain in the SoC that can retain its state across 669 + * various system wide sleep states and specific reset conditions; the 670 + * AON DATA RAM is a small RAM of a few words (< 1KB) which can store 671 + * persistent information across such events. 672 + * 673 + * The purpose of the below panic notifier is to help with notifying 674 + * the bootloader that a panic occurred and so that it should try its 675 + * best to preserve the DRAM contents holding that buffer for recovery 676 + * by the kernel as opposed to wiping out DRAM clean again. 677 + * 678 + * Reference: comment from Florian Fainelli, at 679 + * https://lore.kernel.org/lkml/781cafb0-8d06-8b56-907a-5175c2da196a@gmail.com 680 + */ 667 681 static int brcmstb_pm_panic_notify(struct notifier_block *nb, 668 682 unsigned long action, void *data) 669 683 {