Commit 62a8bd6c9246c0e1f19dfb8fc65ad7c4f7cac8bb

Authored by Milton Miller
Committed by Paul Mackerras
1 parent 1767c8f392

powerpc: Use is_kdump_kernel()

linux/crash_dump.h defines is_kdump_kernel() to be used by code that
needs to know if the previous kernel crashed instead of a (clean) boot
or reboot.

This updates the just added powerpc code to use it.  This is needed
for the next commit, which will remove __kdump_flag.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

Showing 4 changed files with 7 additions and 8 deletions Side-by-side Diff

arch/powerpc/include/asm/kdump.h
... ... @@ -20,8 +20,6 @@
20 20  
21 21 #ifndef __ASSEMBLY__
22 22  
23   -extern unsigned long __kdump_flag;
24   -
25 23 #if defined(CONFIG_CRASH_DUMP) && !defined(CONFIG_RELOCATABLE)
26 24 extern void reserve_kdump_trampoline(void);
27 25 extern void setup_kdump_trampoline(void);
arch/powerpc/kernel/iommu.c
... ... @@ -32,6 +32,7 @@
32 32 #include <linux/dma-mapping.h>
33 33 #include <linux/bitops.h>
34 34 #include <linux/iommu-helper.h>
  35 +#include <linux/crash_dump.h>
35 36 #include <asm/io.h>
36 37 #include <asm/prom.h>
37 38 #include <asm/iommu.h>
... ... @@ -460,7 +461,7 @@
460 461  
461 462 static void iommu_table_clear(struct iommu_table *tbl)
462 463 {
463   - if (!__kdump_flag) {
  464 + if (!is_kdump_kernel()) {
464 465 /* Clear the table in case firmware left allocations in it */
465 466 ppc_md.tce_free(tbl, tbl->it_offset, tbl->it_size);
466 467 return;
arch/powerpc/platforms/cell/ras.c
... ... @@ -13,15 +13,15 @@
13 13 #include <linux/kernel.h>
14 14 #include <linux/smp.h>
15 15 #include <linux/reboot.h>
  16 +#include <linux/kexec.h>
  17 +#include <linux/crash_dump.h>
16 18  
17 19 #include <asm/reg.h>
18 20 #include <asm/io.h>
19 21 #include <asm/prom.h>
20   -#include <asm/kexec.h>
21 22 #include <asm/machdep.h>
22 23 #include <asm/rtas.h>
23 24 #include <asm/cell-regs.h>
24   -#include <asm/kdump.h>
25 25  
26 26 #include "ras.h"
27 27  
... ... @@ -112,7 +112,7 @@
112 112 int ret = -ENOMEM;
113 113 unsigned long addr;
114 114  
115   - if (__kdump_flag)
  115 + if (is_kdump_kernel())
116 116 rtas_call(ptcal_stop_tok, 1, 1, NULL, nid);
117 117  
118 118 area = kmalloc(sizeof(*area), GFP_KERNEL);
arch/powerpc/platforms/pseries/iommu.c
... ... @@ -32,6 +32,7 @@
32 32 #include <linux/string.h>
33 33 #include <linux/pci.h>
34 34 #include <linux/dma-mapping.h>
  35 +#include <linux/crash_dump.h>
35 36 #include <asm/io.h>
36 37 #include <asm/prom.h>
37 38 #include <asm/rtas.h>
... ... @@ -44,7 +45,6 @@
44 45 #include <asm/tce.h>
45 46 #include <asm/ppc-pci.h>
46 47 #include <asm/udbg.h>
47   -#include <asm/kdump.h>
48 48  
49 49 #include "plpar_wrappers.h"
50 50  
... ... @@ -292,7 +292,7 @@
292 292  
293 293 tbl->it_base = (unsigned long)__va(*basep);
294 294  
295   - if (!__kdump_flag)
  295 + if (!is_kdump_kernel())
296 296 memset((void *)tbl->it_base, 0, *sizep);
297 297  
298 298 tbl->it_busno = phb->bus->number;