summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoff Levand <geoffrey.levand@am.sony.com>2007-05-09 15:35:19 -0700
committerSimon Horman <horms@verge.net.au>2007-05-15 13:36:33 +0900
commit02f4088ffded3d6f99a0c9f835727943d102b3df (patch)
tree9a5ab05c3b9d3f80b24bb8897f5aa8333bf15ac3
parent13ceb63c96c26e1964dea12576d7245853a83842 (diff)
kexec fix ppc64 device-tree mem node
Change the ppc64 device-tree memory node name spec to match the allowable names specified in the booting-without-of document. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/arch/ppc64/crashdump-ppc64.c3
-rw-r--r--kexec/arch/ppc64/kexec-ppc64.c14
2 files changed, 11 insertions, 6 deletions
diff --git a/kexec/arch/ppc64/crashdump-ppc64.c b/kexec/arch/ppc64/crashdump-ppc64.c
index 9c0b621..0ef093e 100644
--- a/kexec/arch/ppc64/crashdump-ppc64.c
+++ b/kexec/arch/ppc64/crashdump-ppc64.c
@@ -129,7 +129,8 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges)
goto err;
}
while ((dentry = readdir(dir)) != NULL) {
- if (strncmp(dentry->d_name, "memory@", 7))
+ if (strncmp(dentry->d_name, "memory@", 7) &&
+ strcmp(dentry->d_name, "memory"))
continue;
strcpy(fname, device_tree);
strcat(fname, dentry->d_name);
diff --git a/kexec/arch/ppc64/kexec-ppc64.c b/kexec/arch/ppc64/kexec-ppc64.c
index 63a7f1c..3d233cf 100644
--- a/kexec/arch/ppc64/kexec-ppc64.c
+++ b/kexec/arch/ppc64/kexec-ppc64.c
@@ -98,7 +98,7 @@ err1:
}
/*
- * Count the memory@ nodes under /proc/device-tree and populate the
+ * Count the memory nodes under /proc/device-tree and populate the
* max_memory_ranges variable. This variable replaces MAX_MEMORY_RANGES
* macro used earlier.
*/
@@ -115,7 +115,8 @@ static int count_memory_ranges(void)
while ((dentry = readdir(dir)) != NULL) {
if (strncmp(dentry->d_name, "memory@", 7) &&
- strncmp(dentry->d_name, "pci@", 4))
+ strcmp(dentry->d_name, "memory") &&
+ strncmp(dentry->d_name, "pci@", 4))
continue;
max_memory_ranges++;
}
@@ -170,7 +171,8 @@ static int get_base_ranges(void)
return -1;
}
while ((dentry = readdir(dir)) != NULL) {
- if (strncmp(dentry->d_name, "memory@", 7))
+ if (strncmp(dentry->d_name, "memory@", 7) &&
+ strcmp(dentry->d_name, "memory"))
continue;
strcpy(fname, device_tree);
strcat(fname, dentry->d_name);
@@ -272,7 +274,8 @@ static int get_devtree_details(unsigned long kexec_flags)
while ((dentry = readdir(dir)) != NULL) {
if (strncmp(dentry->d_name, "chosen", 6) &&
- strncmp(dentry->d_name, "memory@0", 8) &&
+ strncmp(dentry->d_name, "memory@", 7) &&
+ strcmp(dentry->d_name, "memory") &&
strncmp(dentry->d_name, "pci@", 4) &&
strncmp(dentry->d_name, "rtas", 4))
continue;
@@ -452,7 +455,8 @@ static int get_devtree_details(unsigned long kexec_flags)
add_usable_mem_rgns(rtas_base, rtas_size);
} /* rtas */
- if (strncmp(dentry->d_name, "memory@0", 8) == 0) {
+ if (!strncmp(dentry->d_name, "memory@", 7) ||
+ !strcmp(dentry->d_name, "memory")) {
strcat(fname, "/reg");
if ((file = fopen(fname, "r")) == NULL) {
perror(fname);