Re: [PATCH v2 1/1] kernel.h: Split out panic and oops helpers

2021-04-10 Thread Helge Deller

On 4/9/21 12:02 PM, Andy Shevchenko wrote:

kernel.h is being used as a dump for all kinds of stuff for a long time.
Here is the attempt to start cleaning it up by splitting out panic and
oops helpers.

There are several purposes of doing this:
- dropping dependency in bug.h
- dropping a loop by moving out panic_notifier.h
- unload kernel.h from something which has its own domain

At the same time convert users tree-wide to use new headers, although
for the time being include new header back to kernel.h to avoid twisted
indirected includes for existing users.

Signed-off-by: Andy Shevchenko 
Reviewed-by: Bjorn Andersson 
Acked-by: Mike Rapoport 
Acked-by: Corey Minyard 
Acked-by: Christian Brauner 
Acked-by: Arnd Bergmann 
Acked-by: Kees Cook 
Acked-by: Wei Liu 
Acked-by: Rasmus Villemoes 
Signed-off-by: Andrew Morton 


Acked-by: Helge Deller  # parisc

Helge



Re: [PATCH v2 1/1] kernel.h: Split out panic and oops helpers

2021-04-10 Thread Thomas Bogendoerfer
On Fri, Apr 09, 2021 at 01:02:50PM +0300, Andy Shevchenko wrote:
> kernel.h is being used as a dump for all kinds of stuff for a long time.
> Here is the attempt to start cleaning it up by splitting out panic and
> oops helpers.
> 
> There are several purposes of doing this:
> - dropping dependency in bug.h
> - dropping a loop by moving out panic_notifier.h
> - unload kernel.h from something which has its own domain
> 
> At the same time convert users tree-wide to use new headers, although
> for the time being include new header back to kernel.h to avoid twisted
> indirected includes for existing users.
> 
> Signed-off-by: Andy Shevchenko 
> Reviewed-by: Bjorn Andersson 
> Acked-by: Mike Rapoport 
> Acked-by: Corey Minyard 
> Acked-by: Christian Brauner 
> Acked-by: Arnd Bergmann 
> Acked-by: Kees Cook 
> Acked-by: Wei Liu 
> Acked-by: Rasmus Villemoes 
> Signed-off-by: Andrew Morton 
> ---
> v2:
>  - fixed all errors with allmodconfig on x86_64 (Andrew)
>  - checked with allyesconfig on x86_64
>  - additionally grepped source code for panic notifier list usage
>and converted all users
>  - elaborated commit message (Luis)
>  - collected given tags (incl. Andrew's SoB, see below)
> 
> I added Andrew's SoB since part of the fixes I took from him. Andrew,
> feel free to amend or tell me how you want me to do.
> 
>  arch/mips/kernel/relocate.c   |  1 +
>  arch/mips/sgi-ip22/ip22-reset.c   |  1 +
>  arch/mips/sgi-ip32/ip32-reset.c   |  1 +

Acked-by: Thomas Bogendoerfer 

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.[ RFC1925, 2.3 ]



Re: [PATCH v2 1/1] kernel.h: Split out panic and oops helpers

2021-04-09 Thread Luis Chamberlain
On Fri, Apr 09, 2021 at 01:02:50PM +0300, Andy Shevchenko wrote:
> kernel.h is being used as a dump for all kinds of stuff for a long time.
> Here is the attempt to start cleaning it up by splitting out panic and
> oops helpers.
> 
> There are several purposes of doing this:
> - dropping dependency in bug.h
> - dropping a loop by moving out panic_notifier.h
> - unload kernel.h from something which has its own domain
> 
> At the same time convert users tree-wide to use new headers, although
> for the time being include new header back to kernel.h to avoid twisted
> indirected includes for existing users.
> 
> Signed-off-by: Andy Shevchenko 
> Reviewed-by: Bjorn Andersson 
> Acked-by: Mike Rapoport 
> Acked-by: Corey Minyard 
> Acked-by: Christian Brauner 
> Acked-by: Arnd Bergmann 
> Acked-by: Kees Cook 
> Acked-by: Wei Liu 
> Acked-by: Rasmus Villemoes 
> Signed-off-by: Andrew Morton 

Acked-by: Luis Chamberlain 

  Luis



Re: [PATCH v2 1/1] kernel.h: Split out panic and oops helpers

2021-04-09 Thread Sebastian Reichel
Hi,

On Fri, Apr 09, 2021 at 01:02:50PM +0300, Andy Shevchenko wrote:
> kernel.h is being used as a dump for all kinds of stuff for a long time.
> Here is the attempt to start cleaning it up by splitting out panic and
> oops helpers.
> 
> There are several purposes of doing this:
> - dropping dependency in bug.h
> - dropping a loop by moving out panic_notifier.h
> - unload kernel.h from something which has its own domain
> 
> At the same time convert users tree-wide to use new headers, although
> for the time being include new header back to kernel.h to avoid twisted
> indirected includes for existing users.
> 
> Signed-off-by: Andy Shevchenko 
> Reviewed-by: Bjorn Andersson 
> Acked-by: Mike Rapoport 
> Acked-by: Corey Minyard 
> Acked-by: Christian Brauner 
> Acked-by: Arnd Bergmann 
> Acked-by: Kees Cook 
> Acked-by: Wei Liu 
> Acked-by: Rasmus Villemoes 
> Signed-off-by: Andrew Morton 
> ---
> v2:
>  - fixed all errors with allmodconfig on x86_64 (Andrew)
>  - checked with allyesconfig on x86_64
>  - additionally grepped source code for panic notifier list usage
>and converted all users
>  - elaborated commit message (Luis)
>  - collected given tags (incl. Andrew's SoB, see below)
> 
> I added Andrew's SoB since part of the fixes I took from him. Andrew,
> feel free to amend or tell me how you want me to do.
> 
> [...]
>  drivers/power/reset/ltc2952-poweroff.c|  1 +
> [...]

Acked-by: Sebastian Reichel 

-- Sebastian


signature.asc
Description: PGP signature


[PATCH v2 1/1] kernel.h: Split out panic and oops helpers

2021-04-09 Thread Andy Shevchenko
kernel.h is being used as a dump for all kinds of stuff for a long time.
Here is the attempt to start cleaning it up by splitting out panic and
oops helpers.

There are several purposes of doing this:
- dropping dependency in bug.h
- dropping a loop by moving out panic_notifier.h
- unload kernel.h from something which has its own domain

At the same time convert users tree-wide to use new headers, although
for the time being include new header back to kernel.h to avoid twisted
indirected includes for existing users.

Signed-off-by: Andy Shevchenko 
Reviewed-by: Bjorn Andersson 
Acked-by: Mike Rapoport 
Acked-by: Corey Minyard 
Acked-by: Christian Brauner 
Acked-by: Arnd Bergmann 
Acked-by: Kees Cook 
Acked-by: Wei Liu 
Acked-by: Rasmus Villemoes 
Signed-off-by: Andrew Morton 
---
v2:
 - fixed all errors with allmodconfig on x86_64 (Andrew)
 - checked with allyesconfig on x86_64
 - additionally grepped source code for panic notifier list usage
   and converted all users
 - elaborated commit message (Luis)
 - collected given tags (incl. Andrew's SoB, see below)

I added Andrew's SoB since part of the fixes I took from him. Andrew,
feel free to amend or tell me how you want me to do.

 arch/alpha/kernel/setup.c |  2 +-
 arch/arm64/kernel/setup.c |  1 +
 arch/mips/kernel/relocate.c   |  1 +
 arch/mips/sgi-ip22/ip22-reset.c   |  1 +
 arch/mips/sgi-ip32/ip32-reset.c   |  1 +
 arch/parisc/kernel/pdc_chassis.c  |  1 +
 arch/powerpc/kernel/setup-common.c|  1 +
 arch/s390/kernel/ipl.c|  1 +
 arch/sparc/kernel/sstate.c|  1 +
 arch/um/drivers/mconsole_kern.c   |  1 +
 arch/um/kernel/um_arch.c  |  1 +
 arch/x86/include/asm/desc.h   |  1 +
 arch/x86/kernel/cpu/mshyperv.c|  1 +
 arch/x86/kernel/setup.c   |  1 +
 arch/x86/purgatory/purgatory.c|  2 +
 arch/x86/xen/enlighten.c  |  1 +
 arch/xtensa/platforms/iss/setup.c |  1 +
 drivers/bus/brcmstb_gisb.c|  1 +
 drivers/char/ipmi/ipmi_msghandler.c   |  1 +
 drivers/clk/analogbits/wrpll-cln28hpc.c   |  4 +
 drivers/edac/altera_edac.c|  1 +
 drivers/firmware/google/gsmi.c|  1 +
 drivers/hv/vmbus_drv.c|  1 +
 .../hwtracing/coresight/coresight-cpu-debug.c |  1 +
 drivers/leds/trigger/ledtrig-activity.c   |  1 +
 drivers/leds/trigger/ledtrig-heartbeat.c  |  1 +
 drivers/leds/trigger/ledtrig-panic.c  |  1 +
 drivers/misc/bcm-vk/bcm_vk_dev.c  |  1 +
 drivers/misc/ibmasm/heartbeat.c   |  1 +
 drivers/misc/pvpanic/pvpanic.c|  1 +
 drivers/net/ipa/ipa_smp2p.c   |  1 +
 drivers/parisc/power.c|  1 +
 drivers/power/reset/ltc2952-poweroff.c|  1 +
 drivers/remoteproc/remoteproc_core.c  |  1 +
 drivers/s390/char/con3215.c   |  1 +
 drivers/s390/char/con3270.c   |  1 +
 drivers/s390/char/sclp.c  |  1 +
 drivers/s390/char/sclp_con.c  |  1 +
 drivers/s390/char/sclp_vt220.c|  1 +
 drivers/s390/char/zcore.c |  1 +
 drivers/soc/bcm/brcmstb/pm/pm-arm.c   |  1 +
 drivers/staging/olpc_dcon/olpc_dcon.c |  1 +
 drivers/video/fbdev/hyperv_fb.c   |  1 +
 include/asm-generic/bug.h |  3 +-
 include/linux/kernel.h| 84 +---
 include/linux/panic.h | 98 +++
 include/linux/panic_notifier.h| 12 +++
 kernel/hung_task.c|  1 +
 kernel/kexec_core.c   |  1 +
 kernel/panic.c|  1 +
 kernel/rcu/tree.c |  2 +
 kernel/sysctl.c   |  1 +
 kernel/trace/trace.c  |  1 +
 53 files changed, 167 insertions(+), 85 deletions(-)
 create mode 100644 include/linux/panic.h
 create mode 100644 include/linux/panic_notifier.h

diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index 03dda3beb3bd..5d1296534682 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -46,7 +47,6 @@
 #include 
 #include 
 
-extern struct atomic_notifier_head panic_notifier_list;
 static int alpha_panic_event(struct notifier_block *, unsigned long, void *);
 static struct notifier_block alpha_panic_block = {
alpha_panic_event,
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 61845c0821d9..787bc0f601b3 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include