Skip to content

Commit

Permalink
powerpc: Use is_kdump_kernel()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Milton Miller authored and paulusmack committed Oct 31, 2008
1 parent 1767c8f commit 62a8bd6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 0 additions & 2 deletions arch/powerpc/include/asm/kdump.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

#ifndef __ASSEMBLY__

extern unsigned long __kdump_flag;

#if defined(CONFIG_CRASH_DUMP) && !defined(CONFIG_RELOCATABLE)
extern void reserve_kdump_trampoline(void);
extern void setup_kdump_trampoline(void);
Expand Down
3 changes: 2 additions & 1 deletion arch/powerpc/kernel/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <linux/dma-mapping.h>
#include <linux/bitops.h>
#include <linux/iommu-helper.h>
#include <linux/crash_dump.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/iommu.h>
Expand Down Expand Up @@ -460,7 +461,7 @@ void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist,

static void iommu_table_clear(struct iommu_table *tbl)
{
if (!__kdump_flag) {
if (!is_kdump_kernel()) {
/* Clear the table in case firmware left allocations in it */
ppc_md.tce_free(tbl, tbl->it_offset, tbl->it_size);
return;
Expand Down
6 changes: 3 additions & 3 deletions arch/powerpc/platforms/cell/ras.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
#include <linux/kernel.h>
#include <linux/smp.h>
#include <linux/reboot.h>
#include <linux/kexec.h>
#include <linux/crash_dump.h>

#include <asm/reg.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/kexec.h>
#include <asm/machdep.h>
#include <asm/rtas.h>
#include <asm/cell-regs.h>
#include <asm/kdump.h>

#include "ras.h"

Expand Down Expand Up @@ -112,7 +112,7 @@ static int __init cbe_ptcal_enable_on_node(int nid, int order)
int ret = -ENOMEM;
unsigned long addr;

if (__kdump_flag)
if (is_kdump_kernel())
rtas_call(ptcal_stop_tok, 1, 1, NULL, nid);

area = kmalloc(sizeof(*area), GFP_KERNEL);
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/platforms/pseries/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <linux/string.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/crash_dump.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/rtas.h>
Expand All @@ -44,7 +45,6 @@
#include <asm/tce.h>
#include <asm/ppc-pci.h>
#include <asm/udbg.h>
#include <asm/kdump.h>

#include "plpar_wrappers.h"

Expand Down Expand Up @@ -292,7 +292,7 @@ static void iommu_table_setparms(struct pci_controller *phb,

tbl->it_base = (unsigned long)__va(*basep);

if (!__kdump_flag)
if (!is_kdump_kernel())
memset((void *)tbl->it_base, 0, *sizep);

tbl->it_busno = phb->bus->number;
Expand Down

0 comments on commit 62a8bd6

Please sign in to comment.