Re: [PATCH 3/3] powerpc: Convert fsl_rstcr_restart to a reset handler
On Tue, 2016-07-26 at 14:22 -0700, Andrey Smirnov wrote: > On Tue, Jul 26, 2016 at 12:59 AM, Scott Woodwrote: > > > > On Mon, 2016-07-25 at 21:25 -0700, Andrey Smirnov wrote: > > > > > > Convert fsl_rstcr_restart into a function to be registered with > > > register_reset_handler() API and introduce fls_rstcr_restart_register() > > > function that can be added as an initcall that would do aforementioned > > > registration. > > > > > > Signed-off-by: Andrey Smirnov > > Is there a particular motivation for this (e.g. new handlers you plan to > > register elsewhere)? > I have a MPC8548 based board that which uses, at least for time being, > SBC8548's init code(by claiming compatibility in DT) which has an > external watchdog that implements reset functionality. The driver for > watchdog is just a generic watchdog driver and having an ability to > register custom reset handlers is very handy. > > I don't really have any motivation for fixing boards other than > SBC8548 and even that I can avoid doing by making a new custom board > file in my tree that would not populate .reset field. I can drop this > patch from the series if the code of those boards is in "don't touch > it unless absolutely have to" state. I'm not saying not to touch it -- I just wanted to understand the context. -Scott ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 3/3] powerpc: Convert fsl_rstcr_restart to a reset handler
On Tue, Jul 26, 2016 at 12:59 AM, Scott Woodwrote: > On Mon, 2016-07-25 at 21:25 -0700, Andrey Smirnov wrote: >> Convert fsl_rstcr_restart into a function to be registered with >> register_reset_handler() API and introduce fls_rstcr_restart_register() >> function that can be added as an initcall that would do aforementioned >> registration. >> >> Signed-off-by: Andrey Smirnov > > Is there a particular motivation for this (e.g. new handlers you plan to > register elsewhere)? I have a MPC8548 based board that which uses, at least for time being, SBC8548's init code(by claiming compatibility in DT) which has an external watchdog that implements reset functionality. The driver for watchdog is just a generic watchdog driver and having an ability to register custom reset handlers is very handy. I don't really have any motivation for fixing boards other than SBC8548 and even that I can avoid doing by making a new custom board file in my tree that would not populate .reset field. I can drop this patch from the series if the code of those boards is in "don't touch it unless absolutely have to" state. > >> diff --git a/arch/powerpc/platforms/85xx/bsc913x_qds.c >> b/arch/powerpc/platforms/85xx/bsc913x_qds.c >> index 07dd6ae..14ea7a0 100644 >> --- a/arch/powerpc/platforms/85xx/bsc913x_qds.c >> +++ b/arch/powerpc/platforms/85xx/bsc913x_qds.c >> @@ -53,6 +53,7 @@ static void __init bsc913x_qds_setup_arch(void) >> } >> >> machine_arch_initcall(bsc9132_qds, mpc85xx_common_publish_devices); >> +machine_arch_initcall(bsc9133_qds, fsl_rstcr_restart_register); > > Do we really still need to call the registration on a per-board basis, now > that boards have a way of registering a higher-priority notifier? Can't we > just have setup_rstcr() do the registration when it finds the appropriate > device tree node? I think we could, that idea just never occurred to me. What you describe should be a cleaner way to handle this change, I'll convert the code to do that in v2. > >> +int fsl_rstcr_restart_register(void) >> +{ >> + static struct notifier_block restart_handler; >> + >> + restart_handler.notifier_call = fsl_rstcr_restart; >> + restart_handler.priority = 128; >> + >> + return register_restart_handler(_handler); >> +} >> +EXPORT_SYMBOL(fsl_rstcr_restart_register); > > When would this ever get called from a module? Probably never, that's just a mistake on my part. Will remove in v2. Thanks, Andrey ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 3/3] powerpc: Convert fsl_rstcr_restart to a reset handler
On Mon, 2016-07-25 at 21:25 -0700, Andrey Smirnov wrote: > Convert fsl_rstcr_restart into a function to be registered with > register_reset_handler() API and introduce fls_rstcr_restart_register() > function that can be added as an initcall that would do aforementioned > registration. > > Signed-off-by: Andrey SmirnovIs there a particular motivation for this (e.g. new handlers you plan to register elsewhere)? > diff --git a/arch/powerpc/platforms/85xx/bsc913x_qds.c > b/arch/powerpc/platforms/85xx/bsc913x_qds.c > index 07dd6ae..14ea7a0 100644 > --- a/arch/powerpc/platforms/85xx/bsc913x_qds.c > +++ b/arch/powerpc/platforms/85xx/bsc913x_qds.c > @@ -53,6 +53,7 @@ static void __init bsc913x_qds_setup_arch(void) > } > > machine_arch_initcall(bsc9132_qds, mpc85xx_common_publish_devices); > +machine_arch_initcall(bsc9133_qds, fsl_rstcr_restart_register); Do we really still need to call the registration on a per-board basis, now that boards have a way of registering a higher-priority notifier? Can't we just have setup_rstcr() do the registration when it finds the appropriate device tree node? > +int fsl_rstcr_restart_register(void) > +{ > + static struct notifier_block restart_handler; > + > + restart_handler.notifier_call = fsl_rstcr_restart; > + restart_handler.priority = 128; > + > + return register_restart_handler(_handler); > +} > +EXPORT_SYMBOL(fsl_rstcr_restart_register); When would this ever get called from a module? -Scott ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 3/3] powerpc: Convert fsl_rstcr_restart to a reset handler
Convert fsl_rstcr_restart into a function to be registered with register_reset_handler() API and introduce fls_rstcr_restart_register() function that can be added as an initcall that would do aforementioned registration. Signed-off-by: Andrey Smirnov--- arch/powerpc/platforms/85xx/bsc913x_qds.c | 2 +- arch/powerpc/platforms/85xx/bsc913x_rdb.c | 2 +- arch/powerpc/platforms/85xx/c293pcie.c| 2 +- arch/powerpc/platforms/85xx/corenet_generic.c | 2 +- arch/powerpc/platforms/85xx/ge_imp3a.c| 2 +- arch/powerpc/platforms/85xx/mpc8536_ds.c | 2 +- arch/powerpc/platforms/85xx/mpc85xx_ads.c | 2 +- arch/powerpc/platforms/85xx/mpc85xx_cds.c | 26 +++--- arch/powerpc/platforms/85xx/mpc85xx_ds.c | 7 --- arch/powerpc/platforms/85xx/mpc85xx_mds.c | 7 --- arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 21 +++-- arch/powerpc/platforms/85xx/mvme2500.c| 2 +- arch/powerpc/platforms/85xx/p1010rdb.c| 2 +- arch/powerpc/platforms/85xx/p1022_ds.c| 2 +- arch/powerpc/platforms/85xx/p1022_rdk.c | 3 ++- arch/powerpc/platforms/85xx/p1023_rdb.c | 2 +- arch/powerpc/platforms/85xx/ppa8548.c | 2 +- arch/powerpc/platforms/85xx/qemu_e500.c | 2 +- arch/powerpc/platforms/85xx/sbc8548.c | 2 +- arch/powerpc/platforms/85xx/socrates.c| 2 +- arch/powerpc/platforms/85xx/stx_gp3.c | 2 +- arch/powerpc/platforms/85xx/tqm85xx.c | 2 +- arch/powerpc/platforms/85xx/twr_p102x.c | 2 +- arch/powerpc/platforms/85xx/xes_mpc85xx.c | 7 --- arch/powerpc/platforms/86xx/gef_ppc9a.c | 2 +- arch/powerpc/platforms/86xx/gef_sbc310.c | 2 +- arch/powerpc/platforms/86xx/gef_sbc610.c | 2 +- arch/powerpc/platforms/86xx/mpc8610_hpcd.c| 2 +- arch/powerpc/platforms/86xx/mpc86xx_hpcn.c| 2 +- arch/powerpc/platforms/86xx/sbc8641d.c| 2 +- arch/powerpc/sysdev/fsl_soc.c | 22 +- arch/powerpc/sysdev/fsl_soc.h | 2 +- 32 files changed, 86 insertions(+), 57 deletions(-) diff --git a/arch/powerpc/platforms/85xx/bsc913x_qds.c b/arch/powerpc/platforms/85xx/bsc913x_qds.c index 07dd6ae..14ea7a0 100644 --- a/arch/powerpc/platforms/85xx/bsc913x_qds.c +++ b/arch/powerpc/platforms/85xx/bsc913x_qds.c @@ -53,6 +53,7 @@ static void __init bsc913x_qds_setup_arch(void) } machine_arch_initcall(bsc9132_qds, mpc85xx_common_publish_devices); +machine_arch_initcall(bsc9133_qds, fsl_rstcr_restart_register); /* * Called very early, device-tree isn't unflattened @@ -72,7 +73,6 @@ define_machine(bsc9132_qds) { .pcibios_fixup_bus = fsl_pcibios_fixup_bus, #endif .get_irq= mpic_get_irq, - .restart= fsl_rstcr_restart, .calibrate_decr = generic_calibrate_decr, .progress = udbg_progress, }; diff --git a/arch/powerpc/platforms/85xx/bsc913x_rdb.c b/arch/powerpc/platforms/85xx/bsc913x_rdb.c index e48f671..cd4e717 100644 --- a/arch/powerpc/platforms/85xx/bsc913x_rdb.c +++ b/arch/powerpc/platforms/85xx/bsc913x_rdb.c @@ -43,6 +43,7 @@ static void __init bsc913x_rdb_setup_arch(void) } machine_device_initcall(bsc9131_rdb, mpc85xx_common_publish_devices); +machine_arch_initcall(bsc9131_rdb, fsl_rstcr_restart_register); /* * Called very early, device-tree isn't unflattened @@ -59,7 +60,6 @@ define_machine(bsc9131_rdb) { .setup_arch = bsc913x_rdb_setup_arch, .init_IRQ = bsc913x_rdb_pic_init, .get_irq= mpic_get_irq, - .restart= fsl_rstcr_restart, .calibrate_decr = generic_calibrate_decr, .progress = udbg_progress, }; diff --git a/arch/powerpc/platforms/85xx/c293pcie.c b/arch/powerpc/platforms/85xx/c293pcie.c index 3b9e3f0..fbd63f9 100644 --- a/arch/powerpc/platforms/85xx/c293pcie.c +++ b/arch/powerpc/platforms/85xx/c293pcie.c @@ -48,6 +48,7 @@ static void __init c293_pcie_setup_arch(void) } machine_arch_initcall(c293_pcie, mpc85xx_common_publish_devices); +machine_arch_initcall(c293_pcie, fsl_rstcr_restart_register); /* * Called very early, device-tree isn't unflattened @@ -65,7 +66,6 @@ define_machine(c293_pcie) { .setup_arch = c293_pcie_setup_arch, .init_IRQ = c293_pcie_pic_init, .get_irq= mpic_get_irq, - .restart= fsl_rstcr_restart, .calibrate_decr = generic_calibrate_decr, .progress = udbg_progress, }; diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c index 3a6a84f..297379b 100644 --- a/arch/powerpc/platforms/85xx/corenet_generic.c +++ b/arch/powerpc/platforms/85xx/corenet_generic.c @@ -225,7 +225,6 @@ define_machine(corenet_generic) {