Message ID | 20220719195325.402745-5-gpiccoli@igalia.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | The panic notifiers refactor strikes back - fixes/clean-ups | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Not a local patch, async |
On Tue, 19 Jul 2022 16:53:17 -0300, "Guilherme G. Piccoli" <gpiccoli@igalia.com> wrote: > 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> > > --- Applied to https://github.com/Broadcom/stblinux/commits/drivers/next, thanks! -- Florian
On 20/07/2022 20:00, Florian Fainelli wrote: > [...] > > Applied to https://github.com/Broadcom/stblinux/commits/drivers/next, thanks! > -- > Florian Thanks Florian =)
diff --git a/drivers/soc/bcm/brcmstb/pm/pm-arm.c b/drivers/soc/bcm/brcmstb/pm/pm-arm.c index 70ad0f3dce28..2a6adaa29596 100644 --- a/drivers/soc/bcm/brcmstb/pm/pm-arm.c +++ b/drivers/soc/bcm/brcmstb/pm/pm-arm.c @@ -25,7 +25,6 @@ #include <linux/kernel.h> #include <linux/memblock.h> #include <linux/module.h> -#include <linux/notifier.h> #include <linux/of.h> #include <linux/of_address.h> #include <linux/panic_notifier.h> @@ -664,7 +663,20 @@ static void __iomem *brcmstb_ioremap_match(const struct of_device_id *matches, return of_io_request_and_map(dn, index, dn->full_name); } - +/* + * The AON is a small domain in the SoC that can retain its state across + * various system wide sleep states and specific reset conditions; the + * AON DATA RAM is a small RAM of a few words (< 1KB) which can store + * persistent information across such events. + * + * The purpose of the below panic notifier is to help with notifying + * the bootloader that a panic occurred and so that it should try its + * best to preserve the DRAM contents holding that buffer for recovery + * by the kernel as opposed to wiping out DRAM clean again. + * + * Reference: comment from Florian Fainelli, at + * https://lore.kernel.org/lkml/781cafb0-8d06-8b56-907a-5175c2da196a@gmail.com + */ static int brcmstb_pm_panic_notify(struct notifier_block *nb, unsigned long action, void *data) {